1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
CREATE TABLE t1 (a SERIAL);
SET @insert_var= "INSERT INTO t1 VALUES()";
EXECUTE @insert_var;
SELECT a FROM t1;
a
1
SET AUTOCOMMIT= 0;
START TRANSACTION;
EXECUTE @insert_var;
COMMIT;
SELECT a FROM t1;
a
1
2
START TRANSACTION;
EXECUTE @insert_var;
ROLLBACK;
SELECT a FROM t1;
a
1
2
START TRANSACTION;
SET @insert_var= "INSERT INTO t1 VALUES(); SELECT WILL_ERROR;";
EXECUTE @insert_var;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near '; SELECT WILL_ERROR;' at line 1
COMMIT;
SELECT a FROM t1;
a
1
2
SET AUTOCOMMIT= 1;
DROP TABLE t1;
|