~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/system_mysql_db_fix30020.test

  • Committer: Monty Taylor
  • Date: 2008-10-20 08:48:34 UTC
  • mfrom: (520.1.22 drizzle)
  • Revision ID: monty@inaugust.com-20081020084834-xpb3w01vkcp55o02
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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`)
4
 
{
5
 
  skip Test need DRIZZLE_FIX_SYSTEM_TABLES;
6
 
}
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
10
 
 
11
 
#
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
15
 
#
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
20
 
 
21
 
--disable_warnings
22
 
drop table if exists t1,t1aa,t2aa;
23
 
--enable_warnings
24
 
 
25
 
 
26
 
use test;
27
 
 
28
 
# create system tables as in mysql-3.20
29
 
 
30
 
--disable_warnings
31
 
CREATE TABLE db (
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),
42
 
  KEY User (User)
43
 
)
44
 
engine=MyISAM;
45
 
--enable_warnings
46
 
 
47
 
INSERT INTO db VALUES ('%','test',   '','Y','Y','Y','Y','Y','Y');
48
 
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
49
 
 
50
 
--disable_warnings
51
 
CREATE TABLE host (
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)
61
 
)
62
 
engine=MyISAM;
63
 
--enable_warnings
64
 
 
65
 
--disable_warnings
66
 
CREATE TABLE user (
67
 
  Host char(60) binary DEFAULT '' NOT NULL,
68
 
  User char(16) binary DEFAULT '' NOT NULL,
69
 
  Password char(16),
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)
80
 
)
81
 
engine=MyISAM;
82
 
--enable_warnings
83
 
 
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');
86
 
 
87
 
# Call the "shell script" $DRIZZLE_FIX_SYSTEM_TABLES using system
88
 
 
89
 
 
90
 
 
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;
96
 
 
97
 
 
98
 
# check that we dropped all system tables
99
 
show tables;
100
 
 
101
 
# End of 4.1 tests