Debian Codegraph @

mysql-test/suite/funcs_1/datadict/tables.inc

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