Skip to content

Commit

Permalink
MDEV-32804 Remove references to spider_rewrite_plugin tables
Browse files Browse the repository at this point in the history
They are not used. The code paths are never reached.
  • Loading branch information
mariadb-YuchenPei committed Nov 24, 2023
1 parent ed0ab6e commit 1a76d75
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 124 deletions.
21 changes: 0 additions & 21 deletions storage/spider/mysql-test/spider/include/init_spider.inc
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,6 @@ let $PLUGIN_VERSION=
`SELECT SUBSTRING_INDEX(plugin_version, '.', 1)
FROM information_schema.plugins
WHERE plugin_name = 'SPIDER'`;
if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
{
let $HAS_REWRITE=
`SELECT IF (STRCMP('$SERVER_NAME', 'MariaDB') = 0,
IF ($SERVER_MAJOR_VERSION = 10,
IF ($SERVER_MINOR_VERSION < 4, 0, 1),
IF ($SERVER_MAJOR_VERSION < 10, 0, 1)),
0)`;
let $HAS_REWRITE= 0;
if ($HAS_REWRITE)
{
let $PLUGIN_NAME= spider_flush_rewrite_cache;
let $PLUGIN_EXIST=
`SELECT COUNT(*) FROM mysql.func WHERE name = '$PLUGIN_NAME'`;
while (!$PLUGIN_EXIST)
{
let $PLUGIN_EXIST=
`SELECT COUNT(*) FROM mysql.func WHERE name = '$PLUGIN_NAME'`;
}
}
}
let $PLUGIN_NAME= spider_flush_table_mon_cache;
let $PLUGIN_EXIST=
`SELECT COUNT(*) FROM mysql.func WHERE name = '$PLUGIN_NAME'`;
Expand Down
88 changes: 0 additions & 88 deletions storage/spider/spd_sys_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,24 +339,6 @@ TABLE *spider_open_sys_table(
}
DBUG_ASSERT(0);
break;
case 21:
if (!memcmp(table_name, SPIDER_SYS_RW_TBLS_TABLE_NAME_STR,
SPIDER_SYS_RW_TBLS_TABLE_NAME_LEN))
{
DBUG_PRINT("info",("spider checking for SYS_RW_TBLS"));
if (table->s->fields != SPIDER_SYS_RW_TBLS_COL_CNT)
{
spider_close_sys_table(thd, table, open_tables_backup, need_lock);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
SPIDER_SYS_RW_TBLS_TABLE_NAME_STR);
*error_num = ER_SPIDER_SYS_TABLE_VERSION_NUM;
goto error_col_num_chk;
}
}
DBUG_ASSERT(0);
break;
case 22:
if (!memcmp(table_name, SPIDER_SYS_LINK_FAILED_TABLE_NAME_STR,
SPIDER_SYS_LINK_FAILED_TABLE_NAME_LEN))
Expand Down Expand Up @@ -393,60 +375,6 @@ TABLE *spider_open_sys_table(
}
break;
}
if (!memcmp(table_name, SPIDER_SYS_RWN_TBLS_TABLE_NAME_STR,
SPIDER_SYS_RWN_TBLS_TABLE_NAME_LEN))
{
DBUG_PRINT("info",("spider checking for SYS_RWN_TBLS"));
if (table->s->fields != SPIDER_SYS_RWN_TBLS_COL_CNT)
{
spider_close_sys_table(thd, table, open_tables_backup, need_lock);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
SPIDER_SYS_RWN_TBLS_TABLE_NAME_STR);
*error_num = ER_SPIDER_SYS_TABLE_VERSION_NUM;
goto error_col_num_chk;
}
break;
}
DBUG_ASSERT(0);
break;
case 27:
if (!memcmp(table_name, SPIDER_SYS_RW_TBL_TBLS_TABLE_NAME_STR,
SPIDER_SYS_RW_TBL_TBLS_TABLE_NAME_LEN))
{
DBUG_PRINT("info",("spider checking for SYS_RW_TBL_TBLS"));
if (table->s->fields != SPIDER_SYS_RW_TBL_TBLS_COL_CNT)
{
spider_close_sys_table(thd, table, open_tables_backup, need_lock);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
SPIDER_SYS_RW_TBL_TBLS_TABLE_NAME_STR);
*error_num = ER_SPIDER_SYS_TABLE_VERSION_NUM;
goto error_col_num_chk;
}
break;
}
DBUG_ASSERT(0);
break;
case 31:
if (!memcmp(table_name, SPIDER_SYS_RW_TBL_PTTS_TABLE_NAME_STR,
SPIDER_SYS_RW_TBL_PTTS_TABLE_NAME_LEN))
{
DBUG_PRINT("info",("spider checking for SYS_RW_TBL_PTTS"));
if (table->s->fields != SPIDER_SYS_RW_TBL_PTTS_COL_CNT)
{
spider_close_sys_table(thd, table, open_tables_backup, need_lock);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
SPIDER_SYS_RW_TBL_PTTS_TABLE_NAME_STR);
*error_num = ER_SPIDER_SYS_TABLE_VERSION_NUM;
goto error_col_num_chk;
}
break;
}
DBUG_ASSERT(0);
break;
case 34:
Expand All @@ -466,22 +394,6 @@ TABLE *spider_open_sys_table(
}
break;
}
if (!memcmp(table_name, SPIDER_SYS_RW_TBL_SPTTS_TABLE_NAME_STR,
SPIDER_SYS_RW_TBL_SPTTS_TABLE_NAME_LEN))
{
DBUG_PRINT("info",("spider checking for SYS_RW_TBL_SPTTS"));
if (table->s->fields != SPIDER_SYS_RW_TBL_SPTTS_COL_CNT)
{
spider_close_sys_table(thd, table, open_tables_backup, need_lock);
table = NULL;
my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM,
ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0),
SPIDER_SYS_RW_TBL_SPTTS_TABLE_NAME_STR);
*error_num = ER_SPIDER_SYS_TABLE_VERSION_NUM;
goto error_col_num_chk;
}
break;
}
DBUG_ASSERT(0);
break;
default:
Expand Down
15 changes: 0 additions & 15 deletions storage/spider/spd_sys_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@
#define SPIDER_SYS_TABLE_STS_TABLE_NAME_LEN 16
#define SPIDER_SYS_TABLE_CRD_TABLE_NAME_STR "spider_table_crd"
#define SPIDER_SYS_TABLE_CRD_TABLE_NAME_LEN 16
#define SPIDER_SYS_RW_TBLS_TABLE_NAME_STR "spider_rewrite_tables"
#define SPIDER_SYS_RW_TBLS_TABLE_NAME_LEN 21
#define SPIDER_SYS_RW_TBL_TBLS_TABLE_NAME_STR "spider_rewrite_table_tables"
#define SPIDER_SYS_RW_TBL_TBLS_TABLE_NAME_LEN 27
#define SPIDER_SYS_RW_TBL_PTTS_TABLE_NAME_STR "spider_rewrite_table_partitions"
#define SPIDER_SYS_RW_TBL_PTTS_TABLE_NAME_LEN 31
#define SPIDER_SYS_RW_TBL_SPTTS_TABLE_NAME_STR "spider_rewrite_table_subpartitions"
#define SPIDER_SYS_RW_TBL_SPTTS_TABLE_NAME_LEN 34
#define SPIDER_SYS_RWN_TBLS_TABLE_NAME_STR "spider_rewritten_tables"
#define SPIDER_SYS_RWN_TBLS_TABLE_NAME_LEN 23

#define SPIDER_SYS_XA_PREPARED_STR "PREPARED"
#define SPIDER_SYS_XA_NOT_YET_STR "NOT YET"
Expand All @@ -65,11 +55,6 @@
#define SPIDER_SYS_TABLE_STS_PK_COL_CNT 2
#define SPIDER_SYS_TABLE_CRD_COL_CNT 4
#define SPIDER_SYS_TABLE_CRD_PK_COL_CNT 3
#define SPIDER_SYS_RW_TBLS_COL_CNT 3
#define SPIDER_SYS_RW_TBL_TBLS_COL_CNT 8
#define SPIDER_SYS_RW_TBL_PTTS_COL_CNT 7
#define SPIDER_SYS_RW_TBL_SPTTS_COL_CNT 8
#define SPIDER_SYS_RWN_TBLS_COL_CNT 4

#define SPIDER_SYS_LINK_MON_TABLE_DB_NAME_SIZE 64
#define SPIDER_SYS_LINK_MON_TABLE_TABLE_NAME_SIZE 64
Expand Down

0 comments on commit 1a76d75

Please sign in to comment.