MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:July 7 2009 12:38pm
Subject:bzr commit into mysql-5.1-bugteam branch (guilhem:3007) Bug#45829
View as plain text  
#At file:///home/mysql_src/bzrrepos/mysql-5.1-bugteam/ based on revid:v.narayanan@stripped

 3007 Guilhem Bichot	2009-07-07
      Bug#45829 "CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing":
      those keywords do nothing in 5.1 (they were meant for 6.0) so they are removed from the syntax.
     @ mysql-test/r/create.result
        test that syntax is not accepted
     @ mysql-test/t/create.test
        test that syntax is not accepted
     @ sql/handler.cc
        remove ROW_FORMAT=PAGE
     @ sql/handler.h
        Mark unused objects, but I don't remove them by fear of breaking any plugin which includes this file
        (see also table.h)
     @ sql/lex.h
        removing syntax
     @ sql/sql_show.cc
        removing output of noise keywords in SHOW CREATE TABLE and INFORMATION_SCHEMA.TABLES
     @ sql/sql_table.cc
        removing TRANSACTIONAL
     @ sql/sql_yacc.yy
        removing syntax
     @ sql/table.cc
        removing TRANSACTIONAL, PAGE_CHECKSUM. Their place in the frm file is not reclaimed,
        for compatibility with older 5.1.
     @ sql/table.h
        Mark unused objects, but I don't remove them by fear of breaking any plugin which includes this file
        (and there are several engines which use the content TABLE_SHARE and thus rely on a certain binary
        layout of this structure).

    modified:
      mysql-test/r/create.result
      mysql-test/t/create.test
      sql/handler.cc
      sql/handler.h
      sql/lex.h
      sql/sql_show.cc
      sql/sql_table.cc
      sql/sql_yacc.yy
      sql/table.cc
      sql/table.h
=== modified file 'mysql-test/r/create.result'
--- a/mysql-test/r/create.result	2009-03-17 14:29:16 +0000
+++ b/mysql-test/r/create.result	2009-07-07 12:38:00 +0000
@@ -1894,4 +1894,18 @@ DROP TABLE t1;
 create table `me:i`(id int);
 drop table `me:i`;
 
+# --
+# -- Bug#45829: CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing
+# --
+
+drop table if exists t1,t2,t3;
+create table t1 (a int) transactional=0;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'transactional=0' at line 1
+create table t2 (a int) page_checksum=1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'page_checksum=1' at line 1
+create table t3 (a int) row_format=page;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'page' at line 1
+
+# -- End of Bug#45829
+
 End of 5.1 tests

=== modified file 'mysql-test/t/create.test'
--- a/mysql-test/t/create.test	2009-01-23 12:22:05 +0000
+++ b/mysql-test/t/create.test	2009-07-07 12:38:00 +0000
@@ -1539,5 +1539,29 @@ DROP TABLE t1;
 create table `me:i`(id int);
 drop table `me:i`;
 
+###########################################################################
+
+#
+# Bug#45829 CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing
+#
+
+--echo
+--echo # --
+--echo # -- Bug#45829: CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing
+--echo # --
+--echo
+
+--disable_warnings
+drop table if exists t1,t2,t3;
+--enable_warnings
+--error ER_PARSE_ERROR
+create table t1 (a int) transactional=0;
+--error ER_PARSE_ERROR
+create table t2 (a int) page_checksum=1;
+--error ER_PARSE_ERROR
+create table t3 (a int) row_format=page;
+--echo
+--echo # -- End of Bug#45829
+
 --echo
 --echo End of 5.1 tests

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2009-06-25 15:25:23 +0000
+++ b/sql/handler.cc	2009-07-07 12:38:00 +0000
@@ -62,7 +62,9 @@ static const LEX_STRING sys_table_aliase
 };
 
 const char *ha_row_type[] = {
-  "", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "PAGE", "?","?","?"
+  "", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT",
+  /* 6.0 has "PAGE" here */ "?",
+  "?","?","?"
 };
 
 const char *tx_isolation_names[] =

=== modified file 'sql/handler.h'
--- a/sql/handler.h	2009-05-04 10:00:15 +0000
+++ b/sql/handler.h	2009-07-07 12:38:00 +0000
@@ -280,7 +280,9 @@ enum legacy_db_type
 
 enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
 		ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
-		ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE };
+		ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT,
+                /** Unused. Used in 6.0. */
+                ROW_TYPE_PAGE };
 
 enum enum_binlog_func {
   BFN_RESET_LOGS=        1,
@@ -323,7 +325,9 @@ enum enum_binlog_command {
 #define HA_CREATE_USED_PASSWORD         (1L << 17)
 #define HA_CREATE_USED_CONNECTION       (1L << 18)
 #define HA_CREATE_USED_KEY_BLOCK_SIZE   (1L << 19)
+/** Unused. Used in 6.0*/
 #define HA_CREATE_USED_TRANSACTIONAL    (1L << 20)
+/** Unused. Used in 6.0 */
 #define HA_CREATE_USED_PAGE_CHECKSUM    (1L << 21)
 
 typedef ulonglong my_xid; // this line is the same as in log_event.h
@@ -914,13 +918,14 @@ typedef struct st_ha_create_information
   uint options;				/* OR of HA_CREATE_ options */
   uint merge_insert_method;
   uint extra_size;                      /* length of extra data segment */
-  /* 0 not used, 1 if not transactional, 2 if transactional */
+  /** Transactional or not. Unused; used in 6.0. */
   enum ha_choice transactional;
   bool table_existed;			/* 1 in create if table existed */
   bool frm_only;                        /* 1 if no ha_create_table() */
   bool varchar;                         /* 1 if table has a VARCHAR */
   enum ha_storage_media storage_media;  /* DEFAULT, DISK or MEMORY */
-  enum ha_choice page_checksum;         /* If we have page_checksums */
+  /** Per-page checksums or not. Unused; used in 6.0. */
+  enum ha_choice page_checksum;
 } HA_CREATE_INFO;
 
 

=== modified file 'sql/lex.h'
--- a/sql/lex.h	2008-02-12 09:43:38 +0000
+++ b/sql/lex.h	2009-07-07 12:38:00 +0000
@@ -387,7 +387,6 @@ static SYMBOL symbols[] = {
   { "PACK_KEYS",	SYM(PACK_KEYS_SYM)},
   { "PARSER",           SYM(PARSER_SYM)},
   { "PAGE",	        SYM(PAGE_SYM)},
-  { "PAGE_CHECKSUM",        SYM(PAGE_CHECKSUM_SYM)},
   { "PARTIAL",		SYM(PARTIAL)},
   { "PARTITION",        SYM(PARTITION_SYM)},
   { "PARTITIONING",     SYM(PARTITIONING_SYM)},
@@ -543,7 +542,6 @@ static SYMBOL symbols[] = {
   { "TO",		SYM(TO_SYM)},
   { "TRAILING",		SYM(TRAILING)},
   { "TRANSACTION",	SYM(TRANSACTION_SYM)},
-  { "TRANSACTIONAL",	SYM(TRANSACTIONAL_SYM)},
   { "TRIGGER",          SYM(TRIGGER_SYM)},
   { "TRIGGERS",         SYM(TRIGGERS_SYM)},
   { "TRUE",		SYM(TRUE_SYM)},

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2009-06-25 10:52:50 +0000
+++ b/sql/sql_show.cc	2009-07-07 12:38:00 +0000
@@ -1428,11 +1428,6 @@ int store_create_info(THD *thd, TABLE_LI
     /* We use CHECKSUM, instead of TABLE_CHECKSUM, for backward compability */
     if (share->db_create_options & HA_OPTION_CHECKSUM)
       packet->append(STRING_WITH_LEN(" CHECKSUM=1"));
-    if (share->page_checksum != HA_CHOICE_UNDEF)
-    {
-      packet->append(STRING_WITH_LEN(" PAGE_CHECKSUM="));
-      packet->append(ha_choice_values[(uint) share->page_checksum], 1);
-    }
     if (share->db_create_options & HA_OPTION_DELAY_KEY_WRITE)
       packet->append(STRING_WITH_LEN(" DELAY_KEY_WRITE=1"));
     if (create_info.row_type != ROW_TYPE_DEFAULT)
@@ -1440,11 +1435,6 @@ int store_create_info(THD *thd, TABLE_LI
       packet->append(STRING_WITH_LEN(" ROW_FORMAT="));
       packet->append(ha_row_type[(uint) create_info.row_type]);
     }
-    if (share->transactional != HA_CHOICE_UNDEF)
-    {
-      packet->append(STRING_WITH_LEN(" TRANSACTIONAL="));
-      packet->append(ha_choice_values[(uint) share->transactional], 1);
-    }
     if (table->s->key_block_size)
     {
       char *end;
@@ -3593,21 +3583,12 @@ static int get_schema_tables_record(THD 
     /* We use CHECKSUM, instead of TABLE_CHECKSUM, for backward compability */
     if (share->db_create_options & HA_OPTION_CHECKSUM)
       ptr=strmov(ptr," checksum=1");
-    if (share->page_checksum != HA_CHOICE_UNDEF)
-      ptr= strxmov(ptr, " page_checksum=",
-                   ha_choice_values[(uint) share->page_checksum], NullS);
     if (share->db_create_options & HA_OPTION_DELAY_KEY_WRITE)
       ptr=strmov(ptr," delay_key_write=1");
     if (share->row_type != ROW_TYPE_DEFAULT)
       ptr=strxmov(ptr, " row_format=", 
                   ha_row_type[(uint) share->row_type],
                   NullS);
-    if (share->transactional != HA_CHOICE_UNDEF)
-    {
-      ptr= strxmov(ptr, " TRANSACTIONAL=",
-                   (share->transactional == HA_CHOICE_YES ? "1" : "0"),
-                   NullS);
-    }
     if (share->key_block_size)
     {
       ptr= strmov(ptr, " KEY_BLOCK_SIZE=");
@@ -3617,9 +3598,6 @@ static int get_schema_tables_record(THD 
     if (is_partitioned)
       ptr= strmov(ptr, " partitioned");
 #endif
-    if (share->transactional != HA_CHOICE_UNDEF)
-      ptr= strxmov(ptr, " transactional=",
-                   ha_choice_values[(uint) share->transactional], NullS);
     table->field[19]->store(option_buff+1,
                             (ptr == option_buff ? 0 : 
                              (uint) (ptr-option_buff)-1), cs);

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2009-07-06 06:55:53 +0000
+++ b/sql/sql_table.cc	2009-07-07 12:38:00 +0000
@@ -5885,8 +5885,6 @@ mysql_prepare_alter_table(THD *thd, TABL
   }
   if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE))
     create_info->key_block_size= table->s->key_block_size;
-  if (!(used_fields & HA_CREATE_USED_TRANSACTIONAL))
-    create_info->transactional= table->s->transactional;
 
   if (!create_info->tablespace && create_info->storage_media != HA_SM_MEMORY)
   {

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2009-06-17 14:56:44 +0000
+++ b/sql/sql_yacc.yy	2009-07-07 12:38:00 +0000
@@ -883,7 +883,6 @@ bool my_yyoverflow(short **a, YYSTYPE **
 %token  OWNER_SYM
 %token  PACK_KEYS_SYM
 %token  PAGE_SYM
-%token  PAGE_CHECKSUM_SYM
 %token  PARAM_MARKER
 %token  PARSER_SYM
 %token  PARTIAL                       /* SQL-2003-N */
@@ -1042,7 +1041,6 @@ bool my_yyoverflow(short **a, YYSTYPE **
 %token  TO_SYM                        /* SQL-2003-R */
 %token  TRAILING                      /* SQL-2003-R */
 %token  TRANSACTION_SYM
-%token  TRANSACTIONAL_SYM
 %token  TRIGGERS_SYM
 %token  TRIGGER_SYM                   /* SQL-2003-R */
 %token  TRIM                          /* SQL-2003-N */
@@ -4460,11 +4458,6 @@ create_table_option:
              Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM;
              Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM;
           }
-        | PAGE_CHECKSUM_SYM opt_equal choice
-          {
-            Lex->create_info.used_fields|= HA_CREATE_USED_PAGE_CHECKSUM;
-            Lex->create_info.page_checksum= $3;
-          }
         | DELAY_KEY_WRITE_SYM opt_equal ulong_num
           {
             Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE;
@@ -4524,11 +4517,6 @@ create_table_option:
             Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE;
             Lex->create_info.key_block_size= $3;
           }
-        | TRANSACTIONAL_SYM opt_equal choice
-          {
-	    Lex->create_info.used_fields|= HA_CREATE_USED_TRANSACTIONAL;
-            Lex->create_info.transactional= $3;
-          }
         ;
 
 default_charset:
@@ -4610,7 +4598,6 @@ row_types:
         | COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; }
         | REDUNDANT_SYM  { $$= ROW_TYPE_REDUNDANT; }
         | COMPACT_SYM    { $$= ROW_TYPE_COMPACT; }
-        | PAGE_SYM       { $$= ROW_TYPE_PAGE; }
         ;
 
 merge_insert_types:
@@ -11548,7 +11535,6 @@ keyword_sp:
         | ONE_SYM                  {}
         | PACK_KEYS_SYM            {}
         | PAGE_SYM                 {}
-        | PAGE_CHECKSUM_SYM	   {}
         | PARTIAL                  {}
         | PARTITIONING_SYM         {}
         | PARTITIONS_SYM           {}
@@ -11625,7 +11611,6 @@ keyword_sp:
         | TEXT_SYM                 {}
         | THAN_SYM                 {}
         | TRANSACTION_SYM          {}
-        | TRANSACTIONAL_SYM        {}
         | TRIGGERS_SYM             {}
         | TIMESTAMP                {}
         | TIMESTAMP_ADD            {}

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2009-06-17 14:56:44 +0000
+++ b/sql/table.cc	2009-07-07 12:38:00 +0000
@@ -724,8 +724,6 @@ static int open_binary_frm(THD *thd, TAB
   if (!head[32])				// New frm file in 3.23
   {
     share->avg_row_length= uint4korr(head+34);
-    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->null_field_first= 1;
@@ -2492,8 +2490,11 @@ File create_frm(THD *thd, const char *na
     int4store(fileinfo+34,create_info->avg_row_length);
     fileinfo[38]= (create_info->default_table_charset ?
 		   create_info->default_table_charset->number : 0);
-    fileinfo[39]= (uchar) ((uint) create_info->transactional |
-                           ((uint) create_info->page_checksum << 2));
+    /*
+      In 6.0, we store in fileinfo[39] the values of the TRANSACTIONAL and
+      PAGE_CHECKSUM clauses of CREATE TABLE.
+    */
+    fileinfo[39]= 0;
     fileinfo[40]= (uchar) create_info->row_type;
     /* Next few bytes where for RAID support */
     fileinfo[41]= 0;

=== modified file 'sql/table.h'
--- a/sql/table.h	2009-06-17 14:56:44 +0000
+++ b/sql/table.h	2009-07-07 12:38:00 +0000
@@ -361,7 +361,9 @@ typedef struct st_table_share
   }
   enum row_type row_type;		/* How rows are stored */
   enum tmp_table_type tmp_table;
+  /** Transactional or not. Unused; used in 6.0. */
   enum ha_choice transactional;
+  /** Per-page checksums or not. Unused; used in 6.0. */
   enum ha_choice page_checksum;
 
   uint ref_count;                       /* How many TABLE objects uses this */


Attachment: [text/bzr-bundle] bzr/guilhem@mysql.com-20090707123800-ihc3fxutpidz4vij.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (guilhem:3007) Bug#45829Guilhem Bichot7 Jul
  • Re: bzr commit into mysql-5.1-bugteam branch (guilhem:3007) Bug#45829Davi Arnaut9 Jul