Debian Codegraph @

mysql-test/suite/storage_engine/update_ignore.test

raw
1 #
2 # UPDATE IGNORE
3 #
4
5 --source have_engine.inc
6
7 --disable_warnings
8 DROP TABLE IF EXISTS t1,t2;
9 --enable_warnings
10
11 --source create_table.inc
12 INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
13 INSERT INTO t1 (a,b) SELECT a, b FROM t1;
14
15 --let $table_name = t2
16 --let $create_definition = c $char_col, d $int_col
17 --source create_table.inc
18 INSERT INTO t2 (c,d) SELECT b, a FROM t1;
19
20 UPDATE IGNORE t1 SET b = 'upd1' WHERE b IS NOT NULL ORDER BY a LIMIT 1;
21 if ($mysql_errname)
22 {
23 --let $functionality = UPDATE IGNORE
24 --source unexpected_result.inc
25 }
26 if (!$mysql_errname)
27 {
28 --sorted_result
29 SELECT a,b FROM t1;
30
31 UPDATE IGNORE t1, t2 SET b = 'upd2a', c = 'upd2b'
32 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 );
33 --sorted_result
34 SELECT a,b FROM t1;
35 --sorted_result
36 SELECT c,d FROM t2;
37 }
38
39 # Cleanup
40 DROP TABLE t1, t2;
41
42 --source cleanup_engine.inc
43