Browse Source

MDEV-36335 MDEV-35452 Disable view protocol when calling spider_copy_tables in tests

Spider needs to lock the spider table when executing the udf, but the
server layer would have already locked tables in view protocol because
it transforms the query:

select spider_copy_table('t', 0, 1)

to two queries

create or replace view mysqltest_tmp_v as select
spider_copy_table('t', 0, 1);
select * from mysqltest_tmp_v;

So spider justifiably errors out in this case by checking on
thd->derived_tables and thd->locks in spider_copy_tables_body()
bb-10.5-MDEV-31477
Yuchen Pei 6 months ago
parent
commit
dabd51c391
No known key found for this signature in database GPG Key ID: 3DD1B35105743563
  1. 2
      storage/spider/mysql-test/spider/bg/t/ha.test
  2. 2
      storage/spider/mysql-test/spider/bg/t/ha_part.test
  3. 2
      storage/spider/mysql-test/spider/bugfix/t/mdev_30649.test
  4. 4
      storage/spider/mysql-test/spider/bugfix/t/mdev_30727.test
  5. 2
      storage/spider/mysql-test/spider/handler/t/ha.test
  6. 2
      storage/spider/mysql-test/spider/handler/t/ha_part.test
  7. 2
      storage/spider/mysql-test/spider/t/ha.test
  8. 2
      storage/spider/mysql-test/spider/t/ha_part.test

2
storage/spider/mysql-test/spider/bg/t/ha.test

@ -395,7 +395,9 @@ if ($USE_CHILD_GROUP3)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
--disable_view_protocol
eval $MASTER_1_COPY_TABLES_2_1;
--enable_view_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)

2
storage/spider/mysql-test/spider/bg/t/ha_part.test

@ -460,7 +460,9 @@ if ($HAVE_PARTITION)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
--disable_view_protocol
eval $MASTER_1_COPY_TABLES_P_2_1;
--enable_view_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)

2
storage/spider/mysql-test/spider/bugfix/t/mdev_30649.test

@ -25,7 +25,9 @@ INSERT INTO dst VALUES (555, '1999-12-12');
# possibly a bug, e.g. an unnecessary requirement.
evalp CREATE TABLE t (c INT, d DATE, PRIMARY KEY(c)) ENGINE=SPIDER
COMMENT='table "src dst", srv "s_2_1 s_1"';
--disable_view_protocol
SELECT spider_copy_tables('t', '0', '1');
--enable_view_protocol
SELECT * FROM dst;

4
storage/spider/mysql-test/spider/bugfix/t/mdev_30727.test

@ -7,8 +7,10 @@ CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so';
SELECT spider_bg_direct_sql ('SELECT * FROM s','a','srv "b"');
CREATE FUNCTION spider_copy_tables RETURNS INT SONAME 'ha_spider.so';
--disable_view_protocol
--error ER_CANT_INITIALIZE_UDF
SELECT spider_copy_tables ('t', '0', '0');
--enable_view_protocol
# spider_flush_table_mon_cache does not require spider init to function
CREATE FUNCTION spider_flush_table_mon_cache RETURNS INT SONAME 'ha_spider.so';
@ -21,8 +23,10 @@ install soname 'ha_spider';
SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"');
call mtr.add_suppression(".*\\[Error\\] (mysqld|mariadbd): Can't find record in 'spider_tables'");
--disable_view_protocol
--error ER_KEY_NOT_FOUND
SELECT spider_copy_tables ('t', '0', '0');
--enable_view_protocol
SELECT spider_flush_table_mon_cache ();

2
storage/spider/mysql-test/spider/handler/t/ha.test

@ -395,7 +395,9 @@ if ($USE_CHILD_GROUP3)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
--disable_view_protocol
eval $MASTER_1_COPY_TABLES_2_1;
--enable_view_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)

2
storage/spider/mysql-test/spider/handler/t/ha_part.test

@ -460,7 +460,9 @@ if ($HAVE_PARTITION)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
--disable_view_protocol
eval $MASTER_1_COPY_TABLES_P_2_1;
--enable_view_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)

2
storage/spider/mysql-test/spider/t/ha.test

@ -395,7 +395,9 @@ if ($USE_CHILD_GROUP3)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
--disable_view_protocol
eval $MASTER_1_COPY_TABLES_2_1;
--enable_view_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)

2
storage/spider/mysql-test/spider/t/ha_part.test

@ -460,7 +460,9 @@ if ($HAVE_PARTITION)
--connection master_1
eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1;
eval $MASTER_1_CHECK_LINK_STATUS;
--disable_view_protocol
eval $MASTER_1_COPY_TABLES_P_2_1;
--enable_view_protocol
if ($USE_CHILD_GROUP3)
{
if (!$OUTPUT_CHILD_GROUP3)

Loading…
Cancel
Save