Commit 335cf16a authored by unknown's avatar unknown
Browse files

don't introduce a deprecated syntax

parent 1211c28a
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -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
+2 −8
Original line number Diff line number Diff line
@@ -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;
+1 −10
Original line number Diff line number Diff line
@@ -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,9 +1124,6 @@ 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);
    if (key_info->parser)
    {
+12 −8
Original line number Diff line number Diff line
@@ -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:
@@ -4541,9 +4541,13 @@ key_opts:
	| 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
	  {