List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:June 17 2005 5:56pm
Subject:bk commit into 4.1 tree (jimw:1.2287) BUG#9979
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2287 05/06/17 08:56:04 jimw@stripped +3 -0
  Fix spurious permissions problem when CONVERT_TZ() is used
  in a multi-table update query. (Bug #9979)

  sql/sql_parse.cc
    1.441 05/06/17 08:56:01 jimw@stripped +3 -2
    Make sure to check lex->time_zone_tables_used to determine if
    we are using additional tables.

  mysql-test/t/timezone_grant.test
    1.2 05/06/17 08:56:01 jimw@stripped +12 -0
    Add new test

  mysql-test/r/timezone_grant.result
    1.2 05/06/17 08:56:01 jimw@stripped +7 -0
    Add new results

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-4.1-9979

--- 1.440/sql/sql_parse.cc	2005-06-03 22:28:18 -07:00
+++ 1.441/sql/sql_parse.cc	2005-06-17 08:56:01 -07:00
@@ -1938,7 +1938,8 @@
     that is not a SHOW command or a select that only access local
     variables, but for now this is probably good enough.
   */
-  if (tables || &lex->select_lex != lex->all_selects_list)
+  if (tables || &lex->select_lex != lex->all_selects_list ||
+      lex->time_zone_tables_used)
     mysql_reset_errors(thd);
 
 #ifdef HAVE_REPLICATION
@@ -5354,7 +5355,7 @@
   /*
     Is there tables of subqueries?
   */
-  if (&lex->select_lex != lex->all_selects_list)
+  if (&lex->select_lex != lex->all_selects_list ||
lex->time_zone_tables_used)
   {
     DBUG_PRINT("info",("Checking sub query list"));
     for (table= tables; table; table= table->next)

--- 1.1/mysql-test/r/timezone_grant.result	2005-03-29 17:17:44 -08:00
+++ 1.2/mysql-test/r/timezone_grant.result	2005-06-17 08:56:01 -07:00
@@ -45,6 +45,13 @@
 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\_%';

--- 1.1/mysql-test/t/timezone_grant.test	2005-03-29 17:17:44 -08:00
+++ 1.2/mysql-test/t/timezone_grant.test	2005-06-17 08:56:01 -07:00
@@ -61,6 +61,18 @@
 --error 1142
 select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name;
 
+#
+# Bug #9979: Use of CONVERT_TZ in multiple-table UPDATE causes bogus
+# privilege error
+#
+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';
+
 # Clean-up
 connection default;
 delete from mysql.user where user like 'mysqltest\_%';
Thread
bk commit into 4.1 tree (jimw:1.2287) BUG#9979Jim Winstead17 Jun