summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2009-07-29 10:54:20 +0200
committerGuilhem Bichot <guilhem@mysql.com>2009-07-29 10:54:20 +0200
commita58b887c17c696c6e67adf0714254c57371d9cc2 (patch)
tree11695ad26b01f87834d8b8b7c8dece060209048c /sql
parentd871bef758aab5993daea0a7727a358a1f0b576e (diff)
downloadmariadb-git-a58b887c17c696c6e67adf0714254c57371d9cc2.tar.gz
Bug#45829 "CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing":
those keywords do nothing in 5.1 (they are meant for future versions, for example featuring the Maria engine) so they are here removed from the syntax. Adding those keywords to future versions when needed is: - WL#5034 "Add TRANSACTIONA=0|1 and PAGE_CHECKSUM=0|1 clauses to CREATE TABLE" - WL#5037 "New ROW_FORMAT value for CREATE TABLE: PAGE" 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).
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc4
-rw-r--r--sql/handler.h11
-rw-r--r--sql/lex.h2
-rw-r--r--sql/sql_show.cc22
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_yacc.yy15
-rw-r--r--sql/table.cc9
-rw-r--r--sql/table.h2
8 files changed, 18 insertions, 49 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index cfc3de1d889..e5c64452aaf 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -62,7 +62,9 @@ static const LEX_STRING sys_table_aliases[]=
};
const char *ha_row_type[] = {
- "", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "PAGE", "?","?","?"
+ "", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT",
+ /* Reserved to be "PAGE" in future versions */ "?",
+ "?","?","?"
};
const char *tx_isolation_names[] =
diff --git a/sql/handler.h b/sql/handler.h
index 5c7cfa4d58b..01f673ecd51 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -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. Reserved for future versions. */
+ 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. Reserved for future versions. */
#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
+/** Unused. Reserved for future versions. */
#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; reserved for future versions. */
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; reserved for future versions. */
+ enum ha_choice page_checksum;
} HA_CREATE_INFO;
diff --git a/sql/lex.h b/sql/lex.h
index acb81dcf717..0a85824f6f7 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -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)},
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 35dbb64dfef..83a21f45f86 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1428,11 +1428,6 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
/* 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_LIST *table_list, String *packet,
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;
@@ -3591,21 +3581,12 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
/* 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=");
@@ -3615,9 +3596,6 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
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);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index ad9671c444b..0066c66eb59 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5928,8 +5928,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
}
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)
{
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index ffb9b6d001a..91eb0d15dee 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -889,7 +889,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%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 */
@@ -1048,7 +1047,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%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 */
@@ -4466,11 +4464,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;
@@ -4530,11 +4523,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:
@@ -4616,7 +4604,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:
@@ -11559,7 +11546,6 @@ keyword_sp:
| ONE_SYM {}
| PACK_KEYS_SYM {}
| PAGE_SYM {}
- | PAGE_CHECKSUM_SYM {}
| PARTIAL {}
| PARTITIONING_SYM {}
| PARTITIONS_SYM {}
@@ -11636,7 +11622,6 @@ keyword_sp:
| TEXT_SYM {}
| THAN_SYM {}
| TRANSACTION_SYM {}
- | TRANSACTIONAL_SYM {}
| TRIGGERS_SYM {}
| TIMESTAMP {}
| TIMESTAMP_ADD {}
diff --git a/sql/table.cc b/sql/table.cc
index 60a27e136b1..c1d79bdcdd3 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -724,8 +724,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
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 *name, const char *db,
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 future versions, we will 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;
diff --git a/sql/table.h b/sql/table.h
index cb53013cd59..98ede52cd99 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -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; reserved for future versions. */
enum ha_choice transactional;
+ /** Per-page checksums or not. Unused; reserved for future versions. */
enum ha_choice page_checksum;
uint ref_count; /* How many TABLE objects uses this */