File: mysqlcheck.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (122 lines) | stat: -rw-r--r-- 3,848 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

#
# Clean up after previous tests
#

--disable_warnings
DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
drop view if exists v1;
drop database if exists client_test_db;
# Repair any tables in mysql, sometimes the slow_log is marked as crashed
# after server has been killed
--exec $MYSQL_CHECK --repair  --databases mysql > /dev/null 2>&1
--enable_warnings

--disable_query_log
# Create a dummy ndb_binlog_index in case we run without ndb to get similar results
SET @have_ndb= (select count(engine) from information_schema.engines where engine='ndbcluster');
SET @create_cmd="CREATE TABLE mysql.ndb_binlog_index (i INTEGER PRIMARY KEY)
  ENGINE=INNODB STATS_PERSISTENT=0";
SET @drop_cmd="DROP TABLE mysql.ndb_binlog_index";

SET @create = IF(@have_ndb = 0, @create_cmd, 'SET @dummy = 0');
SET @drop = IF(@have_ndb = 0, @drop_cmd, 'SET @dummy = 0');
PREPARE create_stmt FROM @create;
PREPARE drop_stmt FROM @drop;

EXECUTE create_stmt;
DROP PREPARE create_stmt;
--enable_query_log

#
# Bug #13783  mysqlcheck tries to optimize and analyze information_schema
#
--replace_result 'Table is already up to date' OK
# Filter out ndb_binlog_index to mask differences due to running with or
# without ndb.
--replace_regex /mysql.ndb_binlog_index.*\n//
--exec $MYSQL_CHECK --all-databases --analyze
# Filter out ndb_binlog_index to mask differences due to running with or
# without ndb.
--replace_regex /mysql.ndb_binlog_index.*\n//
--exec $MYSQL_CHECK --all-databases --optimize
--replace_result 'Table is already up to date' OK
# Filter out ndb_binlog_index to mask differences due to running with or
# without ndb.
--replace_regex /mysql.ndb_binlog_index.*\n//
--exec $MYSQL_CHECK --analyze --databases test information_schema mysql
# Filter out ndb_binlog_index to mask differences due to running with or
# without ndb.
--replace_regex /mysql.ndb_binlog_index.*\n//
--exec $MYSQL_CHECK --optimize  --databases test information_schema mysql
--exec $MYSQL_CHECK --analyze information_schema schemata
--exec $MYSQL_CHECK --optimize information_schema schemata

# Drop dummy ndb_binlog_index table
--disable_query_log
EXECUTE drop_stmt;
DROP PREPARE drop_stmt;
--enable_query_log

#
# Bug#39541 CHECK TABLE on information_schema myisam tables produces error
#
create view v1 as select * from information_schema.routines;
check table v1, information_schema.routines;
drop view v1;


--echo End of 5.0 tests


#
# WL#3126 TCP address binding for mysql client library;
# - running mysqlcheck --protcol=tcp --bind-address=127.0.0.1
#
--exec $MYSQL_CHECK --protocol=tcp --bind-address=127.0.0.1 --databases test

--echo End of 5.1 tests

--echo #
--echo # Bug #35269: mysqlcheck behaves different depending on order of parameters
--echo #

--error 1
--exec $MYSQL_CHECK -aoc test "#mysql50#t1-1"


--echo #
--echo # Bug#12688860 : SECURITY RECOMMENDATION: PASSWORDS ON CLI
--echo #

--disable_warnings
DROP DATABASE IF EXISTS b12688860_db;
--enable_warnings

CREATE DATABASE b12688860_db;
--exec $MYSQL_CHECK -uroot --password="" b12688860_db 2>&1
DROP DATABASE b12688860_db;

--echo #
--echo # WL#2284: Increase the length of a user name
--echo #

CREATE USER 'user_with_length_32_abcdefghijkl'@'localhost';
GRANT ALL ON *.* TO 'user_with_length_32_abcdefghijkl'@'localhost';

--exec $MYSQL_CHECK --host=127.0.0.1 -P $MASTER_MYPORT --user=user_with_length_32_abcdefghijkl --protocol=TCP mysql user

DROP USER 'user_with_length_32_abcdefghijkl'@'localhost';

--echo #
--echo # WL#13292: Deprecate legacy connection compression parameters
--echo #

--echo # exec mysqlcheck --compress: must have a deprecation warning
--exec $MYSQL_CHECK --compress --databases test 2>&1
--echo # exec mysqlcheck --compression-algorithms: must not have a deprecation warning
--exec $MYSQL_CHECK --compression-algorithms=zlib,uncompressed --databases test 2>&1


--echo
--echo End of tests