mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-34636 Spider: reset wide_handler->trx in two occasions
ha_spider::update_create_info() ha_spider::append_lock_tables_list()
This commit is contained in:
parent
f43ea935a1
commit
42735c557e
3 changed files with 53 additions and 7 deletions
|
@ -5746,13 +5746,6 @@ int ha_spider::info(
|
|||
DBUG_PRINT("info",("spider flag=%x", flag));
|
||||
auto_inc_temporary = FALSE;
|
||||
wide_handler->sql_command = thd_sql_command(thd);
|
||||
/*
|
||||
if (
|
||||
sql_command == SQLCOM_DROP_TABLE ||
|
||||
sql_command == SQLCOM_ALTER_TABLE ||
|
||||
sql_command == SQLCOM_SHOW_CREATE
|
||||
) {
|
||||
*/
|
||||
if (flag & HA_STATUS_AUTO)
|
||||
{
|
||||
if (share->lgtm_tblhnd_share->auto_increment_value)
|
||||
|
@ -8131,6 +8124,8 @@ void ha_spider::update_create_info(
|
|||
DBUG_PRINT("info",("spider this=%p", this));
|
||||
if (wide_handler && wide_handler->sql_command == SQLCOM_ALTER_TABLE)
|
||||
{
|
||||
if (!(wide_handler->trx = spider_get_trx(ha_thd(), TRUE, &store_error_num)))
|
||||
DBUG_VOID_RETURN;
|
||||
SPIDER_TRX *trx = wide_handler->trx;
|
||||
THD *thd = trx->thd;
|
||||
if (trx->query_id != thd->query_id)
|
||||
|
@ -11621,6 +11616,8 @@ int ha_spider::append_lock_tables_list()
|
|||
DBUG_PRINT("info",("spider lock_table_type=%u",
|
||||
wide_handler->lock_table_type));
|
||||
|
||||
if (!(wide_handler->trx = spider_get_trx(ha_thd(), TRUE, &error_num)))
|
||||
DBUG_RETURN(error_num);
|
||||
if ((error_num = spider_check_trx_and_get_conn(wide_handler->trx->thd, this,
|
||||
FALSE)))
|
||||
{
|
||||
|
|
20
storage/spider/mysql-test/spider/bugfix/r/mdev_34636.result
Normal file
20
storage/spider/mysql-test/spider/bugfix/r/mdev_34636.result
Normal file
|
@ -0,0 +1,20 @@
|
|||
for master_1
|
||||
for child2
|
||||
for child3
|
||||
set spider_same_server_link= 1;
|
||||
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
CREATE TABLE t1 (c1 TIME) ENGINE=Spider PARTITION BY HASH(EXTRACT(HOUR_SECOND FROM c1));
|
||||
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
|
||||
CREATE TABLE t3 (c1 INT,c2 INT) ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "t1"';
|
||||
INSERT INTO t2 SELECT * FROM t3;
|
||||
ERROR 21S01: Column count doesn't match value count at row 1
|
||||
SELECT * FROM t3;
|
||||
ERROR HY000: Unable to connect to foreign data source: localhost
|
||||
ALTER TABLE t1 CHANGE COLUMN c1 d1 INT;
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
DROP TABLE t1,t2,t3;
|
||||
drop server srv;
|
||||
for master_1
|
||||
for child2
|
||||
for child3
|
29
storage/spider/mysql-test/spider/bugfix/t/mdev_34636.test
Normal file
29
storage/spider/mysql-test/spider/bugfix/t/mdev_34636.test
Normal file
|
@ -0,0 +1,29 @@
|
|||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
set spider_same_server_link= 1;
|
||||
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
||||
|
||||
CREATE TABLE t1 (c1 TIME) ENGINE=Spider PARTITION BY HASH(EXTRACT(HOUR_SECOND FROM c1));
|
||||
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
|
||||
CREATE TABLE t3 (c1 INT,c2 INT) ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "t1"';
|
||||
--error ER_WRONG_VALUE_COUNT_ON_ROW
|
||||
INSERT INTO t2 SELECT * FROM t3;
|
||||
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
|
||||
SELECT * FROM t3;
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE t1 CHANGE COLUMN c1 d1 INT;
|
||||
# Cleanup
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
drop server srv;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
Loading…
Reference in a new issue