summaryrefslogtreecommitdiffstats
path: root/storage/columnstore/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'storage/columnstore/mysql-test')
-rw-r--r--storage/columnstore/mysql-test/columnstore/include/cleanup_columnstore.inc4
-rw-r--r--storage/columnstore/mysql-test/columnstore/include/have_columnstore.inc13
-rw-r--r--storage/columnstore/mysql-test/columnstore/r/basic.result17
-rw-r--r--storage/columnstore/mysql-test/columnstore/suite.opt1
-rw-r--r--storage/columnstore/mysql-test/columnstore/suite.pm7
-rw-r--r--storage/columnstore/mysql-test/columnstore/t/basic.test20
6 files changed, 62 insertions, 0 deletions
diff --git a/storage/columnstore/mysql-test/columnstore/include/cleanup_columnstore.inc b/storage/columnstore/mysql-test/columnstore/include/cleanup_columnstore.inc
new file mode 100644
index 00000000..c1286a5e
--- /dev/null
+++ b/storage/columnstore/mysql-test/columnstore/include/cleanup_columnstore.inc
@@ -0,0 +1,4 @@
+--disable_query_log
+DROP FUNCTION IF EXISTS mcssystemready;
+--enable_query_log
+
diff --git a/storage/columnstore/mysql-test/columnstore/include/have_columnstore.inc b/storage/columnstore/mysql-test/columnstore/include/have_columnstore.inc
new file mode 100644
index 00000000..f6b97fed
--- /dev/null
+++ b/storage/columnstore/mysql-test/columnstore/include/have_columnstore.inc
@@ -0,0 +1,13 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'columnstore' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
+{
+ --skip Test requires engine ColumnStore.
+}
+
+--disable_query_log
+CREATE FUNCTION mcssystemready RETURNS INTEGER SONAME 'ha_columnstore.so';
+--enable_query_log
+
+if (`SELECT mcssystemready() = 0`)
+{
+ --skip Test requires ColumnStore to be running
+}
diff --git a/storage/columnstore/mysql-test/columnstore/r/basic.result b/storage/columnstore/mysql-test/columnstore/r/basic.result
new file mode 100644
index 00000000..3be76759
--- /dev/null
+++ b/storage/columnstore/mysql-test/columnstore/r/basic.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT, b VARCHAR(255)) ENGINE=columnstore;
+INSERT INTO t1 (a, b) VALUES (1, 'columnstore'), (2, 'test');
+SELECT * FROM t1;
+a b
+1 columnstore
+2 test
+UPDATE t1 SET a=a+100;
+SELECT * FROM t1;
+a b
+101 columnstore
+102 test
+DELETE FROM t1 WHERE a=101;
+SELECT * FROM t1;
+a b
+102 test
+DROP TABLE t1;
diff --git a/storage/columnstore/mysql-test/columnstore/suite.opt b/storage/columnstore/mysql-test/columnstore/suite.opt
new file mode 100644
index 00000000..fbd322fd
--- /dev/null
+++ b/storage/columnstore/mysql-test/columnstore/suite.opt
@@ -0,0 +1 @@
+--plugin-load-add=$HA_COLUMNSTORE_SO
diff --git a/storage/columnstore/mysql-test/columnstore/suite.pm b/storage/columnstore/mysql-test/columnstore/suite.pm
new file mode 100644
index 00000000..5579df40
--- /dev/null
+++ b/storage/columnstore/mysql-test/columnstore/suite.pm
@@ -0,0 +1,7 @@
+package My::Suite::ColumnStore;
+
+use My::SysInfo;
+
+@ISA = qw(My::Suite);
+
+bless { };
diff --git a/storage/columnstore/mysql-test/columnstore/t/basic.test b/storage/columnstore/mysql-test/columnstore/t/basic.test
new file mode 100644
index 00000000..34ab07d7
--- /dev/null
+++ b/storage/columnstore/mysql-test/columnstore/t/basic.test
@@ -0,0 +1,20 @@
+--source include/have_columnstore.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b VARCHAR(255)) ENGINE=columnstore;
+
+INSERT INTO t1 (a, b) VALUES (1, 'columnstore'), (2, 'test');
+SELECT * FROM t1;
+
+UPDATE t1 SET a=a+100;
+SELECT * FROM t1;
+
+DELETE FROM t1 WHERE a=101;
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+--source include/cleanup_columnstore.inc