1
# Embedded server doesn't support external clients
2
--source include/not_embedded.inc
4
# Don't run this test if $MYSQL_FIX_SYSTEM_TABLES isn't set
5
# to the location of mysql_fix_privilege_tables.sql
6
if (`SELECT LENGTH("$MYSQL_FIX_SYSTEM_TABLES") <= 0`)
8
skip Test need MYSQL_FIX_SYSTEM_TABLES;
10
# check that CSV engine was compiled in, as the test relies on the presence
11
# of the log tables (which are CSV-based)
12
--source include/have_csv.inc
15
# This is the test for mysql_fix_privilege_tables
16
# It checks that a system tables from mysql 3.20
17
# can be upgraded to current system table format
19
# Note: If this test fails, don't be confused about the errors reported
20
# by mysql-test-run This shows warnings generated by
21
# mysql_fix_system_tables which should be ignored.
22
# Instead, concentrate on the errors in r/system_mysql_db.reject
25
drop table if exists t1,t1aa,t2aa;
33
# create system tables as in mysql-3.20
37
Host char(60) binary DEFAULT '' NOT NULL,
38
Db char(32) binary DEFAULT '' NOT NULL,
39
User char(16) binary DEFAULT '' NOT NULL,
40
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
41
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
42
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
43
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
44
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
45
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
46
PRIMARY KEY Host (Host,Db,User),
52
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
53
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
57
Host char(60) binary DEFAULT '' NOT NULL,
58
Db char(32) binary DEFAULT '' NOT NULL,
59
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
60
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
61
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
62
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
63
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
64
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
65
PRIMARY KEY Host (Host,Db)
72
Host char(60) binary DEFAULT '' NOT NULL,
73
User char(16) binary DEFAULT '' NOT NULL,
75
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
76
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
77
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
78
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
79
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
80
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
81
Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,
82
Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,
83
Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,
84
PRIMARY KEY Host (Host,User)
89
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
90
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
92
# Call the "shell script" $MYSQL_FIX_SYSTEM_TABLES using system
93
-- system $MYSQL_FIX_SYSTEM_TABLES --database=test > $MYSQLTEST_VARDIR/log/system_mysql_db_fix30020.log 2>&1
97
-- source include/system_db_struct.inc
101
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv,
102
procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc,
103
time_zone, time_zone_leap_second, time_zone_name, time_zone_transition,
104
time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index,
105
online_backup, online_backup_progress;
109
# check that we dropped all system tables