mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / funcs_1 / t / is_column_privileges_is_mysql_test.test
blob33269fe929c3652be1c79e48c0fab9ae2e0f1392
1 # suite/funcs_1/t/is_column_privileges_is_mysql_test.test
3 # Check the content of information_schema.column_privileges about the databases
4 # information_schema and mysql visible to high and low privileged users.
6 # Author:
7 # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
8 #                           testsuite funcs_1
9 #                   Create this script based on older scripts and new code.
12 # This test cannot be used for the embedded server because we check here
13 # privileges.
14 --source include/not_embedded.inc
16 --echo ##############################################################################
17 --echo # Testcases 3.2.9.2+3.2.9.3 INFORMATION_SCHEMA.SCHEMATA accessible information
18 --echo ##############################################################################
19 # 3.2.9.2  Ensure that the table shows the relevant information for every
20 #          database on which the current user or PUBLIC have privileges.
21 # 3.2.9.3  Ensure that the table does not show any information on any databases
22 #          on which the current user and PUBLIC have no privileges.
24 --disable_warnings
25 DROP DATABASE IF EXISTS db_datadict;
26 --enable_warnings
27 CREATE DATABASE db_datadict;
29 # Create a low privileged user.
30 # Note: The database db_datadict is just a "home" for the low privileged user
31 #       and not in the focus of testing.
32 --error 0,ER_CANNOT_USER
33 DROP   USER 'testuser1'@'localhost';
34 CREATE USER 'testuser1'@'localhost';
35 GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
37 let $my_select = SELECT * FROM information_schema.column_privileges
38 WHERE table_schema IN ('information_schema','mysql','test')
39 ORDER BY table_schema, table_name, column_name;
40 let $my_show1 = SHOW DATABASES LIKE 'information_schema';
41 let $my_show2 = SHOW DATABASES LIKE 'mysql';
42 let $my_show3 = SHOW DATABASES LIKE 'test';
43 eval $my_select;
44 eval $my_show1;
45 eval $my_show2;
46 eval $my_show3;
48 --echo # Establish connection testuser1 (user=testuser1)
49 --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
50 connect (testuser1, localhost, testuser1, , db_datadict);
51 eval $my_select;
52 eval $my_show1;
53 eval $my_show2;
54 eval $my_show3;
56 # Cleanup
57 --echo # Switch to connection default and close connection testuser1
58 connection default;
59 DROP USER 'testuser1'@'localhost';
60 DROP DATABASE db_datadict;