Commit 466d8170 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-26768 Spider table crashes the server after the mysql_list_fields()...

MDEV-26768 Spider table crashes the server after the mysql_list_fields() client's call and produces weird result for SHOW FIELDS.

Suppress errors in ha_spider::info() called from mysqld_show_fields()
parent 7922fbf7
......@@ -1125,7 +1125,8 @@ THR_LOCK_DATA **ha_spider::store_lock(
if (
sql_command == SQLCOM_DROP_TABLE ||
sql_command == SQLCOM_ALTER_TABLE ||
sql_command == SQLCOM_SHOW_CREATE
sql_command == SQLCOM_SHOW_CREATE ||
sql_command == SQLCOM_SHOW_FIELDS
) {
if (
lock_type == TL_READ_NO_INSERT &&
......@@ -8707,7 +8708,8 @@ int ha_spider::info(
spider_param_table_init_error_interval())
{
pthread_mutex_unlock(&share->sts_mutex);
if (sql_command == SQLCOM_SHOW_CREATE)
if (sql_command == SQLCOM_SHOW_CREATE ||
sql_command == SQLCOM_SHOW_FIELDS)
{
if (thd->is_error())
{
......@@ -8781,7 +8783,8 @@ int ha_spider::info(
share->init_error = TRUE;
share->init = TRUE;
}
if (sql_command == SQLCOM_SHOW_CREATE)
if (sql_command == SQLCOM_SHOW_CREATE ||
sql_command == SQLCOM_SHOW_FIELDS)
{
if (thd->is_error())
{
......@@ -8844,7 +8847,8 @@ int ha_spider::info(
share->init_error = TRUE;
share->init = TRUE;
}
if (sql_command == SQLCOM_SHOW_CREATE)
if (sql_command == SQLCOM_SHOW_CREATE ||
sql_command == SQLCOM_SHOW_FIELDS)
{
if (thd->is_error())
{
......@@ -8873,7 +8877,8 @@ int ha_spider::info(
if ((error_num = spider_create_sts_thread(share)))
{
pthread_mutex_unlock(&share->sts_mutex);
if (sql_command == SQLCOM_SHOW_CREATE)
if (sql_command == SQLCOM_SHOW_CREATE ||
sql_command == SQLCOM_SHOW_FIELDS)
{
if (thd->is_error())
{
......@@ -8904,7 +8909,8 @@ int ha_spider::info(
{
if ((error_num = check_crd()))
{
if (sql_command == SQLCOM_SHOW_CREATE)
if (sql_command == SQLCOM_SHOW_CREATE ||
sql_command == SQLCOM_SHOW_FIELDS)
{
if (thd->is_error())
{
......
......@@ -248,6 +248,15 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
8 g 2011-05-05 21:33:30
9 h 2011-05-05 22:32:10
DROP TABLE ta_l2;
connection master_1;
CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
SHOW FIELDS FROM t;
Field Type Null Key Default Extra
c int(11) YES NULL
SHOW FIELDS FROM t;
Field Type Null Key Default Extra
c int(11) YES NULL
DROP TABLE t;
deinit
connection master_1;
......
......@@ -982,6 +982,13 @@ if ($HAVE_PARTITION)
}
}
--connection master_1
CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
SHOW FIELDS FROM t;
SHOW FIELDS FROM t;
DROP TABLE t;
--echo
--echo deinit
--disable_warnings
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment