[Commits] 4a13b19: Add another testcase: suite/rocksdb/update_ignore.test

Sergei Petrunia psergey at askmonty.org
Wed Jul 16 18:32:17 EEST 2014


revision-id: 4a13b197b15dfe32ce521c5845444fd0f0468e0b
parent(s): c0abe59b428800067327465d3f5640455f15b4da
committer: Sergei Petrunia
branch nick: webscalesql-5.6
timestamp: 2014-07-16 19:32:17 +0400
message:

Add another testcase: suite/rocksdb/update_ignore.test

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

 mysql-test/suite/rocksdb/update_ignore.result |   57 +++++++++++++++++++++++++
 mysql-test/suite/rocksdb/update_ignore.test   |   33 ++++++++++++++
 2 files changed, 90 insertions(+)

diff --git a/mysql-test/suite/rocksdb/update_ignore.result b/mysql-test/suite/rocksdb/update_ignore.result
new file mode 100644
index 0000000..9dda807
--- /dev/null
+++ b/mysql-test/suite/rocksdb/update_ignore.result
@@ -0,0 +1,57 @@
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+CREATE TABLE t2 (c CHAR(8), d INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+UPDATE IGNORE t1 SET b = 'upd1' WHERE b IS NOT NULL ORDER BY a LIMIT 1;
+SELECT a,b FROM t1 ORDER BY pk;
+a	b
+1	upd1
+2	b
+3	c
+4	d
+5	e
+10000	foobar
+1	a
+2	b
+3	c
+4	d
+5	e
+10000	foobar
+UPDATE t1, t2 SET b = 'upd2a', c = 'upd2b' 
+WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 );
+ERROR 21000: Subquery returns more than 1 row
+UPDATE IGNORE t1, t2 SET b = 'upd2a', c = 'upd2b' 
+WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 );
+Warnings:
+Error	1242	Subquery returns more than 1 row
+SELECT a,b FROM t1 ORDER BY pk;
+a	b
+1	upd2a
+2	upd2a
+3	upd2a
+4	upd2a
+5	upd2a
+10000	upd2a
+1	a
+2	upd2a
+3	upd2a
+4	upd2a
+5	upd2a
+10000	upd2a
+SELECT c,d FROM t2 ORDER BY pk;
+c	d
+upd2b	1
+upd2b	2
+upd2b	3
+upd2b	4
+upd2b	5
+upd2b	10000
+upd2b	1
+upd2b	2
+upd2b	3
+upd2b	4
+upd2b	5
+upd2b	10000
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rocksdb/update_ignore.test b/mysql-test/suite/rocksdb/update_ignore.test
new file mode 100644
index 0000000..a8f27b1
--- /dev/null
+++ b/mysql-test/suite/rocksdb/update_ignore.test
@@ -0,0 +1,33 @@
+# 
+# UPDATE IGNORE
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b CHAR(8), pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
+INSERT INTO t1 (a,b) SELECT a, b FROM t1;
+
+CREATE TABLE t2 (c CHAR(8), d INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
+
+INSERT INTO t2 (c,d) SELECT b, a FROM t1;
+
+UPDATE IGNORE t1 SET b = 'upd1' WHERE b IS NOT NULL ORDER BY a LIMIT 1;
+SELECT a,b FROM t1 ORDER BY pk;
+
+--error ER_SUBQUERY_NO_1_ROW
+UPDATE t1, t2 SET b = 'upd2a', c = 'upd2b' 
+  WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 );
+
+UPDATE IGNORE t1, t2 SET b = 'upd2a', c = 'upd2b' 
+  WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 );
+
+SELECT a,b FROM t1 ORDER BY pk;
+SELECT c,d FROM t2 ORDER BY pk;
+
+# Cleanup
+DROP TABLE t1, t2;
+


More information about the commits mailing list