diff options
-rw-r--r-- | mysql-test/r/myisam.result | 12 | ||||
-rw-r--r-- | mysql-test/t/myisam.test | 10 | ||||
-rw-r--r-- | sql/sql_show.cc | 11 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 20 |
4 files changed, 17 insertions, 36 deletions
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 8976c98136b..3226351f966 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1421,15 +1421,6 @@ create table t3 (c1 int) engine=myisam pack_keys=default; create table t4 (c1 int) engine=myisam pack_keys=2; 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 '2' at line 1 drop table t1, t2, t3; -create table t1 (a int not null, key `a` key_block_size=1024 (a)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL, - KEY `a` KEY_BLOCK_SIZE=1024 (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1; -set @@new=1; create table t1 (a int not null, key `a` (a) key_block_size=1024); show create table t1; Table Create Table @@ -1574,4 +1565,5 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a int not null, key key_block_size=1024 (a)); 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 '=1024 (a))' at line 1 -set @@new=0; +create table t1 (a int not null, key `a` key_block_size=1024 (a)); +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 'key_block_size=1024 (a))' at line 1 diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 87a00399c23..a77537f3ff5 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -811,13 +811,6 @@ drop table t1, t2, t3; # Test of key_block_size # -# Old format, to be obsolete in 5.3 -create table t1 (a int not null, key `a` key_block_size=1024 (a)); -show create table t1; -drop table t1; - -set @@new=1; - create table t1 (a int not null, key `a` (a) key_block_size=1024); show create table t1; drop table t1; @@ -874,5 +867,6 @@ drop table t1; --error 1064 create table t1 (a int not null, key key_block_size=1024 (a)); +--error 1064 +create table t1 (a int not null, key `a` key_block_size=1024 (a)); -set @@new=0; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4071f86989f..d15b3cd01bc 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1100,12 +1100,6 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, if (!found_primary) append_identifier(thd, packet, key_info->name, strlen(key_info->name)); -#if MYSQL_VERSION_ID < 50300 - /* Key options moved to after key parts in 5.3.0 */ - if (!thd->variables.new_mode) - store_key_options(thd, packet, table, key_info); -#endif - packet->append(STRING_WITH_LEN(" (")); for (uint j=0 ; j < key_info->key_parts ; j++,key_part++) @@ -1130,10 +1124,7 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, } } packet->append(')'); -#if MYSQL_VERSION_ID < 50300 - if (thd->variables.new_mode) -#endif - store_key_options(thd, packet, table, key_info); + store_key_options(thd, packet, table, key_info); if (key_info->parser) { packet->append(" WITH PARSER ", 13); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 32b5bc8adb9..31ef2d8907e 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -796,7 +796,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); key_type opt_unique_or_fulltext constraint_key_type %type <key_alg> - opt_btree_or_rtree + btree_or_rtree %type <string_list> key_usage_list using_list @@ -887,7 +887,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); view_suid view_tail view_list_opt view_list view_select view_check_option trigger_tail sp_tail install uninstall partition_entry binlog_base64_event - init_key_options key_options key_opts key_opt + init_key_options key_options key_opts key_opt key_using_alg END_OF_INPUT %type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt @@ -4528,7 +4528,7 @@ init_key_options: key_alg: /* empty */ init_key_options - | init_key_options key_opts + | init_key_options key_using_alg ; key_options: @@ -4540,10 +4540,14 @@ key_opts: key_opt | key_opts key_opt ; - + +key_using_alg: + USING btree_or_rtree { Lex->key_create_info.algorithm= $2; } + | TYPE_SYM btree_or_rtree { Lex->key_create_info.algorithm= $2; } + ; + key_opt: - USING opt_btree_or_rtree { Lex->key_create_info.algorithm= $2; } - | TYPE_SYM opt_btree_or_rtree { Lex->key_create_info.algorithm= $2; } + key_using_alg | KEY_BLOCK_SIZE opt_equal ulong_num { Lex->key_create_info.block_size= $3; } | WITH PARSER_SYM IDENT_sys @@ -4559,7 +4563,7 @@ key_opt: ; -opt_btree_or_rtree: +btree_or_rtree: BTREE_SYM { $$= HA_KEY_ALG_BTREE; } | RTREE_SYM { @@ -4573,7 +4577,7 @@ key_list: key_part: ident { $$=new key_part_spec($1.str); } - | ident '(' NUM ')' + | ident '(' NUM ')' { int key_part_len= atoi($3.str); if (!key_part_len) |