~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/t/system_mysql_db_fix30020.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Embedded server doesn't support external clients
 
2
--source include/not_embedded.inc
 
3
 
 
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`)
 
7
{
 
8
  skip Test need MYSQL_FIX_SYSTEM_TABLES;
 
9
}
 
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
 
13
 
 
14
#
 
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
 
18
#
 
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
 
23
 
 
24
--disable_warnings
 
25
drop table if exists t1,t1aa,t2aa;
 
26
--enable_warnings
 
27
 
 
28
-- disable_result_log
 
29
-- disable_query_log
 
30
 
 
31
use test;
 
32
 
 
33
# create system tables as in mysql-3.20
 
34
 
 
35
--disable_warnings
 
36
CREATE TABLE db (
 
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),
 
47
  KEY User (User)
 
48
)
 
49
engine=MyISAM;
 
50
--enable_warnings
 
51
 
 
52
INSERT INTO db VALUES ('%','test',   '','Y','Y','Y','Y','Y','Y');
 
53
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
 
54
 
 
55
--disable_warnings
 
56
CREATE TABLE host (
 
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)
 
66
)
 
67
engine=MyISAM;
 
68
--enable_warnings
 
69
 
 
70
--disable_warnings
 
71
CREATE TABLE user (
 
72
  Host char(60) binary DEFAULT '' NOT NULL,
 
73
  User char(16) binary DEFAULT '' NOT NULL,
 
74
  Password char(16),
 
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)
 
85
)
 
86
engine=MyISAM;
 
87
--enable_warnings
 
88
 
 
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');
 
91
 
 
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
 
94
-- enable_query_log
 
95
-- enable_result_log
 
96
 
 
97
-- source include/system_db_struct.inc
 
98
 
 
99
-- disable_query_log
 
100
 
 
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;
 
106
 
 
107
-- enable_query_log
 
108
 
 
109
# check that we dropped all system tables
 
110
show tables;
 
111
 
 
112
# End of 4.1 tests