List:Internals« Previous MessageNext Message »
From:bar Date:August 29 2005 1:56pm
Subject:bk commit into 5.0 tree (bar:1.1909)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of bar. When bar 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.1909 05/08/29 16:55:56 bar@stripped +4 -0
  Merge mysql.com:/usr/home/bar/mysql-4.1.b12371
  into  mysql.com:/usr/home/bar/mysql-5.0

  sql/item.cc
    1.167 05/08/29 16:55:39 bar@stripped +1 -1
    After merge fix

  sql/item.h
    1.166 05/08/29 16:50:57 bar@stripped +0 -0
    Auto merged

  mysql-test/t/ctype_utf8.test
    1.66 05/08/29 16:50:57 bar@stripped +0 -0
    Auto merged

  mysql-test/r/ctype_utf8.result
    1.70 05/08/29 16:50:57 bar@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:	bar
# Host:	bar.intranet.mysql.r18.ru
# Root:	/usr/home/bar/mysql-5.0/RESYNC

--- 1.166/sql/item.cc	2005-08-27 03:33:00 +05:00
+++ 1.167/sql/item.cc	2005-08-29 16:55:39 +05:00
@@ -723,6 +723,32 @@
 }
 
 
+Item *Item_param::safe_charset_converter(CHARSET_INFO *tocs)
+{
+  if (const_item())
+  {
+    Item_string *conv;
+    uint conv_errors;
+    char buf[MAX_FIELD_WIDTH];
+    String tmp(buf, sizeof(buf), &my_charset_bin);
+    String cstr, *ostr= val_str(&tmp);
+    /*
+      As safe_charset_converter is not executed for
+      a parameter bound to NULL, ostr should never be 0.
+    */
+    cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs,
&conv_errors);
+    if (conv_errors || !(conv= new Item_string(cstr.ptr(), cstr.length(),
+                                               cstr.charset(),
+                                               collation.derivation)))
+      return NULL;
+    conv->str_value.copy();
+    conv->str_value.mark_as_const();
+    return conv;
+  }
+  return NULL;
+}
+
+
 bool Item_string::eq(const Item *item, bool binary_cmp) const
 {
   if (type() == item->type() && item->basic_const_item())

--- 1.165/sql/item.h	2005-08-27 03:33:00 +05:00
+++ 1.166/sql/item.h	2005-08-29 16:50:57 +05:00
@@ -1190,6 +1190,7 @@
     basic_const_item returned TRUE.
   */
   Item *new_item();
+  Item *safe_charset_converter(CHARSET_INFO *tocs);
   /*
     Implement by-value equality evaluation if parameter value
     is set and is a basic constant (integer, real or string).

--- 1.69/mysql-test/r/ctype_utf8.result	2005-07-22 14:47:04 +05:00
+++ 1.70/mysql-test/r/ctype_utf8.result	2005-08-29 16:50:57 +05:00
@@ -993,6 +993,18 @@
 a
 abcd
 drop table t1;
+set names utf8;
+create table t1 (a char(3), b varchar(10));
+insert into t1 values ('bar','kostja');
+prepare my_stmt from "select * from t1 where a=?";
+set @a:='bar';
+execute my_stmt using @a;
+a	b
+bar	kostja
+set @a:=NULL;
+execute my_stmt using @a;
+a	b
+drop table t1;
 CREATE TABLE t1 (
 a varchar(255) NOT NULL default '',
 KEY a (a)

--- 1.65/mysql-test/t/ctype_utf8.test	2005-07-28 19:09:48 +05:00
+++ 1.66/mysql-test/t/ctype_utf8.test	2005-08-29 16:50:57 +05:00
@@ -832,6 +832,20 @@
 
 
 #
+# Bug #12371 executing prepared statement fails (illegal mix of collations)
+#
+set names utf8;
+create table t1 (a char(3), b varchar(10));
+insert into t1 values ('bar','kostja');
+prepare my_stmt from "select * from t1 where a=?";
+set @a:='bar';
+execute my_stmt using @a;
+set @a:=NULL;
+execute my_stmt using @a;
+drop table t1;
+
+
+#
 # Bug#9557 MyISAM utf8 table crash
 #
 CREATE TABLE t1 (
Thread
bk commit into 5.0 tree (bar:1.1909)bar29 Aug