Debian Codegraph @

mysql-test/suite/storage_engine/trx/update.test

raw
1 #
2 # Transactional UPDATE
3 #
4
5 --source ../have_engine.inc
6 --source support_transactions.inc
7 --source support_savepoints.inc
8
9 --disable_warnings
10 DROP TABLE IF EXISTS t1;
11 --enable_warnings
12
13 --source ../create_table.inc
14 INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
15 INSERT INTO t1 (a,b) SELECT a, b FROM t1;
16
17 BEGIN;
18 UPDATE t1 SET a=a+100;
19 if ($mysql_errname)
20 {
21 --let $functionality = UPDATE
22 --source ../unexpected_result.inc
23 }
24 if (!$mysql_errname)
25 {
26 UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100;
27 COMMIT;
28 --sorted_result
29 SELECT a,b FROM t1;
30
31 BEGIN;
32 UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3;
33 UPDATE t1 SET b = '';
34 ROLLBACK;
35
36 BEGIN;
37 UPDATE t1 SET b = 'update2' WHERE a <= 100;
38 SAVEPOINT spt1;
39 UPDATE t1 SET b = '';
40 ROLLBACK TO SAVEPOINT spt1;
41 UPDATE t1 SET b = 'upd' WHERE a = 10050;
42 COMMIT;
43 --sorted_result
44 SELECT a,b FROM t1;
45 }
46
47 DROP TABLE t1;
48
49 --source ../cleanup_engine.inc
50