--source include/have_rocksdb.inc

# 
# 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;

