MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
statistics.inc
1 # suite/funcs_1/datadict/statistics.inc
2 #
3 # Auxiliary script to be sourced by
4 # is_statistics_is
5 # is_statistics_mysql
6 # is_statistics_<engine>
7 #
8 # Purpose:
9 # Check the content of information_schema.statistics about tables within the
10 # database '$database'.
11 #
12 # Usage:
13 # The variable $database has to be set before sourcing this script.
14 # Example:
15 # let $database = db_data;
16 #
17 # Author:
18 # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
19 # testsuite funcs_1
20 # Create this script based on older scripts and new code.
21 #
22 
23 --source suite/funcs_1/datadict/datadict.pre
24 
25 --disable_warnings
26 DROP DATABASE IF EXISTS db_datadict;
27 --enable_warnings
28 CREATE DATABASE db_datadict;
29 
30 # Create a low privileged user.
31 # Note: The database db_datadict is just a "home" for the low privileged user
32 # and not in the focus of testing.
33 --error 0,ER_CANNOT_USER
34 DROP USER testuser1@localhost;
35 CREATE USER testuser1@localhost;
36 GRANT SELECT ON db_datadict.* TO testuser1@localhost;
37 
38 let $my_select = SELECT * FROM information_schema.statistics
39 $my_where
40 ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
41 --replace_column 10 #CARD#
42 eval $my_select;
43 
44 --echo # Establish connection testuser1 (user=testuser1)
45 --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
46 connect (testuser1,localhost,testuser1,,db_datadict);
47 --replace_column 10 #CARD#
48 eval $my_select;
49 
50 --echo # Switch to connection default and close connection testuser1
51 connection default;
52 disconnect testuser1;
53 DROP USER testuser1@localhost;
54 DROP DATABASE db_datadict;
55