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( ...@@ -1125,7 +1125,8 @@ THR_LOCK_DATA **ha_spider::store_lock(
if ( if (
sql_command == SQLCOM_DROP_TABLE || sql_command == SQLCOM_DROP_TABLE ||
sql_command == SQLCOM_ALTER_TABLE || sql_command == SQLCOM_ALTER_TABLE ||
sql_command == SQLCOM_SHOW_CREATE sql_command == SQLCOM_SHOW_CREATE ||
sql_command == SQLCOM_SHOW_FIELDS
) { ) {
if ( if (
lock_type == TL_READ_NO_INSERT && lock_type == TL_READ_NO_INSERT &&
...@@ -8707,7 +8708,8 @@ int ha_spider::info( ...@@ -8707,7 +8708,8 @@ int ha_spider::info(
spider_param_table_init_error_interval()) spider_param_table_init_error_interval())
{ {
pthread_mutex_unlock(&share->sts_mutex); 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()) if (thd->is_error())
{ {
...@@ -8781,7 +8783,8 @@ int ha_spider::info( ...@@ -8781,7 +8783,8 @@ int ha_spider::info(
share->init_error = TRUE; share->init_error = TRUE;
share->init = 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()) if (thd->is_error())
{ {
...@@ -8844,7 +8847,8 @@ int ha_spider::info( ...@@ -8844,7 +8847,8 @@ int ha_spider::info(
share->init_error = TRUE; share->init_error = TRUE;
share->init = 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()) if (thd->is_error())
{ {
...@@ -8873,7 +8877,8 @@ int ha_spider::info( ...@@ -8873,7 +8877,8 @@ int ha_spider::info(
if ((error_num = spider_create_sts_thread(share))) if ((error_num = spider_create_sts_thread(share)))
{ {
pthread_mutex_unlock(&share->sts_mutex); 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()) if (thd->is_error())
{ {
...@@ -8904,7 +8909,8 @@ int ha_spider::info( ...@@ -8904,7 +8909,8 @@ int ha_spider::info(
{ {
if ((error_num = check_crd())) 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()) if (thd->is_error())
{ {
......
...@@ -248,6 +248,15 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') ...@@ -248,6 +248,15 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
8 g 2011-05-05 21:33:30 8 g 2011-05-05 21:33:30
9 h 2011-05-05 22:32:10 9 h 2011-05-05 22:32:10
DROP TABLE ta_l2; 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 deinit
connection master_1; connection master_1;
......
...@@ -982,6 +982,13 @@ if ($HAVE_PARTITION) ...@@ -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
--echo deinit --echo deinit
--disable_warnings --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