2005-03-30 03:17:46 +02:00
|
|
|
# Embedded server doesn't support external clients
|
|
|
|
--source include/not_embedded.inc
|
|
|
|
|
2006-09-01 14:34:37 +02:00
|
|
|
# Windows doesn't support execution of shell scripts (to fix!!)
|
|
|
|
--source include/not_windows.inc
|
|
|
|
|
2004-06-28 12:53:49 +02:00
|
|
|
#
|
2004-03-17 18:01:07 +01:00
|
|
|
# This is the test for mysql_fix_privilege_tables
|
2006-11-21 15:31:11 +01:00
|
|
|
# It checks that a system tables from mysql 3.20
|
|
|
|
# can be upgraded to current system table format
|
2004-06-28 12:53:49 +02:00
|
|
|
#
|
2005-01-04 12:46:53 +01:00
|
|
|
# Note: If this test fails, don't be confused about the errors reported
|
2006-11-21 15:31:11 +01:00
|
|
|
# by mysql-test-run This shows warnings generated by
|
2005-01-04 12:46:53 +01:00
|
|
|
# mysql_fix_system_tables which should be ignored.
|
|
|
|
# Instead, concentrate on the errors in r/system_mysql_db.reject
|
|
|
|
|
|
|
|
--disable_warnings
|
|
|
|
drop table if exists t1,t1aa,t2aa;
|
|
|
|
--enable_warnings
|
2004-03-17 18:01:07 +01:00
|
|
|
|
2004-06-28 12:53:49 +02:00
|
|
|
-- disable_result_log
|
|
|
|
-- disable_query_log
|
2004-03-19 13:52:48 +01:00
|
|
|
|
2004-06-28 12:53:49 +02:00
|
|
|
use test;
|
2004-03-19 13:52:48 +01:00
|
|
|
|
2004-06-28 12:53:49 +02:00
|
|
|
# create system tables as in mysql-3.20
|
2004-03-19 13:52:48 +01:00
|
|
|
|
2004-12-08 00:17:52 +01:00
|
|
|
--disable_warnings
|
2004-06-28 12:53:49 +02:00
|
|
|
CREATE TABLE db (
|
|
|
|
Host char(60) binary DEFAULT '' NOT NULL,
|
|
|
|
Db char(32) binary DEFAULT '' NOT NULL,
|
|
|
|
User char(16) binary DEFAULT '' NOT NULL,
|
|
|
|
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
PRIMARY KEY Host (Host,Db,User),
|
|
|
|
KEY User (User)
|
|
|
|
)
|
|
|
|
type=ISAM;
|
2006-10-07 20:16:57 +02:00
|
|
|
--enable_warnings
|
2004-06-28 12:53:49 +02:00
|
|
|
|
|
|
|
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
|
|
|
|
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
|
|
|
|
|
2004-12-08 00:17:52 +01:00
|
|
|
--disable_warnings
|
2004-06-28 12:53:49 +02:00
|
|
|
CREATE TABLE host (
|
|
|
|
Host char(60) binary DEFAULT '' NOT NULL,
|
|
|
|
Db char(32) binary DEFAULT '' NOT NULL,
|
|
|
|
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
PRIMARY KEY Host (Host,Db)
|
|
|
|
)
|
|
|
|
type=ISAM;
|
2006-10-07 20:16:57 +02:00
|
|
|
--enable_warnings
|
2004-06-28 12:53:49 +02:00
|
|
|
|
2004-12-08 00:17:52 +01:00
|
|
|
--disable_warnings
|
2004-06-28 12:53:49 +02:00
|
|
|
CREATE TABLE user (
|
|
|
|
Host char(60) binary DEFAULT '' NOT NULL,
|
|
|
|
User char(16) binary DEFAULT '' NOT NULL,
|
|
|
|
Password char(16),
|
|
|
|
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
|
|
|
PRIMARY KEY Host (Host,User)
|
|
|
|
)
|
|
|
|
type=ISAM;
|
2006-10-07 20:16:57 +02:00
|
|
|
--enable_warnings
|
2004-06-28 12:53:49 +02:00
|
|
|
|
|
|
|
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
|
|
|
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
|
2004-03-19 13:52:48 +01:00
|
|
|
|
2006-02-17 12:07:45 +01:00
|
|
|
# Call the "shell script" $MYSQL_FIX_SYSTEM_TABLES using system
|
2006-11-21 15:31:11 +01:00
|
|
|
-- system $MYSQL_FIX_SYSTEM_TABLES --database=test > $MYSQLTEST_VARDIR/log/system_mysql_db_fix30020.log 2>&1
|
2004-06-28 12:53:49 +02:00
|
|
|
-- enable_query_log
|
|
|
|
-- enable_result_log
|
|
|
|
|
|
|
|
-- source include/system_db_struct.inc
|
|
|
|
|
|
|
|
-- disable_query_log
|
|
|
|
|
2004-12-23 11:46:24 +01:00
|
|
|
DROP TABLE db, host, user, func, tables_priv, columns_priv, procs_priv, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type;
|
2004-06-25 11:33:03 +02:00
|
|
|
|
2004-06-28 12:53:49 +02:00
|
|
|
-- enable_query_log
|
2004-07-15 13:17:30 +02:00
|
|
|
|
2005-08-30 21:24:37 +02:00
|
|
|
# check that we dropped all system tables
|
2004-07-15 13:17:30 +02:00
|
|
|
show tables;
|
2005-07-28 02:22:47 +02:00
|
|
|
|
|
|
|
# End of 4.1 tests
|