1 # suite/funcs_1/datadict/tables.inc
3 # Auxiliary script to be sourced by
4 # is_tables_<engine>.test
6 # The variable $engine_type has to be assigned before sourcing ths script.
9 # 2008-06-04 mleich Create this script based on older scripts and new code.
12 # Just have some tables within different databases.
14 DROP DATABASE IF EXISTS test1;
15 DROP DATABASE IF EXISTS test2;
17 CREATE DATABASE test1;
18 CREATE DATABASE test2;
20 --replace_result $engine_type <engine_to_be_used>
21 eval CREATE
TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = $engine_type;
22 --replace_result $engine_type <engine_to_be_used>
23 eval CREATE
TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = $engine_type;
24 --replace_result $engine_type <engine_to_be_used>
25 eval CREATE
TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = $engine_type;
27 --source suite/funcs_1/datadict/tables2.inc
28 SHOW TABLES FROM test1;
29 SHOW TABLES FROM test2;
31 # Create a low privileged user.
32 # Note: The database db_datadict is just a "home" for the low privileged user
33 # and not in the focus of testing.
34 --error 0,ER_CANNOT_USER
35 DROP USER testuser1@localhost;
36 CREATE USER testuser1@localhost;
37 GRANT SELECT ON test1.* TO testuser1@localhost;
39 --echo # Establish connection testuser1 (user=testuser1)
40 --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
41 connect (testuser1,localhost,testuser1,,test1);
42 --source suite/funcs_1/datadict/tables2.inc
43 SHOW TABLES FROM test1;
44 # The lowprivileged user testuser1 will get here an error.
45 --disable_abort_on_error
46 SHOW TABLES FROM test2;
47 --enable_abort_on_error
49 --echo # Switch
to connection
default and close connection testuser1
52 DROP USER testuser1@localhost;