diff options
author | KiyoshiTakeda <d8sk4ueum@gmail.com> | 2022-04-11 14:02:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 23:02:38 +0900 |
commit | 4d1955d3485971f20c14757d0b83d3ad13543f6a (patch) | |
tree | 4b70450ea3fb69c92e6247647f6ef0e376281b6f | |
parent | 27b5d814e2c851569a0d75e4217da4a552b79f25 (diff) | |
download | mariadb-git-4d1955d3485971f20c14757d0b83d3ad13543f6a.tar.gz |
MDEV-28225 Disallow user to create Spider temporary table
Creating a temporary table with Spider is non-sense because a Spider
table cannot hold any physical data and it requires an additional
effort to manage even if it is configured correctly.
Set HTON_TEMPORARY_NOT_SUPPORTED to spider_hton->flags.
Reviewed-by: nayuta.yanagisawa@hey.com
Co-authored-by: d8sk4ueun@gmail.com
-rw-r--r-- | storage/spider/mysql-test/spider/r/spider3_fixes.result | 8 | ||||
-rw-r--r-- | storage/spider/mysql-test/spider/t/spider3_fixes.test | 10 | ||||
-rw-r--r-- | storage/spider/spd_table.cc | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/storage/spider/mysql-test/spider/r/spider3_fixes.result b/storage/spider/mysql-test/spider/r/spider3_fixes.result index d6aec25bfc1..7a80e102462 100644 --- a/storage/spider/mysql-test/spider/r/spider3_fixes.result +++ b/storage/spider/mysql-test/spider/r/spider3_fixes.result @@ -200,6 +200,14 @@ id 5000 10000 connection master_1; +# +# MDEV-28225 Disallow user to create Spider temporary table +# +connection master_1; +CREATE TEMPORARY TABLE t1 ( +a INT +) ENGINE=Spider; +ERROR HY000: Table storage engine 'SPIDER' does not support the create option 'TEMPORARY' deinit connection master_1; diff --git a/storage/spider/mysql-test/spider/t/spider3_fixes.test b/storage/spider/mysql-test/spider/t/spider3_fixes.test index 13fa6f5fa39..73126d6d348 100644 --- a/storage/spider/mysql-test/spider/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/t/spider3_fixes.test @@ -264,6 +264,16 @@ if ($USE_CHILD_GROUP2) } +--echo # +--echo # MDEV-28225 Disallow user to create Spider temporary table +--echo # +--connection master_1 +--error ER_ILLEGAL_HA_CREATE_OPTION +CREATE TEMPORARY TABLE t1 ( + a INT +) ENGINE=Spider; + + --echo --echo deinit --disable_warnings diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 39f51fa1b59..d32d850e2c8 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -6322,7 +6322,7 @@ int spider_db_init( spider_hton_ptr = spider_hton; spider_hton->state = SHOW_OPTION_YES; - spider_hton->flags = HTON_NO_FLAGS; + spider_hton->flags = HTON_TEMPORARY_NOT_SUPPORTED; /* spider_hton->db_type = DB_TYPE_SPIDER; */ /* spider_hton->savepoint_offset; |