mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
don't introduce a deprecated syntax
This commit is contained in:
@ -1421,15 +1421,6 @@ create table t3 (c1 int) engine=myisam pack_keys=default;
|
|||||||
create table t4 (c1 int) engine=myisam pack_keys=2;
|
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
|
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;
|
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);
|
create table t1 (a int not null, key `a` (a) key_block_size=1024);
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
@ -1574,4 +1565,5 @@ t1 CREATE TABLE `t1` (
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (a int not null, key key_block_size=1024 (a));
|
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
|
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
|
||||||
|
@ -811,13 +811,6 @@ drop table t1, t2, t3;
|
|||||||
# Test of key_block_size
|
# 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);
|
create table t1 (a int not null, key `a` (a) key_block_size=1024);
|
||||||
show create table t1;
|
show create table t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
@ -874,5 +867,6 @@ drop table t1;
|
|||||||
|
|
||||||
--error 1064
|
--error 1064
|
||||||
create table t1 (a int not null, key key_block_size=1024 (a));
|
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;
|
|
||||||
|
@ -1100,12 +1100,6 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
|
|||||||
if (!found_primary)
|
if (!found_primary)
|
||||||
append_identifier(thd, packet, key_info->name, strlen(key_info->name));
|
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(" ("));
|
packet->append(STRING_WITH_LEN(" ("));
|
||||||
|
|
||||||
for (uint j=0 ; j < key_info->key_parts ; j++,key_part++)
|
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(')');
|
packet->append(')');
|
||||||
#if MYSQL_VERSION_ID < 50300
|
store_key_options(thd, packet, table, key_info);
|
||||||
if (thd->variables.new_mode)
|
|
||||||
#endif
|
|
||||||
store_key_options(thd, packet, table, key_info);
|
|
||||||
if (key_info->parser)
|
if (key_info->parser)
|
||||||
{
|
{
|
||||||
packet->append(" WITH PARSER ", 13);
|
packet->append(" WITH PARSER ", 13);
|
||||||
|
@ -796,7 +796,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
|
|||||||
key_type opt_unique_or_fulltext constraint_key_type
|
key_type opt_unique_or_fulltext constraint_key_type
|
||||||
|
|
||||||
%type <key_alg>
|
%type <key_alg>
|
||||||
opt_btree_or_rtree
|
btree_or_rtree
|
||||||
|
|
||||||
%type <string_list>
|
%type <string_list>
|
||||||
key_usage_list using_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_suid view_tail view_list_opt view_list view_select
|
||||||
view_check_option trigger_tail sp_tail
|
view_check_option trigger_tail sp_tail
|
||||||
install uninstall partition_entry binlog_base64_event
|
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
|
END_OF_INPUT
|
||||||
|
|
||||||
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
|
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
|
||||||
@ -4528,7 +4528,7 @@ init_key_options:
|
|||||||
|
|
||||||
key_alg:
|
key_alg:
|
||||||
/* empty */ init_key_options
|
/* empty */ init_key_options
|
||||||
| init_key_options key_opts
|
| init_key_options key_using_alg
|
||||||
;
|
;
|
||||||
|
|
||||||
key_options:
|
key_options:
|
||||||
@ -4540,10 +4540,14 @@ key_opts:
|
|||||||
key_opt
|
key_opt
|
||||||
| 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:
|
key_opt:
|
||||||
USING opt_btree_or_rtree { Lex->key_create_info.algorithm= $2; }
|
key_using_alg
|
||||||
| TYPE_SYM opt_btree_or_rtree { Lex->key_create_info.algorithm= $2; }
|
|
||||||
| KEY_BLOCK_SIZE opt_equal ulong_num
|
| KEY_BLOCK_SIZE opt_equal ulong_num
|
||||||
{ Lex->key_create_info.block_size= $3; }
|
{ Lex->key_create_info.block_size= $3; }
|
||||||
| WITH PARSER_SYM IDENT_sys
|
| WITH PARSER_SYM IDENT_sys
|
||||||
@ -4559,7 +4563,7 @@ key_opt:
|
|||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
opt_btree_or_rtree:
|
btree_or_rtree:
|
||||||
BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
|
BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
|
||||||
| RTREE_SYM
|
| RTREE_SYM
|
||||||
{
|
{
|
||||||
@ -4573,7 +4577,7 @@ key_list:
|
|||||||
|
|
||||||
key_part:
|
key_part:
|
||||||
ident { $$=new key_part_spec($1.str); }
|
ident { $$=new key_part_spec($1.str); }
|
||||||
| ident '(' NUM ')'
|
| ident '(' NUM ')'
|
||||||
{
|
{
|
||||||
int key_part_len= atoi($3.str);
|
int key_part_len= atoi($3.str);
|
||||||
if (!key_part_len)
|
if (!key_part_len)
|
||||||
|
Reference in New Issue
Block a user