From 9a27672396b660c8c89c30bafcfbb00849a06723 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Jun 2005 08:56:04 -0700 Subject: Fix spurious permissions problem when CONVERT_TZ() is used in a multi-table update query. (Bug #9979) mysql-test/r/timezone_grant.result: Add new results mysql-test/t/timezone_grant.test: Add new test sql/sql_parse.cc: Make sure to check lex->time_zone_tables_used to determine if we are using additional tables. --- mysql-test/r/timezone_grant.result | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/timezone_grant.result b/mysql-test/r/timezone_grant.result index 685f8007ac7..471cacde300 100644 --- a/mysql-test/r/timezone_grant.result +++ b/mysql-test/r/timezone_grant.result @@ -45,6 +45,13 @@ select * from mysql.time_zone_name; ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' +drop table t1, t2; +create table t1 (a int, b datetime); +create table t2 (a int, b varchar(40)); +update t1 set b = '2005-01-01 10:00'; +update t1 set b = convert_tz(b, 'UTC', 'UTC'); +update t1 join t2 on (t1.a = t2.a) set t1.b = '2005-01-01 10:00' where t2.b = 'foo'; +update t1 join t2 on (t1.a = t2.a) set t1.b = convert_tz('2005-01-01 10:00','UTC','UTC') where t2.b = 'foo'; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; -- cgit v1.2.1 From 607030266f83a3b81cddf40ca05245381600fdf4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Jul 2005 07:40:22 -0700 Subject: olap.result, olap.test: Added a test case for bug #11543. sql_select.cc: Fixed bug #11543. A ROLLUP query could return a wrong result set when its GROUP BY clause contained references to the same column. sql/sql_select.cc: Fixed bug #11543. A ROLLUP query could return a wrong result set when its GROUP BY clause contained references to the same column. mysql-test/t/olap.test: Added a test case for bug #11543. mysql-test/r/olap.result: Added a test case for bug #11543. --- mysql-test/r/olap.result | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 0c6c4684853..7178895cf80 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -504,3 +504,15 @@ IFNULL(a, 'TEST') COALESCE(b, 'TEST') 4 TEST TEST TEST DROP TABLE t1,t2; +CREATE TABLE t1 (a INT(10) NOT NULL, b INT(10) NOT NULL); +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (1, 2); +SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP; +a b c count +1 1 1 1 +1 1 NULL 1 +1 2 1 1 +1 2 NULL 1 +1 NULL NULL 2 +NULL NULL NULL 2 +DROP TABLE t1; -- cgit v1.2.1 From 7adfe96d9ebb3428550aeab79f08f5395d0ac44c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 16 Jul 2005 10:30:25 +0300 Subject: Added test for Bug #11521 "Negative integer keys incorrectly substituted for 0 during range analysis." The problem is that the range optimizer incorrectly replaces any negative constant with '0' for all types except BIGINT because the method save_in_field() casts negative integers to non-negative. This causes incorrect query results where (0 = any_negative_number). The problem caused by this bug is fixed by the patch for BUG#11185. That patch constitutes an optimization due to which the problem code is never called with negative constants. This patch adds a test so we are sure that the problem does not reappear. mysql-test/r/select.result: Test for BUG#11521. mysql-test/t/select.test: Test for BUG#11521. --- mysql-test/r/select.result | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 5c0616f9e54..6c9ec9d8297 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2570,3 +2570,15 @@ f2 1 NULL drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +explain select * from t2 where a > -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; -- cgit v1.2.1 From 6a88fa48ae2568aadf8513060a88c88b65c3f7cc Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 17 Jul 2005 09:46:14 -0700 Subject: select.result, select.test: Added a test case for bug #11745. sql_select.cc: Fixed bug # 11745. Added support of where clause for queries with FROM DUAL. sql_yacc.yy: Fixed bug # 11745. Added optional where clause for queries with FROM DUAL. sql/sql_yacc.yy: Fixed bug # 11745. Added optional where clause for queries with FROM DUAL. sql/sql_select.cc: Fixed bug # 11745. Added support of where clause for queries with FROM DUAL. mysql-test/t/select.test: Added a test case for bug #11745. mysql-test/r/select.result: Added a test case for bug #11745. --- mysql-test/r/select.result | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 6c9ec9d8297..2df60944999 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2582,3 +2582,19 @@ a 254 255 drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +DROP TABLE t1; -- cgit v1.2.1 From 750eedd9abdb22b64559b8a43b58679884d84e7c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 18 Jul 2005 14:46:53 +0200 Subject: Fix for BUG#12003 "assertion failure in testsuite (double lock of LOCK_thread_count)" and for BUG#12004 "SHOW BINARY LOGS reports 0 for the size of all binlogs but the current one". There are a lot of 4.1->5.0 unmerged changes (hardest are in the optimizer), can't merge; still pushing in 4.1 because my changes are very small. Feel free to ask me if you have problems merging them. mysql-test/r/rpl_log.result: correcting binlog sizes mysql-test/r/rpl_rotate_logs.result: correcting binlog sizes sql/mysqld.cc: don't lock LOCK_thread_count when you already have it sql/sql_repl.cc: my_open() needs the complete name, not only the base name --- mysql-test/r/rpl_log.result | 4 ++-- mysql-test/r/rpl_rotate_logs.result | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result index 7813d4d779d..9fcab2a7cbe 100644 --- a/mysql-test/r/rpl_log.result +++ b/mysql-test/r/rpl_log.result @@ -68,12 +68,12 @@ master-bin.000002 168 Query 1 168 use `test`; insert into t1 values (1) master-bin.000002 228 Query 1 228 use `test`; drop table t1 show binary logs; Log_name File_size -master-bin.000001 0 +master-bin.000001 1171 master-bin.000002 276 start slave; show binary logs; Log_name File_size -slave-bin.000001 0 +slave-bin.000001 1285 slave-bin.000002 170 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id Orig_log_pos Info diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 66eef482a63..9f74cdb9502 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -27,8 +27,8 @@ insert into t2 values (34),(67),(123); flush logs; show binary logs; Log_name File_size -master-bin.000001 0 -master-bin.000002 0 +master-bin.000001 461 +master-bin.000002 213 master-bin.000003 4 create table t3 select * from temp_table; select * from t3; @@ -43,12 +43,12 @@ start slave; purge master logs to 'master-bin.000002'; show master logs; Log_name File_size -master-bin.000002 0 +master-bin.000002 213 master-bin.000003 229 purge binary logs to 'master-bin.000002'; show binary logs; Log_name File_size -master-bin.000002 0 +master-bin.000002 213 master-bin.000003 229 purge master logs before now(); show binary logs; @@ -74,7 +74,7 @@ count(*) create table t4 select * from temp_table; show binary logs; Log_name File_size -master-bin.000003 0 +master-bin.000003 4167 master-bin.000004 2886 show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -- cgit v1.2.1