diff options
author | unknown <monty@mysql.com> | 2004-07-09 02:29:28 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-07-09 02:29:28 +0300 |
commit | 53ca595451d53fccd60b1112c444e5278021c1ee (patch) | |
tree | d39c3dfa90aad2f93012b09513ff0ba42c1aa0cb /mysql-test | |
parent | 661b8165eced19f1943aeee1b166ff10191ab037 (diff) | |
parent | ee9890162e2a2b44f8b09c14b0a22ba9d086df95 (diff) | |
download | mariadb-git-53ca595451d53fccd60b1112c444e5278021c1ee.tar.gz |
Merge with 4.0 to get bug fixes
Build-tools/Bootstrap:
Auto merged
Build-tools/Do-compile:
Auto merged
mysql-test/r/lowercase_table2.result:
Auto merged
mysql-test/r/system_mysql_db.result:
Auto merged
mysql-test/r/system_mysql_db_refs.result:
Auto merged
mysql-test/t/system_mysql_db_fix-master.opt:
Auto merged
mysql-test/t/system_mysql_db.test:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/system_mysql_db_refs.result | 56 | ||||
-rw-r--r-- | mysql-test/t/system_mysql_db.test | 16 | ||||
-rw-r--r-- | mysql-test/t/system_mysql_db_fix.test | 141 | ||||
-rw-r--r-- | mysql-test/t/system_mysql_db_refs.test | 173 |
4 files changed, 192 insertions, 194 deletions
diff --git a/mysql-test/r/system_mysql_db_refs.result b/mysql-test/r/system_mysql_db_refs.result index e15934b03ac..ac072505bc9 100644 --- a/mysql-test/r/system_mysql_db_refs.result +++ b/mysql-test/r/system_mysql_db_refs.result @@ -18,44 +18,44 @@ create table test_columns_priv select * from mysql.columns_priv; delete from test_columns_priv; insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name); select -if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
-if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
-if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
-if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
-if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
-from test_db
-left join test_host on test_db.Host=test_host.Host
-left join test_user on test_db.Host=test_user.Host
-left join test_tables_priv on test_db.Host=test_tables_priv.Host
+if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host, +if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host, +if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host, +if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host, +if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host +from test_db +left join test_host on test_db.Host=test_host.Host +left join test_user on test_db.Host=test_user.Host +left join test_tables_priv on test_db.Host=test_tables_priv.Host left join test_columns_priv on test_db.Host=test_columns_priv.Host; test_db_Host test_host_Host test_user_Host test_tables_priv_Host test_columns_priv_Host ok ok ok ok ok select -if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
-if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
-if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
-if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
-from test_db
-left join test_host on test_db.Db=test_host.Db
-left join test_tables_priv on test_db.Db=test_tables_priv.Db
+if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db, +if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db, +if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db, +if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db +from test_db +left join test_host on test_db.Db=test_host.Db +left join test_tables_priv on test_db.Db=test_tables_priv.Db left join test_columns_priv on test_db.Db=test_columns_priv.Db; test_db_Db test_host_Db test_tables_priv_Db est_columns_priv_Db ok ok ok ok -select
-if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
-if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
-if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
-if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
-from test_db
-left join test_user on test_db.User=test_user.User
-left join test_tables_priv on test_db.User=test_tables_priv.User
+select +if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User, +if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User, +if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User, +if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User +from test_db +left join test_user on test_db.User=test_user.User +left join test_tables_priv on test_db.User=test_tables_priv.User left join test_columns_priv on test_db.User=test_columns_priv.User; test_db_User test_user_User test_tables_priv_User test_columns_priv_User ok ok ok ok -select
-if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
-if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
-from test_tables_priv
+select +if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User, +if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User +from test_tables_priv left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name; test_tables_priv_User test_columns_priv_User ok ok diff --git a/mysql-test/t/system_mysql_db.test b/mysql-test/t/system_mysql_db.test index bd69297b739..85a2f7f9bae 100644 --- a/mysql-test/t/system_mysql_db.test +++ b/mysql-test/t/system_mysql_db.test @@ -1,8 +1,8 @@ -#
-# This test must examine integrity of system database "mysql"
-#
-
--- disable_query_log
-use mysql;
--- enable_query_log
--- source include/system_db_struct.inc
+# +# This test must examine integrity of system database "mysql" +# + +-- disable_query_log +use mysql; +-- enable_query_log +-- source include/system_db_struct.inc diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test index a81772c74e4..13c83fc9012 100644 --- a/mysql-test/t/system_mysql_db_fix.test +++ b/mysql-test/t/system_mysql_db_fix.test @@ -1,83 +1,82 @@ -#
+# # This is the test for mysql_fix_privilege_tables -#
+# --- disable_result_log
--- disable_query_log
-
-use test;
-
-# create system tables as in mysql-3.20
-
-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;
+-- disable_result_log +-- disable_query_log -INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
-INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
+use test; -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;
+# create system tables as in mysql-3.20 -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;
+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; + +INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y'); + +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; + +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; + +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'); -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');
-
-- exec $MYSQL_FIX_SYSTEM_TABLES --database=test --- enable_query_log
--- enable_result_log
-
--- source include/system_db_struct.inc
-
--- disable_query_log
-
-DROP TABLE db;
-DROP TABLE host;
-DROP TABLE user;
-DROP TABLE func;
-DROP TABLE tables_priv;
-DROP TABLE columns_priv;
+-- enable_query_log +-- enable_result_log + +-- source include/system_db_struct.inc + +-- disable_query_log + +DROP TABLE db; +DROP TABLE host; +DROP TABLE user; +DROP TABLE func; +DROP TABLE tables_priv; +DROP TABLE columns_priv; DROP TABLE help_category; DROP TABLE help_keyword; DROP TABLE help_relation; DROP TABLE help_topic; -
--- enable_query_log
+-- enable_query_log diff --git a/mysql-test/t/system_mysql_db_refs.test b/mysql-test/t/system_mysql_db_refs.test index 4c6557ba5c7..9e2c5a20b54 100644 --- a/mysql-test/t/system_mysql_db_refs.test +++ b/mysql-test/t/system_mysql_db_refs.test @@ -1,102 +1,101 @@ -#
-# This test must examine integrity of current system database
-#
-
-set @name="This is a very long string, that mustn't find room in a system field like Table_name. Thus it should be cut by the actual size of the field. So we can use this string to find out the actual length of the field and to use it in any compare queries";
-
-#
-# If this part is wrong, most likely you've done wrong modification of system database "mysql"
-#
-
-create table test_db select * from mysql.db;
-delete from test_db;
+# +# This test must examine integrity of current system database +# + +set @name="This is a very long string, that mustn't find room in a system field like Table_name. Thus it should be cut by the actual size of the field. So we can use this string to find out the actual length of the field and to use it in any compare queries"; + +# +# If this part is wrong, most likely you've done wrong modification of system database "mysql" +# + +create table test_db select * from mysql.db; +delete from test_db; --disable_warnings -insert into test_db (Host,Db,User) values (@name,@name,@name);
+insert into test_db (Host,Db,User) values (@name,@name,@name); --enable_warnings -
-create table test_host select * from mysql.host;
-delete from test_host;
+ +create table test_host select * from mysql.host; +delete from test_host; --disable_warnings -insert into test_host (Host,Db) values (@name,@name);
+insert into test_host (Host,Db) values (@name,@name); --enable_warnings -
-create table test_user select * from mysql.user;
-delete from test_user;
+ +create table test_user select * from mysql.user; +delete from test_user; --disable_warnings -insert into test_user (Host,User) values (@name,@name);
+insert into test_user (Host,User) values (@name,@name); --enable_warnings -
-create table test_func select * from mysql.func;
-delete from test_func;
+ +create table test_func select * from mysql.func; +delete from test_func; --disable_warnings -insert into test_func (name) values (@name);
+insert into test_func (name) values (@name); --enable_warnings -
-create table test_tables_priv select * from mysql.tables_priv;
-delete from test_tables_priv;
+ +create table test_tables_priv select * from mysql.tables_priv; +delete from test_tables_priv; --disable_warnings -insert into test_tables_priv (Host,Db,User,Table_name) values (@name,@name,@name,@name);
+insert into test_tables_priv (Host,Db,User,Table_name) values (@name,@name,@name,@name); --enable_warnings -
-create table test_columns_priv select * from mysql.columns_priv;
-delete from test_columns_priv;
+ +create table test_columns_priv select * from mysql.columns_priv; +delete from test_columns_priv; --disable_warnings -insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name);
+insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name); --enable_warnings -
-# 'Host' field must be the same for all the tables:
-
+ +# 'Host' field must be the same for all the tables: + select - if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
- if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
- if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
- if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
- if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
- -from test_db
-left join test_host on test_db.Host=test_host.Host
-left join test_user on test_db.Host=test_user.Host
-left join test_tables_priv on test_db.Host=test_tables_priv.Host
-left join test_columns_priv on test_db.Host=test_columns_priv.Host;
-
-# 'Db' field must be the same for all the tables:
-
+ if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host, + if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host, + if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host, + if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host, + if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host + +from test_db +left join test_host on test_db.Host=test_host.Host +left join test_user on test_db.Host=test_user.Host +left join test_tables_priv on test_db.Host=test_tables_priv.Host +left join test_columns_priv on test_db.Host=test_columns_priv.Host; + +# 'Db' field must be the same for all the tables: + +select + if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db, + if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db, + if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db, + if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db + +from test_db +left join test_host on test_db.Db=test_host.Db +left join test_tables_priv on test_db.Db=test_tables_priv.Db +left join test_columns_priv on test_db.Db=test_columns_priv.Db; + +# 'User' field must be the same for all the tables: + +select + if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User, + if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User, + if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User, + if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User + +from test_db +left join test_user on test_db.User=test_user.User +left join test_tables_priv on test_db.User=test_tables_priv.User +left join test_columns_priv on test_db.User=test_columns_priv.User; + +# 'Table_name' field must be the same for all the tables: + select - if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
- if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
- if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
- if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
- -from test_db
-left join test_host on test_db.Db=test_host.Db
-left join test_tables_priv on test_db.Db=test_tables_priv.Db
-left join test_columns_priv on test_db.Db=test_columns_priv.Db;
-
-# 'User' field must be the same for all the tables:
-
-select
- if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
- if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
- if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
- if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
- -from test_db
-left join test_user on test_db.User=test_user.User
-left join test_tables_priv on test_db.User=test_tables_priv.User
-left join test_columns_priv on test_db.User=test_columns_priv.User;
-
-# 'Table_name' field must be the same for all the tables:
-
-select
- if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
- if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
-from test_tables_priv
-left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name;
-
-drop table test_columns_priv;
-drop table test_tables_priv;
-drop table test_func;
-drop table test_host;
-drop table test_user;
-drop table test_db;
+ if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User, + if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User +from test_tables_priv +left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name; +drop table test_columns_priv; +drop table test_tables_priv; +drop table test_func; +drop table test_host; +drop table test_user; +drop table test_db; |