Debian Codegraph @

mysql-test/suite/storage_engine/tbl_opt_connection.test

raw
1 #
2 # Check whether CONNECTION option is supported
3 # is supported in CREATE and ALTER TABLE
4 #
5 # Note: the test does not check whether the option
6 # has any real effect on the table, only
7 # that it's accepted
8 #
9
10 --source have_engine.inc
11
12 --disable_warnings
13 DROP TABLE IF EXISTS t1;
14 --enable_warnings
15
16 CREATE DATABASE test_remote;
17 CREATE SERVER test_connection FOREIGN DATA WRAPPER mysql
18 OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote');
19 CREATE SERVER test_connection2 FOREIGN DATA WRAPPER mysql
20 OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote');
21
22 --let $table_options = CONNECTION='test_connection'
23 --source create_table.inc
24 if ($mysql_errname)
25 {
26 --let $my_last_stmt = $create_statement
27 --source unexpected_result.inc
28 }
29 if (!$mysql_errname)
30 {
31 --source mask_engine.inc
32 SHOW CREATE TABLE t1;
33 --let $alter_definition = CONNECTION='test_connection2'
34 --source alter_table.inc
35 if ($mysql_errname)
36 {
37 --let $my_last_stmt = $alter_statement
38 --let $functionality = ALTER TABLE
39 --source unexpected_result.inc
40 }
41 --source mask_engine.inc
42 SHOW CREATE TABLE t1;
43
44 DROP TABLE t1;
45 }
46
47 DROP SERVER test_connection;
48 DROP SERVER test_connection2;
49 DROP DATABASE test_remote;
50
51 --source cleanup_engine.inc
52