List:Commits« Previous MessageNext Message »
From:antony Date:July 6 2006 2:26am
Subject:bk commit into 5.0 tree (acurtis:1.2212)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of antony. When antony 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.2212 06/07/05 17:26:16 acurtis@stripped +10 -0
  Merge xiphis.org:/home/antony/work2/mysql-5.0-engines
  into  xiphis.org:/home/antony/work2/p2-bug8706.3-merge-5.0

  sql/sql_parse.cc
    1.558 06/07/05 17:26:11 acurtis@stripped +0 -0
    Auto merged

  sql/item_timefunc.cc
    1.116 06/07/05 17:26:11 acurtis@stripped +0 -0
    Auto merged

  mysql-test/t/func_time.test
    1.48 06/07/05 17:26:11 acurtis@stripped +0 -0
    Auto merged

  mysql-test/t/func_sapdb.test
    1.12 06/07/05 17:26:10 acurtis@stripped +0 -0
    Auto merged

  mysql-test/t/federated.test
    1.28 06/07/05 17:26:10 acurtis@stripped +0 -0
    Auto merged

  mysql-test/r/symlink.result
    1.25 06/07/05 17:26:10 acurtis@stripped +0 -0
    Auto merged

  mysql-test/r/func_time.result
    1.60 06/07/05 17:26:10 acurtis@stripped +0 -0
    Auto merged

  mysql-test/r/func_sapdb.result
    1.17 06/07/05 17:26:10 acurtis@stripped +0 -0
    Auto merged

  mysql-test/r/federated.result
    1.32 06/07/05 17:26:10 acurtis@stripped +0 -0
    Auto merged

  configure.in
    1.399 06/07/05 17:26:10 acurtis@stripped +0 -0
    Auto merged

# 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:	acurtis
# Host:	ltantony.xiphis.org
# Root:	/home/antony/work2/p2-bug8706.3-merge-5.0/RESYNC

--- 1.398/configure.in	2006-06-29 07:52:58 -07:00
+++ 1.399/configure.in	2006-07-05 17:26:10 -07:00
@@ -382,18 +382,18 @@ fi
 AC_SUBST(LD_VERSION_SCRIPT)
 
 # Avoid bug in fcntl on some versions of linux
-AC_MSG_CHECKING("if we should use 'skip-locking' as default for $target_os")
+AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
 # Any variation of Linux
 if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
 then
-  MYSQLD_DEFAULT_SWITCHES="--skip-locking"
+  MYSQLD_DEFAULT_SWITCHES="--skip-external-locking"
   TARGET_LINUX="true"
-  AC_MSG_RESULT("yes")
+  AC_MSG_RESULT([yes])
   AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
 else
   MYSQLD_DEFAULT_SWITCHES=""
   TARGET_LINUX="false"
-  AC_MSG_RESULT("no")
+  AC_MSG_RESULT([no])
 fi
 AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
 AC_SUBST(TARGET_LINUX)

--- 1.557/sql/sql_parse.cc	2006-06-29 01:21:53 -07:00
+++ 1.558/sql/sql_parse.cc	2006-07-05 17:26:11 -07:00
@@ -2365,7 +2365,7 @@ static void reset_one_shot_variables(THD
 
 
 /*
-  Execute command saved in thd and current_lex->sql_command
+  Execute command saved in thd and lex->sql_command
 
   SYNOPSIS
     mysql_execute_command()
@@ -3893,11 +3893,13 @@ end_with_restore_list:
 
     if (thd->security_ctx->user)              // If not replication
     {
-      LEX_USER *user;
+      LEX_USER *user, *tmp_user;
 
       List_iterator <LEX_USER> user_list(lex->users_list);
-      while ((user= user_list++))
+      while ((tmp_user= user_list++))
       {
+        if (!(user= get_current_user(thd, tmp_user)))
+          goto error;
         if (specialflag & SPECIAL_NO_RESOLVE &&
             hostname_requires_resolving(user->host.str))
           push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -3979,9 +3981,13 @@ end_with_restore_list:
 	if (lex->sql_command == SQLCOM_GRANT)
 	{
 	  List_iterator <LEX_USER> str_list(lex->users_list);
-	  LEX_USER *user;
-	  while ((user=str_list++))
+	  LEX_USER *user, *tmp_user;
+	  while ((tmp_user=str_list++))
+          {
+            if (!(user= get_current_user(thd, tmp_user)))
+              goto error;
 	    reset_mqh(user);
+          }
 	}
       }
     }
@@ -4036,13 +4042,18 @@ end_with_restore_list:
   }
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
   case SQLCOM_SHOW_GRANTS:
+  {
+    LEX_USER *grant_user= get_current_user(thd, lex->grant_user);
+    if (!grant_user)
+      goto error;
     if ((thd->security_ctx->priv_user &&
-	 !strcmp(thd->security_ctx->priv_user, lex->grant_user->user.str)) ||
+	 !strcmp(thd->security_ctx->priv_user, grant_user->user.str)) ||
 	!check_access(thd, SELECT_ACL, "mysql",0,1,0,0))
     {
-      res = mysql_show_grants(thd,lex->grant_user);
+      res = mysql_show_grants(thd, grant_user);
     }
     break;
+  }
 #endif
   case SQLCOM_HA_OPEN:
     DBUG_ASSERT(first_table == all_tables && first_table != 0);
@@ -5547,7 +5558,7 @@ bool check_stack_overrun(THD *thd, long 
 
 bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize)
 {
-  LEX	*lex=current_lex;
+  LEX	*lex= current_thd->lex;
   ulong old_info=0;
   if ((uint) *yystacksize >= MY_YACC_MAX)
     return 1;
@@ -5984,7 +5995,7 @@ bool add_field_to_list(THD *thd, char *f
 
 void store_position_for_column(const char *name)
 {
-  current_lex->last_field->after=my_const_cast(char*) (name);
+  current_thd->lex->last_field->after=my_const_cast(char*) (name);
 }
 
 bool
@@ -7500,4 +7511,35 @@ LEX_USER *create_definer(THD *thd, LEX_S
   definer->host= *host_name;
 
   return definer;
+}
+
+
+/*
+  Retuns information about user or current user.
+
+  SYNOPSIS
+    get_current_user()
+    thd         [in] thread handler
+    user        [in] user
+
+  RETURN
+    On success, return a valid pointer to initialized
+    LEX_USER, which contains user information.
+    On error, return 0.
+*/
+
+LEX_USER *get_current_user(THD *thd, LEX_USER *user)
+{
+  LEX_USER *curr_user;
+  if (!user->user.str)  // current_user
+  {
+    if (!(curr_user= (LEX_USER*) thd->alloc(sizeof(LEX_USER))))
+    {
+      my_error(ER_OUTOFMEMORY, MYF(0), sizeof(LEX_USER));
+      return 0;
+    }
+    get_default_definer(thd, curr_user);
+    return curr_user;
+  }
+  return user;
 }

--- 1.47/mysql-test/t/func_time.test	2006-06-29 01:26:19 -07:00
+++ 1.48/mysql-test/t/func_time.test	2006-07-05 17:26:11 -07:00
@@ -143,10 +143,6 @@ select extract(SECOND FROM "1999-01-02 1
 select extract(MONTH FROM "2001-02-00");
 
 #
-# MySQL Bugs: #12356: DATE_SUB or DATE_ADD incorrectly returns null
-#
-SELECT DATE_SUB(str_to_date('9999-12-31 00:01:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1
MINUTE);
-SELECT DATE_ADD(str_to_date('9999-12-30 23:59:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1
MINUTE);
 # test EXTRACT QUARTER (Bug #18100)
 #
 
@@ -162,7 +158,11 @@ SELECT EXTRACT(QUARTER FROM '2004-09-15'
 SELECT EXTRACT(QUARTER FROM '2004-10-15') AS quarter;
 SELECT EXTRACT(QUARTER FROM '2004-11-15') AS quarter;
 SELECT EXTRACT(QUARTER FROM '2004-12-15') AS quarter;
-
+#
+# MySQL Bugs: #12356: DATE_SUB or DATE_ADD incorrectly returns null
+#
+SELECT DATE_SUB(str_to_date('9999-12-31 00:01:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1
MINUTE);
+SELECT DATE_ADD(str_to_date('9999-12-30 23:59:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1
MINUTE);
 
 #
 # Test big intervals (Bug #3498)
Thread
bk commit into 5.0 tree (acurtis:1.2212)antony6 Jul