Skip to content

Commit b2c54a9

Browse files
author
Sergei Golubchik
committed
MDEV-6523 CONNECT temporary table created
check_engine() was not called for assisted discovery
1 parent 4ff2a68 commit b2c54a9

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

sql/sql_table.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4372,9 +4372,6 @@ handler *mysql_create_frm_image(THD *thd,
43724372
DBUG_RETURN(NULL);
43734373
}
43744374

4375-
if (check_engine(thd, db, table_name, create_info))
4376-
DBUG_RETURN(NULL);
4377-
43784375
set_table_default_charset(thd, create_info, (char*) db);
43794376

43804377
db_options= create_info->table_options;
@@ -4780,6 +4777,9 @@ int create_table_impl(THD *thd,
47804777

47814778
THD_STAGE_INFO(thd, stage_creating_table);
47824779

4780+
if (check_engine(thd, orig_db, orig_table_name, create_info))
4781+
goto err;
4782+
47834783
if (create_table_mode == C_ASSISTED_DISCOVERY)
47844784
{
47854785
/* check that it's used correctly */
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CREATE TEMPORARY TABLE t1 (a int not null)
2+
ENGINE=CONNECT table_type=MYSQL CONNECTION='mysql://root@127.0.0.1/test/t2';
3+
ERROR HY000: Table storage engine 'CONNECT' does not support the create option 'TEMPORARY'
4+
CREATE TEMPORARY TABLE t1
5+
ENGINE=CONNECT table_type=MYSQL CONNECTION='mysql://root@127.0.0.1/test/t2';
6+
ERROR HY000: Table storage engine 'CONNECT' does not support the create option 'TEMPORARY'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# CONNECT tables cannot be TEMPORARY
3+
#
4+
5+
--error ER_ILLEGAL_HA_CREATE_OPTION
6+
CREATE TEMPORARY TABLE t1 (a int not null)
7+
ENGINE=CONNECT table_type=MYSQL CONNECTION='mysql://root@127.0.0.1/test/t2';
8+
9+
# also with assisted discovery
10+
--error ER_ILLEGAL_HA_CREATE_OPTION
11+
CREATE TEMPORARY TABLE t1
12+
ENGINE=CONNECT table_type=MYSQL CONNECTION='mysql://root@127.0.0.1/test/t2';
13+

0 commit comments

Comments
 (0)