List:Commits« Previous MessageNext Message »
From:Sven Sandberg Date:August 6 2008 1:50pm
Subject:bzr push into mysql-6.0 branch (sven:2683) Bug#37493 Bug#38068 Bug#38077
Bug#38170 Bug#38178
View as plain text  
 2683 Sven Sandberg	2008-08-06 [merge]
      merged 6.0 main -> 6.0-rpl-testfixes
      all files automerged without conflict
modified:
  mysql-test/extra/binlog_tests/binlog_insert_delayed.test
  mysql-test/include/show_binlog_events.inc
  mysql-test/suite/binlog/r/binlog_killed_simulate.result
  mysql-test/suite/binlog/r/binlog_row_binlog.result
  mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
  mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
  mysql-test/suite/binlog/r/binlog_stm_binlog.result
  mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
  mysql-test/suite/rpl/r/rpl_loaddata_map.result
  mysql-test/suite/rpl/r/rpl_stm_log.result
  mysql-test/suite/rpl/r/rpl_variables.result
  mysql-test/suite/rpl/t/rpl_incident.test
  mysql-test/suite/rpl/t/rpl_loaddata_map.test
  mysql-test/suite/rpl/t/rpl_trunc_temp.test
  mysql-test/suite/rpl/t/rpl_variables.test

=== modified file 'include/my_handler.h'
--- a/include/my_handler.h	2008-06-26 17:48:42 +0000
+++ b/include/my_handler.h	2008-07-24 11:33:35 +0000
@@ -54,8 +54,8 @@ typedef struct st_HA_KEYSEG		/* Key-port
   uint16 bit_pos;                       /* Position to bit part */
   uint16 flag;
   uint16 length;			/* Keylength */
+  uint16 language;
   uint8  type;				/* Type of key (for sort) */
-  uint8  language;
   uint8  null_bit;			/* bitmask to test for NULL */
   uint8  bit_start,bit_end;		/* if bit field */
   uint8  bit_length;                    /* Length of bit part */

=== modified file 'include/my_sys.h'
--- a/include/my_sys.h	2008-07-21 09:17:03 +0000
+++ b/include/my_sys.h	2008-07-24 11:33:35 +0000
@@ -233,8 +233,9 @@ extern uint    my_large_page_size;
 #endif
 
 /* charsets */
+#define MY_ALL_CHARSETS_SIZE 512
 extern CHARSET_INFO *default_charset_info;
-extern CHARSET_INFO *all_charsets[256];
+extern CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
 extern CHARSET_INFO compiled_charsets[];
 
 /* statistics */

=== modified file 'include/myisam.h'
--- a/include/myisam.h	2008-07-09 07:12:43 +0000
+++ b/include/myisam.h	2008-07-24 11:33:35 +0000
@@ -168,7 +168,7 @@ typedef struct st_mi_create_info
   ulonglong data_file_length;
   ulonglong key_file_length;
   uint old_options;
-  uint8 language;
+  uint16 language;
   my_bool with_auto_increment;
 } MI_CREATE_INFO;
 

=== modified file 'include/myisamchk.h'
--- a/include/myisamchk.h	2008-04-10 02:26:36 +0000
+++ b/include/myisamchk.h	2008-07-24 11:33:35 +0000
@@ -148,7 +148,7 @@ typedef struct st_handler_check_param
   uint key_cache_block_size, pagecache_block_size;
   int tmpfile_createflag, err_count;
   myf myf_rw;
-  uint8 language;
+  uint16 language;
   my_bool using_global_keycache, opt_lock_memory, opt_follow_links;
   my_bool retry_repair, force_sort, calc_checksum, static_row_size;
   char temp_filename[FN_REFLEN];

=== modified file 'mysql-test/r/ctype_ldml.result'
--- a/mysql-test/r/ctype_ldml.result	2007-10-22 11:43:32 +0000
+++ b/mysql-test/r/ctype_ldml.result	2008-07-24 11:33:35 +0000
@@ -8,7 +8,7 @@ Variable_name	Value
 character_sets_dir	MYSQL_TEST_DIR/std_data/
 show collation like 'utf8_test_ci';
 Collation	Charset	Id	Default	Compiled	Sortlen
-utf8_test_ci	utf8	253			8
+utf8_test_ci	utf8	353			8
 create table t1 (c1 char(1) character set utf8 collate utf8_test_ci);
 insert into t1 values ('a');
 select * from t1 where c1='b';
@@ -17,7 +17,7 @@ a
 drop table t1;
 show collation like 'ucs2_test_ci';
 Collation	Charset	Id	Default	Compiled	Sortlen
-ucs2_test_ci	ucs2	158			8
+ucs2_test_ci	ucs2	358			8
 create table t1 (c1 char(1) character set ucs2 collate ucs2_test_ci);
 insert into t1 values ('a');
 select * from t1 where c1='b';
@@ -26,7 +26,7 @@ a
 drop table t1;
 show collation like 'utf16_test_ci';
 Collation	Charset	Id	Default	Compiled	Sortlen
-utf16_test_ci	utf16	127			8
+utf16_test_ci	utf16	327			8
 create table t1 (c1 char(1) character set utf16 collate utf16_test_ci);
 insert into t1 values ('a');
 select * from t1 where c1='b';
@@ -35,7 +35,7 @@ a
 drop table t1;
 show collation like 'utf32_test_ci';
 Collation	Charset	Id	Default	Compiled	Sortlen
-utf32_test_ci	utf32	191			8
+utf32_test_ci	utf32	391			8
 create table t1 (c1 char(1) character set utf32 collate utf32_test_ci);
 insert into t1 values ('a');
 select * from t1 where c1='b';
@@ -45,7 +45,7 @@ drop table t1;
 Vietnamese experimental collation
 show collation like 'ucs2_vn_ci';
 Collation	Charset	Id	Default	Compiled	Sortlen
-ucs2_vn_ci	ucs2	159			8
+ucs2_vn_ci	ucs2	359			8
 create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
 insert into t1 values (0x0061),(0x0041),(0x00E0),(0x00C0),(0x1EA3),(0x1EA2),
 (0x00E3),(0x00C3),(0x00E1),(0x00C1),(0x1EA1),(0x1EA0);
@@ -316,3 +316,29 @@ Vv
 Xx
 YyÝýỲỳỴỵỶỷỸỹ
 drop table t1;
+The following tests check that two-byte collation IDs work
+select * from information_schema.collations where id>256 order by id;
+COLLATION_NAME	CHARACTER_SET_NAME	ID	IS_DEFAULT	IS_COMPILED	SORTLEN
+utf16_test_ci	utf16	327			8
+utf8_test_ci	utf8	353			8
+ucs2_test_ci	ucs2	358			8
+ucs2_vn_ci	ucs2	359			8
+utf32_test_ci	utf32	391			8
+show collation like '%test%';
+Collation	Charset	Id	Default	Compiled	Sortlen
+ucs2_test_ci	ucs2	358			8
+utf8_test_ci	utf8	353			8
+utf16_test_ci	utf16	327			8
+utf32_test_ci	utf32	391			8
+show collation like 'ucs2_vn_ci';
+Collation	Charset	Id	Default	Compiled	Sortlen
+ucs2_vn_ci	ucs2	359			8
+create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
+insert into t1 values (0x0061);
+set @@character_set_results=NULL;
+select * from t1;
+Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
+def	test	t1	t1	c1	c1	254	2	2	Y	0	0	359
+c1
+a
+drop table t1;

=== modified file 'mysql-test/std_data/Index.xml'
--- a/mysql-test/std_data/Index.xml	2007-10-22 11:43:32 +0000
+++ b/mysql-test/std_data/Index.xml	2008-07-24 11:33:35 +0000
@@ -1,7 +1,7 @@
 <charsets>
 
   <charset name="utf8">
-    <collation name="utf8_test_ci" id="253">
+    <collation name="utf8_test_ci" id="353">
       <rules>
         <reset>a</reset>
         <s>b</s>
@@ -11,7 +11,7 @@
   </charset>
 
   <charset name="utf16">
-    <collation name="utf16_test_ci" id="127">
+    <collation name="utf16_test_ci" id="327">
       <rules>
         <reset>a</reset>
         <s>b</s>
@@ -20,7 +20,7 @@
   </charset>
 
   <charset name="utf32">
-    <collation name="utf32_test_ci" id="191">
+    <collation name="utf32_test_ci" id="391">
       <rules>
         <reset>a</reset>
         <s>b</s>
@@ -31,13 +31,13 @@
 
 
   <charset name="ucs2">
-    <collation name="ucs2_test_ci" id="158">
+    <collation name="ucs2_test_ci" id="358">
       <rules>
         <reset>a</reset>
         <s>b</s>
       </rules>
     </collation>
-    <collation name="ucs2_vn_ci" id="159">
+    <collation name="ucs2_vn_ci" id="359">
       <!-- Vietnamese experimental collation -->
       <rules>
         <reset>A</reset>

=== modified file 'mysql-test/suite/falcon/r/falcon_tablespace_priv.result'
--- a/mysql-test/suite/falcon/r/falcon_tablespace_priv.result	2008-07-25 18:44:20 +0000
+++ b/mysql-test/suite/falcon/r/falcon_tablespace_priv.result	2008-08-04 06:58:12 +0000
@@ -42,3 +42,29 @@ ERROR 42000: Access denied; you need the
 
 DROP USER mysqltest_u1@localhost;
 DROP USER mysqltest_u2@localhost;
+# --
+# -- Bug#31302: USE information_schema disables DROP tablespace
+# --
+GRANT CREATE TABLESPACE ON *.* TO mysqltest_u1@localhost;
+
+# -- Connection: mysqltest_u1@localhost
+
+# -- Grants for mysqltest_u1@localhost:
+SHOW GRANTS;
+Grants for mysqltest_u1@localhost
+GRANT CREATE TABLESPACE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# -- CREATE TABLESPACE...
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+ENGINE = Falcon;
+
+use INFORMATION_SCHEMA;
+
+# -- DROP TABLESPACE...
+DROP TABLESPACE ts1 
+ENGINE = Falcon;
+
+# -- Connection: root@localhost
+
+DROP USER mysqltest_u1@localhost;

=== modified file 'mysql-test/suite/falcon/t/falcon_tablespace_priv.test'
--- a/mysql-test/suite/falcon/t/falcon_tablespace_priv.test	2008-07-25 18:44:20 +0000
+++ b/mysql-test/suite/falcon/t/falcon_tablespace_priv.test	2008-08-04 06:58:12 +0000
@@ -56,3 +56,39 @@ ENGINE = Falcon;
 
 DROP USER mysqltest_u1@localhost;
 DROP USER mysqltest_u2@localhost;
+
+--echo # --
+--echo # -- Bug#31302: USE information_schema disables DROP tablespace
+--echo # --
+
+GRANT CREATE TABLESPACE ON *.* TO mysqltest_u1@localhost;
+
+--echo
+--echo # -- Connection: mysqltest_u1@localhost
+--echo
+--connect(con1, localhost, mysqltest_u1,,)
+
+--echo # -- Grants for mysqltest_u1@localhost:
+SHOW GRANTS;
+
+--echo
+--echo # -- CREATE TABLESPACE...
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+ENGINE = Falcon;
+
+--echo
+use INFORMATION_SCHEMA;
+
+--echo
+--echo # -- DROP TABLESPACE...
+DROP TABLESPACE ts1 
+ENGINE = Falcon;
+
+--echo
+--echo # -- Connection: root@localhost
+--echo
+--connection default
+--disconnect con1
+
+DROP USER mysqltest_u1@localhost;

=== modified file 'mysql-test/t/ctype_ldml.test'
--- a/mysql-test/t/ctype_ldml.test	2007-10-22 11:43:32 +0000
+++ b/mysql-test/t/ctype_ldml.test	2008-07-24 11:33:35 +0000
@@ -77,3 +77,21 @@ select hex(c1) as h, c1 from t1 order by
 select group_concat(hex(c1) order by hex(c1)) from t1 group by c1;
 select group_concat(c1 order by hex(c1) SEPARATOR '') from t1 group by c1;
 drop table t1;
+
+
+-- echo The following tests check that two-byte collation IDs work
+-- The file ../std-data/Index.xml has a number of collations with high IDs.
+
+# Test that the "ID" column in I_S and SHOW queries can handle two bytes
+select * from information_schema.collations where id>256 order by id;
+show collation like '%test%';
+
+# Test that two-byte collation ID is correctly transfered to the client side.
+show collation like 'ucs2_vn_ci';
+create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
+insert into t1 values (0x0061);
+--enable_metadata
+set @@character_set_results=NULL;
+select * from t1;
+--disable_metadata
+drop table t1;

=== modified file 'mysys/charset.c'
--- a/mysys/charset.c	2008-02-19 21:53:33 +0000
+++ b/mysys/charset.c	2008-07-24 11:33:35 +0000
@@ -410,7 +410,7 @@ char *get_charsets_dir(char *buf)
   DBUG_RETURN(res);
 }
 
-CHARSET_INFO *all_charsets[256];
+CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
 CHARSET_INFO *default_charset_info = &my_charset_latin1;
 
 void add_compiled_collation(CHARSET_INFO *cs)

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2008-07-24 07:44:21 +0000
+++ b/sql/sql_show.cc	2008-07-29 12:08:01 +0000
@@ -4000,7 +4000,9 @@ int fill_schema_charsets(THD *thd, TABLE
   TABLE *table= tables->table;
   CHARSET_INFO *scs= system_charset_info;
 
-  for (cs= all_charsets ; cs < all_charsets+255 ; cs++)
+  for (cs= all_charsets ;
+       cs < all_charsets + array_elements(all_charsets) ;
+       cs++)
   {
     CHARSET_INFO *tmp_cs= cs[0];
     if (tmp_cs && (tmp_cs->state & MY_CS_PRIMARY) &&
@@ -4079,7 +4081,9 @@ int fill_schema_collation(THD *thd, TABL
   const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
   TABLE *table= tables->table;
   CHARSET_INFO *scs= system_charset_info;
-  for (cs= all_charsets ; cs < all_charsets+255 ; cs++ )
+  for (cs= all_charsets ;
+       cs < all_charsets + array_elements(all_charsets)  ;
+       cs++ )
   {
     CHARSET_INFO **cl;
     CHARSET_INFO *tmp_cs= cs[0];
@@ -4087,7 +4091,9 @@ int fill_schema_collation(THD *thd, TABL
          (tmp_cs->state & MY_CS_HIDDEN) ||
         !(tmp_cs->state & MY_CS_PRIMARY))
       continue;
-    for (cl= all_charsets; cl < all_charsets+255 ;cl ++)
+    for (cl= all_charsets;
+         cl < all_charsets + array_elements(all_charsets)  ;
+         cl ++)
     {
       CHARSET_INFO *tmp_cl= cl[0];
       if (!tmp_cl || !(tmp_cl->state & MY_CS_AVAILABLE) ||
@@ -4120,14 +4126,18 @@ int fill_schema_coll_charset_app(THD *th
   CHARSET_INFO **cs;
   TABLE *table= tables->table;
   CHARSET_INFO *scs= system_charset_info;
-  for (cs= all_charsets ; cs < all_charsets+255 ; cs++ )
+  for (cs= all_charsets ;
+       cs < all_charsets + array_elements(all_charsets) ;
+       cs++ )
   {
     CHARSET_INFO **cl;
     CHARSET_INFO *tmp_cs= cs[0];
     if (!tmp_cs || !(tmp_cs->state & MY_CS_AVAILABLE) ||
         !(tmp_cs->state & MY_CS_PRIMARY))
       continue;
-    for (cl= all_charsets; cl < all_charsets+255 ;cl ++)
+    for (cl= all_charsets;
+         cl < all_charsets + array_elements(all_charsets) ;
+         cl ++)
     {
       CHARSET_INFO *tmp_cl= cl[0];
       if (!tmp_cl || !(tmp_cl->state & MY_CS_AVAILABLE) ||

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2008-07-14 12:49:19 +0000
+++ b/sql/table.cc	2008-07-29 12:08:01 +0000
@@ -736,7 +736,8 @@ static int open_binary_frm(THD *thd, TAB
     share->transactional= (ha_choice) (head[39] & 3);
     share->page_checksum= (ha_choice) ((head[39] >> 2) & 3);
     share->row_type= (row_type) head[40];
-    share->table_charset= get_charset((uint) head[38],MYF(0));
+    share->table_charset= get_charset((((uint) head[41]) << 8) + 
+                                        (uint) head[38],MYF(0));
     share->null_field_first= 1;
   }
   if (!share->table_charset)
@@ -1273,12 +1274,13 @@ static int open_binary_frm(THD *thd, TAB
       }
       else
       {
-        if (!strpos[14])
+        uint csid= strpos[14] + (((uint) strpos[11]) << 8);
+        if (!csid)
           charset= &my_charset_bin;
-        else if (!(charset=get_charset((uint) strpos[14], MYF(0))))
+        else if (!(charset= get_charset(csid, MYF(0))))
         {
           error= 5; // Unknown or unavailable charset
-          errarg= (int) strpos[14];
+          errarg= (int) csid;
           goto err;
         }
       }
@@ -2548,8 +2550,7 @@ File create_frm(THD *thd, const char *na
 
   if ((file= my_create(name, CREATE_MODE, create_flags, MYF(0))) >= 0)
   {
-    uint key_length, tmp_key_length;
-    uint tmp;
+    uint key_length, tmp_key_length, tmp, csid;
     bzero((char*) fileinfo,64);
     /* header */
     fileinfo[0]=(uchar) 254;
@@ -2598,13 +2599,14 @@ File create_frm(THD *thd, const char *na
     fileinfo[32]=0;				// No filename anymore
     fileinfo[33]=5;                             // Mark for 5.0 frm file
     int4store(fileinfo+34,create_info->avg_row_length);
-    fileinfo[38]= (create_info->default_table_charset ?
-		   create_info->default_table_charset->number : 0);
+    csid= (create_info->default_table_charset ?
+           create_info->default_table_charset->number : 0);
+    fileinfo[38]= (uchar) csid;
     fileinfo[39]= (uchar) ((uint) create_info->transactional |
                            ((uint) create_info->page_checksum << 2));
     fileinfo[40]= (uchar) create_info->row_type;
     /* Next few bytes where for RAID support */
-    fileinfo[41]= 0;
+    fileinfo[41]= (uchar) (csid >> 8);
     fileinfo[42]= 0;
     fileinfo[43]= 0;
     fileinfo[44]= 0;

=== modified file 'sql/unireg.cc'
--- a/sql/unireg.cc	2008-05-29 15:44:11 +0000
+++ b/sql/unireg.cc	2008-07-24 11:33:35 +0000
@@ -874,20 +874,27 @@ static bool pack_fields(File file, List<
     recpos= field->offset+1 + (uint) data_offset;
     int3store(buff+5,recpos);
     int2store(buff+8,field->pack_flag);
-    int2store(buff+10,field->unireg_check);
+    DBUG_ASSERT(field->unireg_check < 256);
+    buff[10]= (uchar) field->unireg_check;
     buff[12]= (uchar) field->interval_id;
     buff[13]= (uchar) field->sql_type; 
     if (field->sql_type == MYSQL_TYPE_GEOMETRY)
     {
+      buff[11]= 0;
       buff[14]= (uchar) field->geom_type;
 #ifndef HAVE_SPATIAL
       DBUG_ASSERT(0);                           // Should newer happen
 #endif
     }
     else if (field->charset) 
+    {
+      buff[11]= (uchar) (field->charset->number >> 8);
       buff[14]= (uchar) field->charset->number;
+    }
     else
-      buff[14]= 0;				// Numerical
+    {
+      buff[11]= buff[14]= 0;			// Numerical
+    }
     int2store(buff+15, field->comment.length);
     comment_length+= field->comment.length;
     set_if_bigger(int_count,field->interval_id);

=== modified file 'storage/myisam/ft_static.c'
--- a/storage/myisam/ft_static.c	2008-04-28 16:24:05 +0000
+++ b/storage/myisam/ft_static.c	2008-07-24 11:33:35 +0000
@@ -30,8 +30,8 @@ const HA_KEYSEG ft_keysegs[FT_SEGS]={
   0,                                            /* Bit pos */
   HA_VAR_LENGTH_PART | HA_PACK_KEY,             /* flag */
   HA_FT_MAXBYTELEN,                             /* length */
-  HA_KEYTYPE_VARTEXT2,                          /* type */
   63,                                           /* language (will be overwritten) */
+  HA_KEYTYPE_VARTEXT2,                          /* type */
   0,                                            /* null_bit */
   2, 0, 0                                       /* bit_start, bit_end, bit_length */
 },
@@ -41,7 +41,7 @@ const HA_KEYSEG ft_keysegs[FT_SEGS]={
       be packed in any way, otherwise w_search() won't be able to
       update key entry 'in vivo'
     */
-  0, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, HA_FT_WTYPE, 63, 0, 0, 0, 0
+  0, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, 63, HA_FT_WTYPE, 0, 0, 0, 0
 }
 };
 

=== modified file 'storage/myisam/mi_open.c'
--- a/storage/myisam/mi_open.c	2008-07-09 07:12:43 +0000
+++ b/storage/myisam/mi_open.c	2008-07-24 11:33:35 +0000
@@ -1194,10 +1194,10 @@ int mi_keyseg_write(File file, const HA_
   ulong pos;
 
   *ptr++= keyseg->type;
-  *ptr++= keyseg->language;
+  *ptr++= keyseg->language & 0xFF; /* Collation ID, low byte */
   *ptr++= keyseg->null_bit;
   *ptr++= keyseg->bit_start;
-  *ptr++= keyseg->bit_end;
+  *ptr++= keyseg->language >> 8; /* Collation ID, high byte */
   *ptr++= keyseg->bit_length;
   mi_int2store(ptr,keyseg->flag);	ptr+=2;
   mi_int2store(ptr,keyseg->length);	ptr+=2;
@@ -1216,12 +1216,13 @@ uchar *mi_keyseg_read(uchar *ptr, HA_KEY
    keyseg->language	= *ptr++;
    keyseg->null_bit	= *ptr++;
    keyseg->bit_start	= *ptr++;
-   keyseg->bit_end	= *ptr++;
+   keyseg->language	+= ((uint16) (*ptr++)) << 8;
    keyseg->bit_length   = *ptr++;
    keyseg->flag		= mi_uint2korr(ptr);  ptr +=2;
    keyseg->length	= mi_uint2korr(ptr);  ptr +=2;
    keyseg->start	= mi_uint4korr(ptr);  ptr +=4;
    keyseg->null_pos	= mi_uint4korr(ptr);  ptr +=4;
+   keyseg->bit_end= 0;
    keyseg->charset=0;				/* Will be filled in later */
    if (keyseg->null_bit)
      keyseg->bit_pos= (uint16)(keyseg->null_pos + (keyseg->null_bit == 7));

=== modified file 'strings/conf_to_src.c'
--- a/strings/conf_to_src.c	2007-08-24 23:25:50 +0000
+++ b/strings/conf_to_src.c	2008-07-24 11:33:35 +0000
@@ -23,7 +23,7 @@
 #define ROW16_LEN	8
 #define MAX_BUF		64*1024
 
-static CHARSET_INFO all_charsets[256];
+static CHARSET_INFO all_charsets[512];
 
 
 void
@@ -63,7 +63,9 @@ print_array16(FILE *f, const char *set, 
 static int get_charset_number(const char *charset_name)
 {
   CHARSET_INFO *cs;
-  for (cs= all_charsets; cs < all_charsets+255; ++cs)
+  for (cs= all_charsets;
+       cs < all_charsets + array_elements(all_charsets);
+       cs++)
   {
     if ( cs->name && !strcmp(cs->name, charset_name))
       return cs->number;
@@ -290,7 +292,9 @@ main(int argc, char **argv  __attribute_
   sprintf(filename,"%s/%s",argv[1],"Index.xml");
   my_read_charset_file(filename);
   
-  for (cs=all_charsets; cs < all_charsets+256; cs++)
+  for (cs= all_charsets;
+       cs < all_charsets + array_elements(all_charsets);
+       cs++)
   {
     if (cs->number && !(cs->state & MY_CS_COMPILED))
     {
@@ -315,7 +319,9 @@ main(int argc, char **argv  __attribute_
   fprintf(f,"#include <m_ctype.h>\n\n");
   
   
-  for (cs=all_charsets; cs < all_charsets+256; cs++)
+  for (cs= all_charsets;
+       cs < all_charsets + array_elements(all_charsets);
+       cs++)
   {
     if (simple_cs_is_full(cs))
     {
@@ -332,7 +338,9 @@ main(int argc, char **argv  __attribute_
   }
   
   fprintf(f,"CHARSET_INFO compiled_charsets[] = {\n");
-  for (cs=all_charsets; cs < all_charsets+256; cs++)
+  for (cs= all_charsets;
+       cs < all_charsets + array_elements(all_charsets);
+       cs++)
   {
     if (simple_cs_is_full(cs))
     {

Thread
bzr push into mysql-6.0 branch (sven:2683) Bug#37493 Bug#38068 Bug#38077Bug#38170 Bug#38178Sven Sandberg6 Aug