1
2#
3# Clean up after previous tests
4#
5
6--disable_warnings
7DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
8drop view if exists v1;
9drop database if exists client_test_db;
10# Repair any tables in mysql, sometimes the slow_log is marked as crashed
11# after server has been killed
12--exec $MYSQL_CHECK --repair  --databases mysql > /dev/null 2>&1
13--enable_warnings
14
15--disable_query_log
16# Create a dummy ndb_binlog_index in case we run without ndb to get similar results
17SET @have_ndb= (select count(engine) from information_schema.engines where engine='ndbcluster');
18SET @create_cmd="CREATE TABLE mysql.ndb_binlog_index (i INTEGER PRIMARY KEY)
19  ENGINE=INNODB STATS_PERSISTENT=0";
20SET @drop_cmd="DROP TABLE mysql.ndb_binlog_index";
21
22SET @create = IF(@have_ndb = 0, @create_cmd, 'SET @dummy = 0');
23SET @drop = IF(@have_ndb = 0, @drop_cmd, 'SET @dummy = 0');
24PREPARE create_stmt FROM @create;
25PREPARE drop_stmt FROM @drop;
26
27EXECUTE create_stmt;
28DROP PREPARE create_stmt;
29--enable_query_log
30
31#
32# Bug #13783  mysqlcheck tries to optimize and analyze information_schema
33#
34--replace_result 'Table is already up to date' OK
35# Filter out ndb_binlog_index to mask differences due to running with or
36# without ndb.
37--replace_regex /mysql.ndb_binlog_index.*\n//
38--exec $MYSQL_CHECK --all-databases --analyze
39# Filter out ndb_binlog_index to mask differences due to running with or
40# without ndb.
41--replace_regex /mysql.ndb_binlog_index.*\n//
42--exec $MYSQL_CHECK --all-databases --optimize
43--replace_result 'Table is already up to date' OK
44# Filter out ndb_binlog_index to mask differences due to running with or
45# without ndb.
46--replace_regex /mysql.ndb_binlog_index.*\n//
47--exec $MYSQL_CHECK --analyze --databases test information_schema mysql
48# Filter out ndb_binlog_index to mask differences due to running with or
49# without ndb.
50--replace_regex /mysql.ndb_binlog_index.*\n//
51--exec $MYSQL_CHECK --optimize  --databases test information_schema mysql
52--exec $MYSQL_CHECK --analyze information_schema schemata
53--exec $MYSQL_CHECK --optimize information_schema schemata
54
55# Drop dummy ndb_binlog_index table
56--disable_query_log
57EXECUTE drop_stmt;
58DROP PREPARE drop_stmt;
59--enable_query_log
60
61#
62# Bug#39541 CHECK TABLE on information_schema myisam tables produces error
63#
64create view v1 as select * from information_schema.routines;
65check table v1, information_schema.routines;
66drop view v1;
67
68
69--echo End of 5.0 tests
70
71
72#
73# WL#3126 TCP address binding for mysql client library;
74# - running mysqlcheck --protcol=tcp --bind-address=127.0.0.1
75#
76--exec $MYSQL_CHECK --protocol=tcp --bind-address=127.0.0.1 --databases test
77
78--echo End of 5.1 tests
79
80--echo #
81--echo # Bug #35269: mysqlcheck behaves different depending on order of parameters
82--echo #
83
84--error 1
85--exec $MYSQL_CHECK -aoc test "#mysql50#t1-1"
86
87
88--echo #
89--echo # Bug#12688860 : SECURITY RECOMMENDATION: PASSWORDS ON CLI
90--echo #
91
92--disable_warnings
93DROP DATABASE IF EXISTS b12688860_db;
94--enable_warnings
95
96CREATE DATABASE b12688860_db;
97--exec $MYSQL_CHECK -uroot --password="" b12688860_db 2>&1
98DROP DATABASE b12688860_db;
99
100--echo #
101--echo # WL#2284: Increase the length of a user name
102--echo #
103
104CREATE USER 'user_with_length_32_abcdefghijkl'@'localhost';
105GRANT ALL ON *.* TO 'user_with_length_32_abcdefghijkl'@'localhost';
106
107--exec $MYSQL_CHECK --host=127.0.0.1 -P $MASTER_MYPORT --user=user_with_length_32_abcdefghijkl --protocol=TCP mysql user
108
109DROP USER 'user_with_length_32_abcdefghijkl'@'localhost';
110
111--echo
112--echo End of tests
113