diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index 997f57ab6c8..31498328535 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -9396,18 +9396,6 @@ int ha_spider::update_auto_increment() DBUG_ENTER("ha_spider::update_auto_increment"); DBUG_PRINT("info",("spider this=%p", this)); force_auto_increment = TRUE; -/* - if ( - next_insert_id >= auto_inc_interval_for_cur_row.maximum() && - wide_handler->trx->thd->auto_inc_intervals_forced.get_current() - ) { - force_auto_increment = TRUE; - DBUG_PRINT("info",("spider force_auto_increment=TRUE")); - } else { - force_auto_increment = FALSE; - DBUG_PRINT("info",("spider force_auto_increment=FALSE")); - } -*/ DBUG_PRINT("info",("spider auto_increment_mode=%d", auto_increment_mode)); DBUG_PRINT("info",("spider next_number_field=%lld", @@ -9662,7 +9650,12 @@ int ha_spider::write_row( pthread_mutex_lock(&share->lgtm_tblhnd_share->auto_increment_mutex); if (!share->lgtm_tblhnd_share->auto_increment_init) { - info(HA_STATUS_AUTO); + if ((error_num= info(HA_STATUS_AUTO))) + { + pthread_mutex_unlock( + &share->lgtm_tblhnd_share->auto_increment_mutex); + DBUG_RETURN(error_num); + } share->lgtm_tblhnd_share->auto_increment_lclval = stats.auto_increment_value; share->lgtm_tblhnd_share->auto_increment_init = TRUE; diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_28105.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_28105.result new file mode 100644 index 00000000000..1932f6b2624 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_28105.result @@ -0,0 +1,10 @@ +install soname 'ha_spider'; +Warnings: +Warning 1105 Cannot enable tc-log at run-time. XA features of SPIDER are disabled +SET @@insert_id=128; +CREATE TABLE t(c TINYINT AUTO_INCREMENT KEY) ENGINE=Spider; +INSERT IGNORE INTO t VALUES(0); +ERROR HY000: Unable to connect to foreign data source: localhost +drop table t; +Warnings: +Warning 1620 Plugin is busy and will be uninstalled on shutdown diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28105.opt b/storage/spider/mysql-test/spider/bugfix/t/mdev_28105.opt new file mode 100644 index 00000000000..789275fa25e --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28105.opt @@ -0,0 +1 @@ +--skip-log-bin diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_28105.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_28105.test new file mode 100644 index 00000000000..219835075ba --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_28105.test @@ -0,0 +1,8 @@ +install soname 'ha_spider'; +SET @@insert_id=128; # 127 does not crash +CREATE TABLE t(c TINYINT AUTO_INCREMENT KEY) ENGINE=Spider; +--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE +INSERT IGNORE INTO t VALUES(0); +drop table t; +--disable_query_log +--source ../../include/clean_up_spider.inc