List:Commits« Previous MessageNext Message »
From:pem Date:March 3 2006 12:03pm
Subject:bk commit into 5.1 tree (pem:1.2214)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of pem. When pem 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.2214 06/03/03 12:03:27 pem@stripped +15 -0
  Merge mysql.com:/extern/mysql/5.0/bug17476/mysql-5.0
  into  mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new

  sql/table.cc
    1.211 06/03/03 12:03:23 pem@stripped +4 -6
    Manual merge.

  configure.in
    1.346 06/03/03 12:03:23 pem@stripped +0 -2
    Manual merge.

  VC++Files/mysql.sln
    1.16 06/03/03 12:03:23 pem@stripped +0 -121
    Manual merge (use local).

  sql/sql_udf.cc
    1.61 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  sql/item_timefunc.cc
    1.107 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  sql/item.h
    1.194 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  sql/field_conv.cc
    1.54 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  scripts/make_binary_distribution.sh
    1.111 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  mysql-test/t/sp.test
    1.181 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  mysql-test/t/skip_grants.test
    1.9 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  mysql-test/t/grant2.test
    1.33 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  mysql-test/r/sp.result
    1.193 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  mysql-test/r/grant2.result
    1.27 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  mysql-test/mysql-test-run.sh
    1.308 06/03/03 11:48:52 pem@stripped +0 -0
    Auto merged

  mysql-test/mysql-test-run.pl
    1.79 06/03/03 11:48:52 pem@stripped +0 -1
    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:	pem
# Host:	pem.mysql.com
# Root:	/extern/mysql/5.1/generic/mysql-5.1-new/RESYNC

--- 1.307/mysql-test/mysql-test-run.sh	2006-03-01 21:39:22 +01:00
+++ 1.308/mysql-test/mysql-test-run.sh	2006-03-03 11:48:52 +01:00
@@ -603,7 +603,14 @@
       FAST_START=1
       ;;
     --use-old-data)
-      USE_OLD_DATA=1;
+      USE_OLD_DATA=1
+      ;;
+    --comment=*)
+      TMP=`$ECHO "$1" | $SED -e "s;--comment=;;"`
+      echo
+      echo '############################################'
+      echo "# $TMP"
+      echo '############################################'
       ;;
     -- )  shift; break ;;
     --* ) $ECHO "Unrecognized option: $1"; exit 1 ;;

--- 1.53/sql/field_conv.cc	2005-12-01 12:30:05 +01:00
+++ 1.54/sql/field_conv.cc	2006-03-03 11:48:52 +01:00
@@ -378,6 +378,16 @@
 
 
 
+static void do_expand_binary(Copy_field *copy)
+{
+  CHARSET_INFO *cs= copy->from_field->charset();
+  memcpy(copy->to_ptr,copy->from_ptr,copy->from_length);
+  cs->cset->fill(cs, copy->to_ptr+copy->from_length,
+                     copy->to_length-copy->from_length, '\0');
+}
+
+
+
 static void do_expand_string(Copy_field *copy)
 {
   CHARSET_INFO *cs= copy->from_field->charset();
@@ -582,7 +592,13 @@
 	return (from->charset()->mbmaxlen == 1 ?
                 do_cut_string : do_cut_string_complex);
       else if (to_length > from_length)
-	return do_expand_string;
+      {
+        if ((to->flags & BINARY_FLAG) != 0)
+          return do_expand_binary;
+        else
+          return do_expand_string;
+      }
+
     }
     else if (to->real_type() != from->real_type() ||
 	     to_length != from_length ||

--- 1.193/sql/item.h	2006-03-02 06:17:02 +01:00
+++ 1.194/sql/item.h	2006-03-03 11:48:52 +01:00
@@ -1629,7 +1629,6 @@
     			   str_value.length(), collation.collation);
   }
   Item *safe_charset_converter(CHARSET_INFO *tocs);
-  String *const_string() { return &str_value; }
   inline void append(char *str, uint length) { str_value.append(str, length); }
   void print(String *str);
   // to prevent drop fixed flag (no need parent cleanup call)

--- 1.106/sql/item_timefunc.cc	2006-02-08 21:52:04 +01:00
+++ 1.107/sql/item_timefunc.cc	2006-03-03 11:48:52 +01:00
@@ -1656,9 +1656,15 @@
 
 void Item_func_date_format::fix_length_and_dec()
 {
+  /*
+    Must use this_item() in case it's a local SP variable
+    (for ->max_length and ->str_value)
+  */
+  Item *arg1= args[1]->this_item();
+
   decimals=0;
   collation.set(&my_charset_bin);
-  if (args[1]->type() == STRING_ITEM)
+  if (arg1->type() == STRING_ITEM)
   {						// Optimize the normal case
     fixed_length=1;
 
@@ -1666,13 +1672,13 @@
       The result is a binary string (no reason to use collation->mbmaxlen
       This is becasue make_date_time() only returns binary strings
     */
-    max_length= format_length(((Item_string*) args[1])->const_string());
+    max_length= format_length(&arg1->str_value);
   }
   else
   {
     fixed_length=0;
     /* The result is a binary string (no reason to use collation->mbmaxlen */
-    max_length=min(args[1]->max_length,MAX_BLOB_WIDTH) * 10;
+    max_length=min(arg1->max_length, MAX_BLOB_WIDTH) * 10;
     set_if_smaller(max_length,MAX_BLOB_WIDTH);
   }
   maybe_null=1;					// If wrong date
@@ -1682,6 +1688,7 @@
 bool Item_func_date_format::eq(const Item *item, bool binary_cmp) const
 {
   Item_func_date_format *item_func;
+
   if (item->type() != FUNC_ITEM)
     return 0;
   if (func_name() != ((Item_func*) item)->func_name())

--- 1.60/sql/sql_udf.cc	2006-02-28 09:40:19 +01:00
+++ 1.61/sql/sql_udf.cc	2006-03-03 11:48:52 +01:00
@@ -284,6 +284,10 @@
 void free_udf(udf_func *udf)
 {
   DBUG_ENTER("free_udf");
+  
+  if (!initialized)
+    DBUG_VOID_RETURN;
+
   rw_wrlock(&THR_LOCK_udf);
   if (!--udf->usage_count)
   {
@@ -307,6 +311,9 @@
 {
   udf_func *udf=0;
   DBUG_ENTER("find_udf");
+
+  if (!initialized)
+    DBUG_RETURN(NULL);
 
   /* TODO: This should be changed to reader locks someday! */
   if (mark_used)

--- 1.210/sql/table.cc	2006-02-23 13:33:54 +01:00
+++ 1.211/sql/table.cc	2006-03-03 12:03:23 +01:00
@@ -3336,8 +3336,15 @@
   if (view_field)
     return table_ref->view_db.str;
 
+  /*
+    Test that TABLE_LIST::db is the same as st_table_share::db to
+    ensure consistency. An exception are I_S schema tables, which
+    are inconsistent in this respect.
+  */
   DBUG_ASSERT(!strcmp(table_ref->db,
-                      table_ref->table->s->db.str));
+                      table_ref->table->s->db.str) ||
+              (table_ref->schema_table &&
+               table_ref->table->s->db.str[0] == 0));
   return table_ref->db;
 }
 
@@ -3539,7 +3546,15 @@
   else if (table_ref->is_natural_join)
     return natural_join_it.column_ref()->db_name();
 
-  DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str));
+  /*
+    Test that TABLE_LIST::db is the same as st_table_share::db to
+    ensure consistency. An exception are I_S schema tables, which
+    are inconsistent in this respect.
+  */
+  DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str) ||
+              (table_ref->schema_table &&
+               table_ref->table->s->db.str[0] == 0));
+
   return table_ref->db;
 }
 

--- 1.8/mysql-test/t/skip_grants.test	2006-02-25 19:35:07 +01:00
+++ 1.9/mysql-test/t/skip_grants.test	2006-03-03 11:48:52 +01:00
@@ -30,3 +30,6 @@
 create definer='user'@'host' sql security definer view v1 as select * from t1;
 drop view v1;
 drop table t1;
+
+# BUG#17595: DROP FUNCTION IF EXISTS f1 crashes server
+drop function if exists f1;

--- 1.78/mysql-test/mysql-test-run.pl	2006-03-02 22:47:38 +01:00
+++ 1.79/mysql-test/mysql-test-run.pl	2006-03-03 11:48:52 +01:00
@@ -198,6 +198,7 @@
 
 our @opt_extra_mysqld_opt;
 
+our $opt_comment;
 our $opt_compress;
 our $opt_ssl;
 our $opt_skip_ssl;
@@ -669,6 +670,14 @@
     print '#' x 78, "\n\n";
   }
 
+  if ( $opt_comment )
+  {
+    print "\n";
+    print '#' x 78, "\n";
+    print "# $opt_comment\n";
+    print '#' x 78, "\n\n";
+  }
+
   foreach my $arg ( @ARGV )
   {
     if ( $arg =~ /^--skip-/ )
@@ -3256,6 +3265,7 @@
 
 Misc options
 
+  comment=STR           Write STR to the output
   verbose               Verbose output from this script
   script-debug          Debug this script itself
   timer                 Show test case execution time

--- 1.192/mysql-test/r/sp.result	2006-02-25 19:35:06 +01:00
+++ 1.193/mysql-test/r/sp.result	2006-03-03 11:48:52 +01:00
@@ -4778,4 +4778,23 @@
 Inner
 drop procedure bug15011|
 drop table t3|
+drop procedure if exists bug17476|
+create table t3 ( d date )|
+insert into t3 values
+( '2005-01-01' ), ( '2005-01-02' ), ( '2005-01-03' ),
+( '2005-01-04' ), ( '2005-02-01' ), ( '2005-02-02' )|
+create procedure bug17476(pDateFormat varchar(10))
+select date_format(t3.d, pDateFormat), count(*)
+from t3 
+group by date_format(t3.d, pDateFormat)|
+call bug17476('%Y-%m')|
+date_format(t3.d, pDateFormat)	count(*)
+2005-01	4
+2005-02	2
+call bug17476('%Y-%m')|
+date_format(t3.d, pDateFormat)	count(*)
+2005-01	4
+2005-02	2
+drop table t3|
+drop procedure bug17476|
 drop table t1,t2;

--- 1.180/mysql-test/t/sp.test	2006-02-25 19:35:07 +01:00
+++ 1.181/mysql-test/t/sp.test	2006-03-03 11:48:52 +01:00
@@ -5621,6 +5621,31 @@
 
 
 #
+# BUG#17476: Stored procedure not returning data when it is called first
+#            time per connection
+#
+--disable_warnings
+drop procedure if exists bug17476|
+--enable_warnings
+
+create table t3 ( d date )|
+insert into t3 values
+  ( '2005-01-01' ), ( '2005-01-02' ), ( '2005-01-03' ),
+  ( '2005-01-04' ), ( '2005-02-01' ), ( '2005-02-02' )|
+
+create procedure bug17476(pDateFormat varchar(10))
+  select date_format(t3.d, pDateFormat), count(*)
+    from t3 
+    group by date_format(t3.d, pDateFormat)|
+
+call bug17476('%Y-%m')|
+call bug17476('%Y-%m')|
+
+drop table t3|
+drop procedure bug17476|
+
+
+#
 # BUG#NNNN: New bug synopsis
 #
 #--disable_warnings

--- 1.26/mysql-test/r/grant2.result	2006-02-28 13:54:26 +01:00
+++ 1.27/mysql-test/r/grant2.result	2006-03-03 11:48:52 +01:00
@@ -348,7 +348,7 @@
 ('%','TESTDB','mysqltest_1','Y');
 FLUSH PRIVILEGES;
 create database TEStdb;
-ERROR 42000: Access denied for user 'mysqltest_1'@'%' to database 'TEStdb'
+Got one of the listed errors
 delete from mysql.user;
 delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB';
 insert into mysql.user select * from t1;

--- 1.32/mysql-test/t/grant2.test	2006-02-28 13:54:26 +01:00
+++ 1.33/mysql-test/t/grant2.test	2006-03-03 11:48:52 +01:00
@@ -449,7 +449,8 @@
 
 # The user mysqltest_1 should only be allowed access to
 # database TESTDB, not TEStdb
---error 1044
+# On system with "lowercase names" we get error "1007: Can't create db..."
+--error 1044, 1007
 create database TEStdb;
 
 # Clean-up
Thread
bk commit into 5.1 tree (pem:1.2214)pem3 Mar