summaryrefslogtreecommitdiff
path: root/storage/spider/mysql-test/spider/regression/e1121/t/item_cache.test
diff options
context:
space:
mode:
Diffstat (limited to 'storage/spider/mysql-test/spider/regression/e1121/t/item_cache.test')
-rw-r--r--storage/spider/mysql-test/spider/regression/e1121/t/item_cache.test76
1 files changed, 76 insertions, 0 deletions
diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/item_cache.test b/storage/spider/mysql-test/spider/regression/e1121/t/item_cache.test
new file mode 100644
index 00000000000..c4c13ce79ab
--- /dev/null
+++ b/storage/spider/mysql-test/spider/regression/e1121/t/item_cache.test
@@ -0,0 +1,76 @@
+--source ../include/item_cache_init.inc
+--echo
+--echo this test is for MDEV-16279
+--echo
+--echo drop and create databases
+
+--connection master_1
+--disable_warnings
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+
+--connection child2_1
+SET @old_log_output = @@global.log_output;
+SET GLOBAL log_output = 'TABLE,FILE';
+CREATE DATABASE auto_test_remote;
+USE auto_test_remote;
+--enable_warnings
+
+--echo
+--echo create table and insert
+
+--connection child2_1
+--disable_query_log
+echo CHILD2_1_CREATE_TABLES;
+eval $CHILD2_1_CREATE_TABLES;
+--enable_query_log
+TRUNCATE TABLE mysql.general_log;
+
+--connection master_1
+--disable_query_log
+echo CREATE TABLE tbl_a (
+ pkey int NOT NULL,
+ dt datetime NOT NULL,
+ PRIMARY KEY (pkey),
+ KEY idx1 (dt)
+) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
+eval CREATE TABLE tbl_a (
+ pkey int NOT NULL,
+ dt datetime NOT NULL,
+ PRIMARY KEY (pkey),
+ KEY idx1 (dt)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
+--enable_query_log
+INSERT INTO tbl_a (pkey, dt) VALUES (0, '2012-01-01'),(1, '2012-02-01'),(2, '2012-03-01'),(3, '2012-04-01'),(4, '2012-05-01'),(5, '2012-06-01'),(6, '2012-07-01'),(7, '2012-08-01'),(8, '2012-09-01'),(9, '2012-10-01');
+INSERT INTO tbl_a (pkey, dt) VALUES (10, '2013-01-01'),(11, '2013-02-01'),(12, '2013-03-01'),(13, '2013-04-01'),(14, '2013-05-01'),(15, '2013-06-01'),(16, '2013-07-01'),(17, '2013-08-01'),(18, '2013-09-01'),(19, '2013-10-01');
+INSERT INTO tbl_a (pkey, dt) VALUES (20, '2012-11-01'),(21, '2012-12-01'),(22, '2012-11-30'),(23, '2012-11-29'),(24, '2012-11-28'),(25, '2012-11-27'),(26, '2012-11-26'),(27, '2012-11-25'),(28, '2012-11-24'),(29, '2012-11-23');
+FLUSH TABLES;
+
+--echo
+--echo select test 1
+
+--connection child2_1
+TRUNCATE TABLE mysql.general_log;
+
+--connection master_1
+SELECT pkey, dt FROM tbl_a WHERE dt > SUBDATE('2012-12-31 23:59:59', 31);
+
+--connection child2_1
+eval $CHILD2_1_SELECT_ARGUMENT1;
+eval $CHILD2_1_SELECT_TABLES;
+
+--echo
+--echo deinit
+--disable_warnings
+
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+
+--connection child2_1
+DROP DATABASE IF EXISTS auto_test_remote;
+SET GLOBAL log_output = @old_log_output;
+
+--enable_warnings
+--source ../include/item_cache_deinit.inc
+--echo
+--echo end of test