[Commits] e1a6460: Add remaining tests to mysql-test/suite/rocksdb. This fixes Issue #1

Sergei Petrunia psergey at askmonty.org
Wed Jul 16 22:16:26 EEST 2014


revision-id: e1a6460000b67a4ab3113a0dcfd707e25d33675f
parent(s): 505b11931851c95086e88f252244c8c1cce17c6f
committer: Sergei Petrunia
branch nick: webscalesql-5.6
timestamp: 2014-07-16 23:16:26 +0400
message:

Add remaining tests to mysql-test/suite/rocksdb. This fixes Issue #1

Two testcases are empty because RocksDB-SE doesn't support the feature:
-autoincrement.test
-autoinc_secondary.test

-----------------------

 mysql-test/suite/rocksdb/autoinc_secondary.result |    1 +
 mysql-test/suite/rocksdb/autoinc_secondary.test   |    2 +
 mysql-test/suite/rocksdb/autoinc_vars.result      |   64 +++++++++++++++++++++
 mysql-test/suite/rocksdb/autoinc_vars.test        |   63 ++++++++++++++++++++
 mysql-test/suite/rocksdb/autoincrement.result     |    1 +
 mysql-test/suite/rocksdb/autoincrement.test       |    1 +
 6 files changed, 132 insertions(+)

diff --git a/mysql-test/suite/rocksdb/autoinc_secondary.result b/mysql-test/suite/rocksdb/autoinc_secondary.result
new file mode 100644
index 0000000..28b5b6c
--- /dev/null
+++ b/mysql-test/suite/rocksdb/autoinc_secondary.result
@@ -0,0 +1 @@
+# The test checks AUTO_INCREMENT capabilities that are not supported by RocksDB-SE.
diff --git a/mysql-test/suite/rocksdb/autoinc_secondary.test b/mysql-test/suite/rocksdb/autoinc_secondary.test
new file mode 100644
index 0000000..e7a7354
--- /dev/null
+++ b/mysql-test/suite/rocksdb/autoinc_secondary.test
@@ -0,0 +1,2 @@
+--echo # The test checks AUTO_INCREMENT capabilities that are not supported by RocksDB-SE.
+
diff --git a/mysql-test/suite/rocksdb/autoinc_vars.result b/mysql-test/suite/rocksdb/autoinc_vars.result
new file mode 100644
index 0000000..b14a7a4
--- /dev/null
+++ b/mysql-test/suite/rocksdb/autoinc_vars.result
@@ -0,0 +1,64 @@
+DROP TABLE IF EXISTS t1;
+#---------------------------
+# auto_increment_offset
+#---------------------------
+SET auto_increment_offset = 200;
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c');
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+1
+SELECT a,b FROM t1 ORDER BY a;
+a	b
+1	a
+2	b
+3	c
+#---------------------------
+# auto_increment_increment
+#---------------------------
+SET auto_increment_increment = 300;
+INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f');
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+200
+SELECT a,b FROM t1 ORDER BY a;
+a	b
+1	a
+2	b
+3	c
+200	d
+500	e
+800	f
+SET auto_increment_increment = 50;
+INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i');
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+850
+SELECT a,b FROM t1 ORDER BY a;
+a	b
+1	a
+2	b
+3	c
+200	d
+500	e
+800	f
+850	g
+900	h
+950	i
+DROP TABLE t1;
+#---------------------------
+# offset is greater than the max value
+#---------------------------
+SET auto_increment_increment = 500;
+SET auto_increment_offset = 300;
+CREATE TABLE t1 (a TINYINT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a) VALUES (NULL);
+Warnings:
+Warning	1264	Out of range value for column 'a' at row 1
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+127
+SELECT a FROM t1 ORDER BY a;
+a
+127
+DROP TABLE t1;
diff --git a/mysql-test/suite/rocksdb/autoinc_vars.test b/mysql-test/suite/rocksdb/autoinc_vars.test
new file mode 100644
index 0000000..25ce5cf
--- /dev/null
+++ b/mysql-test/suite/rocksdb/autoinc_vars.test
@@ -0,0 +1,63 @@
+# 
+# auto-increment-offset and auto-increment-increment
+#
+
+############################################
+# TODO:
+# This test currently produces wrong result 
+# on the line 36 of the result file and further
+# due to bug MySQL:47118. 
+# When/if the bug is fixed, 
+# the result will need to be updated
+############################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #---------------------------
+--echo # auto_increment_offset
+--echo #---------------------------
+SET auto_increment_offset = 200;
+
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb;
+
+# If auto_increment_offset is greater than auto_increment_increment,
+# the offset is ignored
+
+INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c');
+SELECT LAST_INSERT_ID();
+SELECT a,b FROM t1 ORDER BY a;
+
+--echo #---------------------------
+--echo # auto_increment_increment
+--echo #---------------------------
+
+SET auto_increment_increment = 300;
+# offset should not be ignored anymore
+
+INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f');
+SELECT LAST_INSERT_ID();
+SELECT a,b FROM t1 ORDER BY a;
+
+SET auto_increment_increment = 50;
+INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i');
+SELECT LAST_INSERT_ID();
+SELECT a,b FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+
+--echo #---------------------------
+--echo # offset is greater than the max value
+--echo #---------------------------
+
+SET auto_increment_increment = 500;
+SET auto_increment_offset = 300;
+
+CREATE TABLE t1 (a TINYINT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a) VALUES (NULL);
+SELECT LAST_INSERT_ID();
+SELECT a FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+
diff --git a/mysql-test/suite/rocksdb/autoincrement.result b/mysql-test/suite/rocksdb/autoincrement.result
new file mode 100644
index 0000000..28b5b6c
--- /dev/null
+++ b/mysql-test/suite/rocksdb/autoincrement.result
@@ -0,0 +1 @@
+# The test checks AUTO_INCREMENT capabilities that are not supported by RocksDB-SE.
diff --git a/mysql-test/suite/rocksdb/autoincrement.test b/mysql-test/suite/rocksdb/autoincrement.test
new file mode 100644
index 0000000..3874faa
--- /dev/null
+++ b/mysql-test/suite/rocksdb/autoincrement.test
@@ -0,0 +1 @@
+--echo # The test checks AUTO_INCREMENT capabilities that are not supported by RocksDB-SE.


More information about the commits mailing list