mariadb/mysql-test/t/system_mysql_db_fix30020.test
unknown 6206af42fd WL #3031
* New result files due to new error message/error numbers
* Fixed system_mysql_db tests to work with servers table
* Added UTF8 charset to table defs


mysql-test/include/system_db_struct.inc:
  WL# 3031
  
  Added servers table to inc file used in system_mysql_db* tests
mysql-test/lib/init_db.sql:
  WL# 3031
  
  Added UTF charset to table def
mysql-test/r/mysql.result:
  WL# 3031
  
  New result files, new error messages shifted error #s up by two
mysql-test/r/rpl_sp.result:
  WL# 3031
  
  New result files, new error messages shifted error #s up by two
mysql-test/r/sp.result:
  WL# 3031
  
  New result files, new error messages shifted error #s up by two
mysql-test/r/sp_gis.result:
  WL# 3031
  
  New result files, new error messages shifted error #s up by two
mysql-test/r/system_mysql_db.result:
  WL #3031
  
  New system_mysql_db tests required adding servers table creation. Some more
  comments in these tests would have been nice to explain what they do ;)
mysql-test/t/system_mysql_db_fix30020.test:
  WL #3031
  
  New system_mysql_db tests required adding servers table creation. Some more
  comments in these tests would have been nice to explain what they do ;)
mysql-test/t/system_mysql_db_fix40123.test:
  WL #3031
  
  New system_mysql_db tests required adding servers table creation. Some more
  comments in these tests would have been nice to explain what they do ;)
mysql-test/t/system_mysql_db_fix50030.test:
  WL #3031
  
  New system_mysql_db tests required adding servers table creation. Some more
  comments in these tests would have been nice to explain what they do ;)
scripts/mysql_create_system_tables.sh:
  WL# 3031
  
  Added utf8 charset to table def
scripts/mysql_fix_privilege_tables.sql:
  WL# 3031
  
  Added servers table to mysql_fix_privilege_tables
2006-12-11 11:44:03 -05:00

108 lines
3.5 KiB
Text

# Embedded server doesn't support external clients
--source include/not_embedded.inc
# Windows doesn't support execution of shell scripts (to fix!!)
--source include/not_windows.inc
# check that CSV engine was compiled in, as the test relies on the presence
# of the log tables (which are CSV-based)
--source include/have_csv.inc
#
# This is the test for mysql_fix_privilege_tables
# It checks that a system tables from mysql 3.20
# can be upgraded to current system table format
#
# Note: If this test fails, don't be confused about the errors reported
# by mysql-test-run This shows warnings generated by
# 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
-- disable_result_log
-- disable_query_log
use test;
# create system tables as in mysql-3.20
--disable_warnings
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)
)
engine=MyISAM;
--enable_warnings
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
--disable_warnings
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)
)
engine=MyISAM;
--enable_warnings
--disable_warnings
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)
)
engine=MyISAM;
--enable_warnings
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');
# Call the "shell script" $MYSQL_FIX_SYSTEM_TABLES using system
-- system $MYSQL_FIX_SYSTEM_TABLES --database=test > $MYSQLTEST_VARDIR/log/system_mysql_db_fix30020.log 2>&1
-- enable_query_log
-- enable_result_log
-- source include/system_db_struct.inc
-- disable_query_log
DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv,
procs_priv, servers, 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, general_log, slow_log, event, ndb_binlog_index;
-- enable_query_log
# check that we dropped all system tables
show tables;
# End of 4.1 tests