1
# Don't run this test if $DRIZZLE_FIX_SYSTEM_TABLES isn't set
2
# to the location of mysql_fix_privilege_tables.sql
3
if (`SELECT LENGTH("$DRIZZLE_FIX_SYSTEM_TABLES") <= 0`)
5
skip Test need DRIZZLE_FIX_SYSTEM_TABLES;
7
# check that CSV engine was compiled in, as the test relies on the presence
8
# of the log tables (which are CSV-based)
9
--source include/have_csv.inc
12
# This is the test for mysql_fix_privilege_tables
13
# It checks that a system tables from mysql 3.20
14
# can be upgraded to current system table format
16
# Note: If this test fails, don't be confused about the errors reported
17
# by mysql-test-run This shows warnings generated by
18
# mysql_fix_system_tables which should be ignored.
19
# Instead, concentrate on the errors in r/system_mysql_db.reject
22
drop table if exists t1,t1aa,t2aa;
28
# create system tables as in mysql-3.20
32
Host char(60) binary DEFAULT '' NOT NULL,
33
Db char(32) binary DEFAULT '' NOT NULL,
34
User char(16) binary DEFAULT '' NOT NULL,
35
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
36
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
37
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
38
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
39
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
40
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
41
PRIMARY KEY Host (Host,Db,User),
47
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
48
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
52
Host char(60) binary DEFAULT '' NOT NULL,
53
Db char(32) binary DEFAULT '' NOT NULL,
54
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
55
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
56
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
57
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
58
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
59
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
60
PRIMARY KEY Host (Host,Db)
67
Host char(60) binary DEFAULT '' NOT NULL,
68
User char(16) binary DEFAULT '' NOT NULL,
70
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
71
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
72
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
73
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
74
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
75
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
76
Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,
77
Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,
78
Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,
79
PRIMARY KEY Host (Host,User)
84
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
85
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
87
# Call the "shell script" $DRIZZLE_FIX_SYSTEM_TABLES using system
91
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv,
92
procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc,
93
time_zone, time_zone_leap_second, time_zone_name, time_zone_transition,
94
time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index,
95
online_backup, online_backup_progress;
98
# check that we dropped all system tables