From dc68b6e0982f784970c8e295916827bd750e3b51 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 22 Feb 2004 00:19:36 +0100 Subject: ftb +(+(many -parens)) bug fixed --- mysql-test/t/fulltext.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 02657ba3775..774a3b42619 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -18,7 +18,6 @@ select * from t1 where MATCH(a,b) AGAINST ("collections"); select * from t1 where MATCH(a,b) AGAINST ("indexes"); select * from t1 where MATCH(a,b) AGAINST ("indexes collections"); - # add_ft_keys() tests explain select * from t1 where MATCH(a,b) AGAINST ("collections"); @@ -54,6 +53,9 @@ select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOL select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE); +select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE); +select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); + # boolean w/o index: select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE); -- cgit v1.2.1 From b7afc6838d3e4d94b67c36351497fa3508bd4382 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 22 Feb 2004 11:22:51 +0100 Subject: Complement to ChangeSet 1.1616.23.1 Fix for BUG#1858 "SQL-Thread stops working when using optimize table". A test for this. sql/sql_base.cc: In remove_table_from_cache(), kill only delayed threads. --- mysql-test/t/rpl_optimize.test | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 mysql-test/t/rpl_optimize.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_optimize.test b/mysql-test/t/rpl_optimize.test new file mode 100644 index 00000000000..9f02b715885 --- /dev/null +++ b/mysql-test/t/rpl_optimize.test @@ -0,0 +1,43 @@ +# Test for BUG#1858 "OPTIMIZE TABLE done by a client +# thread stops the slave SQL thread". +# You can replace OPTIMIZE by REPAIR. + +source include/master-slave.inc; + +create table t1 (a int not null auto_increment primary key, b int, key(b)); +INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +INSERT INTO t1 (a) SELECT null FROM t1; +save_master_pos; +# a few updates to force OPTIMIZE to do something +update t1 set b=(a/2*rand()); +delete from t1 order by b limit 10000; + +connection slave; +sync_with_master; +optimize table t1; +connection master; +save_master_pos; +connection slave; +# Bug was that when the INSERT terminated on slave, +# the slave SQL thread got killed by OPTIMIZE. +sync_with_master; # won't work if slave SQL thread stopped + +connection master; # cleanup +drop table t1; +connection slave; +sync_with_master; + +# If the machine is so fast that slave syncs before OPTIMIZE +# starts, this test wil demonstrate nothing but will pass. -- cgit v1.2.1 From b5b361f728b7e795e3fa5ae249895af80913f980 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Mar 2004 14:47:33 +0100 Subject: drop tables in windows-compatible order --- mysql-test/t/merge.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index b625e780f1f..76382a9cd99 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -202,7 +202,7 @@ insert into t4 values (1); insert into t5 values (2); create temporary table t6 (a int not null) TYPE=MERGE UNION=(t4,t5); select * from t6; -drop table if exists t1, t2, t3, t4, t5, t6; +drop table if exists t6, t5, t4, t3, t2, t1; # # testing merge::records_in_range and optimizer -- cgit v1.2.1 From 8ea9621c5ad6af7ed890475000c07cef3ce7accf Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Mar 2004 18:32:55 +0200 Subject: invalidation of locking for write tables (BUG#2693) fixed linking query_prealloc_size to query cache presence mysql-test/r/query_cache.result: test of QC invalidation by LOCK command mysql-test/t/query_cache.test: test of QC invalidation by LOCK command sql/mysqld.cc: new variable query_cache_wlock_invalidate fixed query_prealloc_size with QC absence sql/set_var.cc: new variable query_cache_wlock_invalidate sql/sql_cache.cc: new method for table invalidation sql/sql_cache.h: new method for table invalidation sql/sql_class.h: new variable query_cache_wlock_invalidate sql/sql_parse.cc: layout fixed --- mysql-test/t/query_cache.test | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index ad0dc80e2f7..8a07c0a53a0 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -504,6 +504,21 @@ select * from t3; enable_result_log; delete from t4 where a=1; flush query cache; - drop table t1,t2,t3,t4; + +# +# WRITE LOCK & QC +# +set query_cache_wlock_invalidate=1; +create table t1 (a int not null); +create table t2 (a int not null); +select * from t1; +select * from t2; +show status like "Qcache_queries_in_cache"; +lock table t1 write, t2 read; +show status like "Qcache_queries_in_cache"; +unlock table; +drop table t1,t2; +set query_cache_wlock_invalidate=default; + set GLOBAL query_cache_size=0; -- cgit v1.2.1 From a1daf829fb80dcded5ed3b7eb63752a704d0b634 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Mar 2004 22:11:33 +0400 Subject: fixed Bug #3051 "FLOOR returns invalid" mysql-test/r/func_math.result: added test for Bug #3051 "FLOOR returns invalid" mysql-test/t/func_math.test: added test for Bug #3051 "FLOOR returns invalid" --- mysql-test/t/func_math.test | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 42ba8c73f69..c39c966547b 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -24,3 +24,11 @@ SELECT ACOS(0.2*5.0); SELECT ACOS(0.5*2.0); SELECT ASIN(0.8+0.2); SELECT ASIN(1.2-0.2); + +# +# Bug #3051 FLOOR returns invalid +# + +select floor(log(4)/log(2)); +select floor(log(8)/log(2)); +select floor(log(16)/log(2)); -- cgit v1.2.1 From 997f11f270b123baa34060026905930c43ea40b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Mar 2004 22:13:33 +0400 Subject: fixed Bug #2985 "Table truncated when creating another table name with Spaces" added to check_db_name, check_table_name and check_column_name test for end space mysql-test/r/create.result: added test for Bug #2985 "Table truncated when creating another table name with Spaces" mysql-test/t/create.test: added test for Bug #2985 "Table truncated when creating another table name with Spaces" sql/sql_db.cc: cancel strip end spaces for database name sql/sql_parse.cc: cancel strip end spaces for database name sql/table.cc: added to check_db_name, check_table_name and check_column_name test for end space --- mysql-test/t/create.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 8aee586268f..94c2f24dffc 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -179,3 +179,15 @@ create table if not exists t1 select 3 as 'a',4 as 'b'; create table if not exists t1 select 3 as 'a',3 as 'b'; select * from t1; drop table t1; + +# +# Test for Bug #2985 +# "Table truncated when creating another table name with Spaces" +# + +--error 1103 +create table `t1 `(a int); +--error 1102 +create database `db1 `; +--error 1166; +create table t1(`a ` int); -- cgit v1.2.1 From 06768b8f6eec0338a6a8adab18b866c79e438789 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 6 Mar 2004 10:43:35 +0200 Subject: Ensure that one can't from the command line set a variable too small. (Bug #2710) Allow one to force lower_case_table_names to 0, even if the file system is case insensitive. This fixes some issues on Mac OS X (Bug #2994) Added variables "lower_case_file_system", "version_compile_os" and "license" mysql-test/t/lowercase_table3-master.opt: Rename: mysql-test/t/lowercase_table2-master.opt -> mysql-test/t/lowercase_table3-master.opt mysys/my_getopt.c: Ensure that one can't from the command line set a variable too small (could happen when sub_size was set) sql/mysql_priv.h: Added lower_case_file_system sql/mysqld.cc: Allow one to force lower_case_table_names to 0, even if the file system is case insensitive sql/set_var.cc: Added variable "lower_case_file_system" Added variable "version_compile_os" Added variable "license" sql/set_var.h: Added support for read only strings sql/sql_select.cc: Make join optimizer killable --- mysql-test/t/lowercase_table2-master.opt | 1 - mysql-test/t/lowercase_table3-master.opt | 1 + mysql-test/t/lowercase_table3.test | 37 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) delete mode 100644 mysql-test/t/lowercase_table2-master.opt create mode 100644 mysql-test/t/lowercase_table3-master.opt create mode 100644 mysql-test/t/lowercase_table3.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/lowercase_table2-master.opt b/mysql-test/t/lowercase_table2-master.opt deleted file mode 100644 index 9b27aef9bf8..00000000000 --- a/mysql-test/t/lowercase_table2-master.opt +++ /dev/null @@ -1 +0,0 @@ ---lower_case_table_names=0 diff --git a/mysql-test/t/lowercase_table3-master.opt b/mysql-test/t/lowercase_table3-master.opt new file mode 100644 index 00000000000..9b27aef9bf8 --- /dev/null +++ b/mysql-test/t/lowercase_table3-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=0 diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test new file mode 100644 index 00000000000..83ffaaad2d1 --- /dev/null +++ b/mysql-test/t/lowercase_table3.test @@ -0,0 +1,37 @@ +# +# Test of force of lower-case-table-names=0 +# (User has case insensitive file system and want's to preserve case of +# table names) +# + +--source include/have_innodb.inc +--require r/lowercase0.require +disable_query_log; +show variables like "lower_case_%"; +--require r/true.require +select @@version_compile_os NOT IN ("NT","WIN2000","Win95/Win98","XP") as "TRUE"; +enable_query_log; + +--disable_warnings +DROP TABLE IF EXISTS t1,T1; +--enable_warnings + +# +# This is actually an error, but ok as the user has forced this +# by using --lower-case-table-names=0 + +CREATE TABLE t1 (a int); +SELECT * from T1; +drop table t1; +flush tables; + +# +# InnoDB should in this case be case sensitive +# Note that this is not true on windows as no this OS, InnoDB is always +# storing things in lower case. +# + +CREATE TABLE t1 (a int) type=INNODB; +--error 1146 +SELECT * from T1; +drop table t1; -- cgit v1.2.1 From 98cd9f93e9d547f7bc46f35c0165b8d22eef972a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Mar 2004 13:46:11 +0200 Subject: Fixed memory leak in DROP DATABASE when using RAID tables (Bug #2882) BUILD/compile-pentium-debug-max: Added --with-raid configure.in: Removed -DFN_NO_CASE_SENCE for Mac OS X as this is not always true mysql-test/install_test_db.sh: Added --skip-warnings mysql-test/mysql-test-run.sh: Fixes to get --gdb and --ddd to work mysql-test/r/lowercase_table2.result: Test for lower_case_table_names=2 and temporary tables mysql-test/r/lowercase_table3.result: Fixed error message mysql-test/r/multi_update.result: Test of behaviour of multi-table-delete and alias mysql-test/t/lowercase_table2.test: Test for lower_case_table_names=2 and temporary tables mysql-test/t/lowercase_table3.test: Fixed error mysql-test/t/multi_update.test: Test of behaviour of multi-table-delete and alias (Bug #2940) mysys/mf_iocache.c: Renamed _flush_io_cache to my_b_flush_io_cache sql/ha_myisam.cc: Added comment sql/lock.cc: Extra debugging sql/log.cc: New parameter to flush_relay_log_info sql/log_event.cc: New parameter to flush_relay_log_info sql/mf_iocache.cc: Removed not used header files sql/mysqld.cc: More debugging info Less warnings when run with --skip-warnings sql/opt_range.cc: More debug information sql/repl_failsafe.cc: New parameter to flush_relay_log_info sql/slave.cc: First start SQL thread, then start IO thread. This fixed a raze condition in SLAVE START (Bug #2921) Ensure that we have a lock on the IO thread before flushing a relay log file that. The original code could core dump when a relay log rotated. sql/slave.h: New parameter to flush_relay_log_info sql/sql_base.cc: Added warning sql/sql_handler.cc: Indentation fix sql/sql_repl.cc: New parameter to flush_relay_log_info sql/sql_select.cc: Fixed problem with deleting temporary tables when using lower_case_table_names=2. (Bug #2858) sql/sql_table.cc: Fixed comment sql/sql_yacc.yy: Removed compiler warning include/my_sys.h: Fixed usage of unpack_filename mysys/mf_pack.c: Changed unpack_filename() to return length of result string. mysys/test_fn.c: Fixed usage of unpack_filename sql/sql_db.cc: Fixed memory leak with raid tables sql/table.cc: Fixed usage of unpack_filename --- mysql-test/t/lowercase_table2.test | 11 +++++++++++ mysql-test/t/lowercase_table3.test | 2 +- mysql-test/t/multi_update.test | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index 86bb26f0cf9..8f542a7af78 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -78,3 +78,14 @@ RENAME TABLE T2 TO T1; SHOW TABLES LIKE "T1"; SELECT * from T1; DROP TABLE T1; + +# +# Test problem with temporary tables (Bug #2858) +# + +create table T1 (EVENT_ID int auto_increment primary key, LOCATION char(20)); +insert into T1 values (NULL,"Mic-4"),(NULL,"Mic-5"),(NULL,"Mic-6"); +SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; +SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; +SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; +drop table T1; diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test index 83ffaaad2d1..735a0b390f9 100644 --- a/mysql-test/t/lowercase_table3.test +++ b/mysql-test/t/lowercase_table3.test @@ -32,6 +32,6 @@ flush tables; # CREATE TABLE t1 (a int) type=INNODB; ---error 1146 +--error 1016 SELECT * from T1; drop table t1; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index be82870cccd..283637912a1 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -302,3 +302,26 @@ delete t1, t2 from t2,t1 where t1.id1=t2.id2 and 0=1; drop table t1,t2; + +# +# Test alias (this is not correct in 4.0) +# + +CREATE TABLE t1 ( a int ); +CREATE TABLE t2 ( a int ); +DELETE t1 FROM t1, t2 AS t3; +--error 1066 +DELETE t4 FROM t1, t1 AS t4; +--error 1066 +DELETE t3 FROM t1 AS t3, t1 AS t4; +#--error 1066 +DELETE t1 FROM t1 AS t3, t2 AS t4; +INSERT INTO t1 values (1),(2); +INSERT INTO t2 values (1),(2); +DELETE t1 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=1; +SELECT * from t1; +SELECT * from t2; +DELETE t2 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=2; +SELECT * from t1; +SELECT * from t2; +DROP TABLE t1,t2; -- cgit v1.2.1 From 14b4be6a80b4cb75738f3ed64cda3f7746f63357 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Mar 2004 22:54:07 +0400 Subject: fixed BUG #2874 "Grant table bug" and added tests for testing structure of mysql db client/mysqltest.c: extend "replace" to column names extend "disable_result_log" to output of --exec commad mysql-test/install_test_db.sh: corrected wrong column definitions (as a result of tests) mysql-test/mysql-test-run.sh: export MYSQL and MYSQL_FIX_SYSTEM_TABLES + added option --result-file for *.opt files scripts/mysql_fix_privilege_tables.sh: added new options to using in tests + added new alters (as a result of new tests) scripts/mysql_fix_privilege_tables.sql: added new alters (as a result of new tests) scripts/mysql_install_db.sh: corrected definition of tables_priv.Table_name --- mysql-test/t/reserv/system_mysql_db.test | 8 ++ mysql-test/t/reserv/system_mysql_db_fix-master.opt | 1 + mysql-test/t/reserv/system_mysql_db_fix.test | 14 ++++ mysql-test/t/reserv/system_mysql_db_refs.test | 89 ++++++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 mysql-test/t/reserv/system_mysql_db.test create mode 100644 mysql-test/t/reserv/system_mysql_db_fix-master.opt create mode 100644 mysql-test/t/reserv/system_mysql_db_fix.test create mode 100644 mysql-test/t/reserv/system_mysql_db_refs.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/reserv/system_mysql_db.test b/mysql-test/t/reserv/system_mysql_db.test new file mode 100644 index 00000000000..85a2f7f9bae --- /dev/null +++ b/mysql-test/t/reserv/system_mysql_db.test @@ -0,0 +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 diff --git a/mysql-test/t/reserv/system_mysql_db_fix-master.opt b/mysql-test/t/reserv/system_mysql_db_fix-master.opt new file mode 100644 index 00000000000..69eb9d2cbf0 --- /dev/null +++ b/mysql-test/t/reserv/system_mysql_db_fix-master.opt @@ -0,0 +1 @@ +--result-file=system_mysql_db \ No newline at end of file diff --git a/mysql-test/t/reserv/system_mysql_db_fix.test b/mysql-test/t/reserv/system_mysql_db_fix.test new file mode 100644 index 00000000000..bb2d37ee215 --- /dev/null +++ b/mysql-test/t/reserv/system_mysql_db_fix.test @@ -0,0 +1,14 @@ +# +# This is the test for mysql_fix_privilege_tables +# + +-- disable_query_log +-- source include/create_old_system_tables.inc +-- exec $MYSQL_FIX_SYSTEM_TABLES --database=test > nil 2>nil +-- enable_query_log + +-- source include/system_db_struct.inc + +-- disable_query_log +-- source include/drop_system_tables.inc +-- enable_query_log diff --git a/mysql-test/t/reserv/system_mysql_db_refs.test b/mysql-test/t/reserv/system_mysql_db_refs.test new file mode 100644 index 00000000000..d15141fdaa5 --- /dev/null +++ b/mysql-test/t/reserv/system_mysql_db_refs.test @@ -0,0 +1,89 @@ +# +# 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; +insert into test_db (Host,Db,User) values (@name,@name,@name); + +create table test_host select * from mysql.host; +delete from test_host; +insert into test_host (Host,Db) values (@name,@name); + +create table test_user select * from mysql.user; +delete from test_user; +insert into test_user (Host,User) values (@name,@name); + +create table test_func select * from mysql.func; +delete from test_func; +insert into test_func (name) values (@name); + +create table test_tables_priv select * from mysql.tables_priv; +delete from test_tables_priv; +insert into test_tables_priv (Host,Db,User,Table_name) values (@name,@name,@name,@name); + +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); + +# '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: + +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; -- cgit v1.2.1 From 865685d5e7c2aa7718144fe200f122a10220765b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Mar 2004 17:38:19 +0100 Subject: Fix for BUG#2983 "If statement was killed on master, slave errors despite replicate-wild-ignore-t" We introduce a new function mysql_test_parse_for_slave(). If the slave sees that the query got a really bad error on master (killed e.g.), then it calls this function to know if this query can be ignored because of replicate-*-table rules (do not worry about replicate-*-db rules: they are checked so early that they have no bug). If the answer is yes, it skips the query and continues. If it's no, then it stops and say "fix your slave data manually" (like it did before this change). mysql-test/r/rpl_error_ignored_table.result: result update mysql-test/t/rpl_error_ignored_table-slave.opt: ignore more tables mysql-test/t/rpl_error_ignored_table.test: we test if a killed query on the master, is ignored on the slave if the tables it involves should be excluded because of replicate-*-table rules. sql/log_event.cc: If the query got a really bad error on the master (thread killed etc), parse it to test the table names: if the replicate-*-do|ignore-table rules say "this query must be ignored" then we exit gracefully; otherwise we warn about the bad error and tell DBA to check/fix it. Before this change, we always warned and stopped. sql/mysql_priv.h: new function sql/slave.cc: don't print error immediately as we need to do one more test to be sure. sql/sql_parse.cc: we add a function mysql_test_parse_for_slave(), to be used only by the slave if it wants to know if the query should be ignored or not; so this function only parses the query, does not execute it. --- mysql-test/t/rpl_error_ignored_table-slave.opt | 2 +- mysql-test/t/rpl_error_ignored_table.test | 30 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/rpl_error_ignored_table-slave.opt b/mysql-test/t/rpl_error_ignored_table-slave.opt index 0d3485f9e25..cb49119bfcb 100644 --- a/mysql-test/t/rpl_error_ignored_table-slave.opt +++ b/mysql-test/t/rpl_error_ignored_table-slave.opt @@ -1 +1 @@ ---replicate-ignore-table=test.t1 +--replicate-ignore-table=test.t1 --replicate-ignore-table=test.t2 --replicate-ignore-table=test.t3 diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test index 686472433eb..c308d430f74 100644 --- a/mysql-test/t/rpl_error_ignored_table.test +++ b/mysql-test/t/rpl_error_ignored_table.test @@ -23,3 +23,33 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# Now test that even critical errors (connection killed) +# are ignored if rules allow it. +# The "kill" idea was copied from rpl000001.test. + +connection master1; +select get_lock('crash_lock%20C', 10); + +connection master; +create table t2 (a int primary key); +insert into t2 values(1); +create table t3 (id int); +insert into t3 values(connection_id()); +send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10); + +connection master1; +sleep 2; +select (@id := id) - id from t3; +kill @id; +drop table t2,t3; +connection master; +--error 1053; +reap; +connection master1; +show binlog events from 79; +save_master_pos; +connection slave; +# SQL slave thread should not have stopped (because table of the killed +# query is in the ignore list). +sync_with_master; -- cgit v1.2.1 From e657a607be0634f808f844ba4724525b1631356f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Mar 2004 22:26:03 +0200 Subject: multi_update.result: Test case for a #2996 bug fix multi_update.test: test case for a #2996 bug fix sql_select.cc: Fix for a bug #2996 involving multi-table updates over the const tables sql/sql_select.cc: Fix for a bug #2996 involving multi-table updates over the const tables mysql-test/t/multi_update.test: test case for a #2996 bug fix mysql-test/r/multi_update.result: Test case for a #2996 bug fix --- mysql-test/t/multi_update.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 283637912a1..6ed340ad92b 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -325,3 +325,17 @@ DELETE t2 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=2; SELECT * from t1; SELECT * from t2; DROP TABLE t1,t2; + +# +# Test update with const tables +# + +create table `t1` ( `p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_created` datetime NOT NULL default '0000-00-00 00:00:00', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) ); +create table `t2` ( `c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_created` datetime NOT NULL default '0000-00-00 00:00:00', `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) ); +insert into t1 values (0,'A01-Comp',now(),1); +insert into t1 values (0,'B01-Comp',now(),1); +insert into t2 values (0,1,'A Note',now(),1); +update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; +select * from t1; +select * from t2; +drop table t1, t2; -- cgit v1.2.1 From 96d698adf8a5d03f7b7a4aaff61da8a9f46f202e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Mar 2004 09:15:08 +0200 Subject: Portability fixes & fixing of test suite mysql-test/r/func_math.result: Updated tests after merge with 3.23 mysql-test/r/multi_update.result: Fixed not portable test mysql-test/r/mysqlbinlog.result: Fixed test after push without doing 'make test' mysql-test/t/multi_update.test: Fixed not portable test sql/sql_parse.cc: Don't use static inline, as this is not portable --- mysql-test/t/multi_update.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 6ed340ad92b..39ea136bde1 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -330,11 +330,11 @@ DROP TABLE t1,t2; # Test update with const tables # -create table `t1` ( `p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_created` datetime NOT NULL default '0000-00-00 00:00:00', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) ); -create table `t2` ( `c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_created` datetime NOT NULL default '0000-00-00 00:00:00', `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) ); -insert into t1 values (0,'A01-Comp',now(),1); -insert into t1 values (0,'B01-Comp',now(),1); -insert into t2 values (0,1,'A Note',now(),1); +create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) ); +create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) ); +insert into t1 values (0,'A01-Comp',1); +insert into t1 values (0,'B01-Comp',1); +insert into t2 values (0,1,'A Note',1); update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; select * from t1; select * from t2; -- cgit v1.2.1 From fe544498fbe571bc15cb08108d70cdbe9f32ce8f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 13 Mar 2004 21:06:36 +0200 Subject: multi_update.result: Fix for a bug in the result multi_update.test: Fix for a bug in the test mysql-test/t/multi_update.test: Fix for a bug in the test mysql-test/r/multi_update.result: Fix for a bug in the result --- mysql-test/t/multi_update.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 6ed340ad92b..e4651df400f 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -332,9 +332,9 @@ DROP TABLE t1,t2; create table `t1` ( `p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_created` datetime NOT NULL default '0000-00-00 00:00:00', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) ); create table `t2` ( `c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_created` datetime NOT NULL default '0000-00-00 00:00:00', `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) ); -insert into t1 values (0,'A01-Comp',now(),1); -insert into t1 values (0,'B01-Comp',now(),1); -insert into t2 values (0,1,'A Note',now(),1); +insert into t1 values (0,'A01-Comp',"2004-01-05 12:12:12",1); +insert into t1 values (0,'B01-Comp',"2004-01-05 12:12:13",1); +insert into t2 values (0,1,'A Note',"2004-01-05 12:12:14",1); update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; select * from t1; select * from t2; -- cgit v1.2.1 From 5a9910e228bbe380a25aeda7bebea5063c12d648 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Mar 2004 02:59:39 +0200 Subject: Remove not needed patch --- mysql-test/t/multi_update.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index e4651df400f..39ea136bde1 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -330,11 +330,11 @@ DROP TABLE t1,t2; # Test update with const tables # -create table `t1` ( `p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_created` datetime NOT NULL default '0000-00-00 00:00:00', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) ); -create table `t2` ( `c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_created` datetime NOT NULL default '0000-00-00 00:00:00', `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) ); -insert into t1 values (0,'A01-Comp',"2004-01-05 12:12:12",1); -insert into t1 values (0,'B01-Comp',"2004-01-05 12:12:13",1); -insert into t2 values (0,1,'A Note',"2004-01-05 12:12:14",1); +create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) ); +create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) ); +insert into t1 values (0,'A01-Comp',1); +insert into t1 values (0,'B01-Comp',1); +insert into t2 values (0,1,'A Note',1); update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; select * from t1; select * from t2; -- cgit v1.2.1