Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 6bc9538

Browse files
committed
Rename the mysqldump test. Add a new test for the execute_prepared_stmt routine.
1 parent 5e9a5d6 commit 6bc9538

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed
File renamed without changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
SET @sql := "CREATE TABLE test.t1 (i INT)";
2+
CALL sys.execute_prepared_stmt(@sql);
3+
SHOW CREATE TABLE test.t1;
4+
Table Create Table
5+
t1 CREATE TABLE `t1` (
6+
`i` int(11) DEFAULT NULL
7+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
8+
SET @sql := CONCAT('INSERT INTO test.t1 VALUES (', 1, ')');
9+
CALL sys.execute_prepared_stmt(@sql);
10+
SELECT * FROM test.t1;
11+
i
12+
1
13+
SET @sql := "DROP TABLE test.t1";
14+
CALL sys.execute_prepared_stmt(@sql);
15+
SHOW TABLES;
16+
Tables_in_test
17+
SET @sql = NULL;
18+
CALL sys.execute_prepared_stmt(NULL);
19+
ERROR 45000: The @sys.execute_prepared_stmt.sql must contain a query
20+
CALL sys.execute_prepared_stmt('foo');
21+
ERROR 45000: The @sys.execute_prepared_stmt.sql must contain a query
File renamed without changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-- source include/not_embedded.inc
2+
3+
# Do some valid changes, ensure they are successful
4+
SET @sql := "CREATE TABLE test.t1 (i INT)";
5+
CALL sys.execute_prepared_stmt(@sql);
6+
7+
SHOW CREATE TABLE test.t1;
8+
9+
SET @sql := CONCAT('INSERT INTO test.t1 VALUES (', 1, ')');
10+
CALL sys.execute_prepared_stmt(@sql);
11+
12+
SELECT * FROM test.t1;
13+
14+
SET @sql := "DROP TABLE test.t1";
15+
CALL sys.execute_prepared_stmt(@sql);
16+
17+
SHOW TABLES;
18+
19+
SET @sql = NULL;
20+
21+
# Invalid inputs
22+
-- error S45000
23+
CALL sys.execute_prepared_stmt(NULL);
24+
-- error S45000
25+
CALL sys.execute_prepared_stmt('foo');

0 commit comments

Comments
 (0)