List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:March 3 2011 12:28pm
Subject:bzr commit into mysql-5.5 branch (alexander.barkov:3368)
View as plain text  
#At file:///home/bar/mysql-bzr/mysql-5.5/ based on revid:alexander.barkov@stripped

 3368 Alexander Barkov	2011-03-03 [merge]
      Merging from 5.1

    added:
      mysql-test/r/func_encrypt_ucs2.result
      mysql-test/t/func_encrypt_ucs2.test
    modified:
      mysql-test/r/ctype_ucs.result
      mysql-test/t/ctype_ucs.test
      sql/item_func.cc
      sql/item_strfunc.cc
=== modified file 'mysql-test/r/ctype_ucs.result'
--- a/mysql-test/r/ctype_ucs.result	2011-02-10 08:18:08 +0000
+++ b/mysql-test/r/ctype_ucs.result	2011-03-03 12:27:36 +0000
@@ -1238,6 +1238,12 @@ CREATE VIEW v1 AS SELECT 1 from t1
 WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
 DROP VIEW v1;
 DROP TABLE t1;
+#
+# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
+#
+SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850));
+HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850))
+00
 End of 5.0 tests
 #
 # Start of 5.5 tests

=== added file 'mysql-test/r/func_encrypt_ucs2.result'
--- a/mysql-test/r/func_encrypt_ucs2.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/func_encrypt_ucs2.result	2011-03-03 12:27:36 +0000
@@ -0,0 +1,19 @@
+#
+# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
+#
+SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)));
+CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)))
+9
+SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED);
+CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED)
+0
+Warnings:
+Warning	1292	Truncated incorrect INTEGER value: ''
+SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)));
+CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)))
+4
+SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED);
+CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED)
+0
+Warnings:
+Warning	1292	Truncated incorrect INTEGER value: 'test'

=== modified file 'mysql-test/t/ctype_ucs.test'
--- a/mysql-test/t/ctype_ucs.test	2010-04-11 07:17:42 +0000
+++ b/mysql-test/t/ctype_ucs.test	2011-03-03 12:27:36 +0000
@@ -741,6 +741,11 @@ WHERE t1.b <=> (SELECT a FROM t1 WHERE a
 DROP VIEW v1;
 DROP TABLE t1;
 
+--echo #
+--echo # Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
+--echo #
+SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850));
+
 --echo End of 5.0 tests
 
 

=== added file 'mysql-test/t/func_encrypt_ucs2.test'
--- a/mysql-test/t/func_encrypt_ucs2.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/func_encrypt_ucs2.test	2011-03-03 12:27:36 +0000
@@ -0,0 +1,12 @@
+-- source include/have_ssl_crypto_functs.inc
+-- source include/have_ucs2.inc
+
+--echo #
+--echo # Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
+--echo #
+
+SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)));
+SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED);
+
+SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)));
+SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED);

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2011-03-01 14:42:37 +0000
+++ b/sql/item_func.cc	2011-03-03 12:27:36 +0000
@@ -866,7 +866,7 @@ longlong Item_func_numhybrid::val_int()
       return 0;
 
     char *end= (char*) res->ptr() + res->length();
-    CHARSET_INFO *cs= str_value.charset();
+    CHARSET_INFO *cs= res->charset();
     return (*(cs->cset->strtoll10))(cs, res->ptr(), &end, &err_not_used);
   }
   default:

=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc	2011-02-10 08:18:08 +0000
+++ b/sql/item_strfunc.cc	2011-03-03 12:27:36 +0000
@@ -699,6 +699,7 @@ String *Item_func_des_encrypt::val_str(S
   tmp_arg[res_length-1]=tail;                   // save extra length
   tmp_value.realloc(res_length+1);
   tmp_value.length(res_length+1);
+  tmp_value.set_charset(&my_charset_bin);
   tmp_value[0]=(char) (128 | key_number);
   // Real encryption
   bzero((char*) &ivec,sizeof(ivec));
@@ -786,6 +787,7 @@ String *Item_func_des_decrypt::val_str(S
   if ((tail=(uint) (uchar) tmp_value[length-2]) > 8)
     goto wrong_key;				     // Wrong key
   tmp_value.length(length-1-tail);
+  tmp_value.set_charset(&my_charset_bin);
   return &tmp_value;
 
 error:

No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
Thread
bzr commit into mysql-5.5 branch (alexander.barkov:3368) Alexander Barkov3 Mar