1 ############## suite/funcs_1/datadict/datadict_priv.inc ################
3 # DDL and DML operations on information_schema tables #
6 # 2007-08 hhunger Implement this test as part of #
7 # WL#3982 Test information_schema.processlist #
10 # 2007-08-14 mleich Some cleanup #
12 ########################################################################
14 # These variables have to be set before sourcing this file.
16 # information_schema table to be tested
17 # let $table= processlist;
19 # columns of the information_schema table e.g. to use in a select.
20 # let $columns= ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO;
22 # Where clause for an update.
23 # let $update_where= WHERE id=1 ;
25 # Column to be used in the SET of an update.
26 # let $set_column= user='any_user' ;
28 # Where clause of a delete.
29 # let $delete_where= WHERE id=1 ;
31 # Column to be dropped.
32 # let $drop_column= user;
34 # Column to be indexed
35 # let $index_col= user;
40 eval CREATE TEMPORARY
TABLE test.t_$table AS SELECT * FROM $table;
42 eval UPDATE
test.t_$table SET user=
'horst' $update_where ;
44 --error ER_DBACCESS_DENIED_ERROR
45 eval INSERT INTO $table SELECT * FROM
test.t_$table;
47 # bug#30208: CREATE TABLE ...LIKE does not accept dbname.tablename:unknown database
50 --error ER_VIEW_NONUPD_CHECK
51 eval CREATE VIEW
test.v_$table ($columns) AS SELECT * FROM $table WITH CHECK OPTION;
53 eval CREATE VIEW
test.v_$table ($columns) AS SELECT * FROM $table;
55 --error ER_NON_UPDATABLE_TABLE
56 eval UPDATE
test.v_$TABLE SET TIME=NOW() WHERE
id = 1;
58 eval DROP VIEW
test.v_$table;
60 --error ER_DBACCESS_DENIED_ERROR
61 eval UPDATE $table SET $set_column $update_where;
63 --error ER_DBACCESS_DENIED_ERROR
64 eval DELETE FROM $table $delete_where;
68 --error ER_DBACCESS_DENIED_ERROR
69 eval REVOKE ALL ON $table FROM current_user;
71 --error ER_DBACCESS_DENIED_ERROR
72 eval GRANT INSERT,UPDATE ON $table TO current_user;
76 #----------------------------------------------------------------------
79 --error ER_DBACCESS_DENIED_ERROR
80 eval CREATE INDEX i_$table ON $table ($index_col);
82 --error ER_DBACCESS_DENIED_ERROR
83 eval DROP
TABLE $table;
85 --error ER_DBACCESS_DENIED_ERROR
86 eval ALTER
TABLE $table DROP COLUMN $drop_column;
88 --error ER_DBACCESS_DENIED_ERROR
89 eval ALTER
TABLE $table ADD COLUMN (my_column INT);
91 --error ER_DBACCESS_DENIED_ERROR
92 eval RENAME
TABLE $table TO new_$table;
94 --error ER_DBACCESS_DENIED_ERROR
95 eval RENAME
TABLE $table TO files;
97 --error ER_DBACCESS_DENIED_ERROR
98 eval CREATE
TABLE new_$table AS SELECT * FROM $table;
100 #----------------------------------------------------------------------
103 --error ER_DBACCESS_DENIED_ERROR
104 DROP DATABASE information_schema;
106 --error ER_PARSE_ERROR
107 RENAME DATABASE information_schema TO info_schema;
109 --error ER_DBACCESS_DENIED_ERROR
110 ALTER DATABASE information_schema UPGRADE DATA DIRECTORY NAME;