List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:February 7 2011 10:19am
Subject:bzr push into mysql-trunk branch (tor.didriksen:3601 to 3602) Bug#59632
View as plain text  
 3602 Tor Didriksen	2011-02-07 [merge]
      Merge Bug #59632 from 5.5, add unit test

    added:
      mysql-test/r/ssl_and_innodb.result
      mysql-test/t/ssl_and_innodb.test
    modified:
      sql/item_strfunc.h
      unittest/gunit/item-t.cc
 3601 Ole John Aske	2011-02-07 [merge]
      Merge of fix for bug#59308 from mysql-5.5 -> mysql-trunk

    modified:
      mysql-test/include/order_by.inc
      mysql-test/r/order_by_all.result
      mysql-test/r/order_by_icp_mrr.result
      mysql-test/r/order_by_none.result
      sql/sql_select.cc
=== added file 'mysql-test/r/ssl_and_innodb.result'
--- a/mysql-test/r/ssl_and_innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/ssl_and_innodb.result	2011-02-03 14:46:22 +0000
@@ -0,0 +1,8 @@
+CREATE TABLE t1(a int) engine=innodb;
+INSERT INTO t1 VALUES (1);
+SELECT DISTINCT
+convert((SELECT des_decrypt(2,1) AS a FROM t1 WHERE @a:=1), signed) as d
+FROM t1 ;
+d
+2
+DROP TABLE t1;

=== added file 'mysql-test/t/ssl_and_innodb.test'
--- a/mysql-test/t/ssl_and_innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/ssl_and_innodb.test	2011-02-03 14:46:22 +0000
@@ -0,0 +1,11 @@
+-- source include/have_innodb.inc
+-- source include/have_ssl_crypto_functs.inc
+
+CREATE TABLE t1(a int) engine=innodb;
+INSERT INTO t1 VALUES (1);
+
+SELECT DISTINCT
+convert((SELECT des_decrypt(2,1) AS a FROM t1 WHERE @a:=1), signed) as d
+FROM t1 ;
+
+DROP TABLE t1;

=== modified file 'sql/item_strfunc.h'
--- a/sql/item_strfunc.h	2011-01-17 12:35:58 +0000
+++ b/sql/item_strfunc.h	2011-02-07 10:18:21 +0000
@@ -1,7 +1,7 @@
 #ifndef ITEM_STRFUNC_INCLUDED
 #define ITEM_STRFUNC_INCLUDED
 
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -382,7 +382,9 @@ public:
   {
     maybe_null=1;
     /* 9 = MAX ((8- (arg_len % 8)) + 1) */
-    max_length = args[0]->max_length - 9;
+    max_length= args[0]->max_length;
+    if (max_length >= 9U)
+      max_length-= 9U;
   }
   const char *func_name() const { return "des_decrypt"; }
 };

=== modified file 'unittest/gunit/item-t.cc'
--- a/unittest/gunit/item-t.cc	2011-02-01 07:52:46 +0000
+++ b/unittest/gunit/item-t.cc	2011-02-07 10:18:21 +0000
@@ -63,7 +63,6 @@ protected:
     delete m_thd;
   }
 
-private:
   THD      *m_thd;
 };
 
@@ -167,4 +166,20 @@ TEST_F(ItemTest, ItemInt)
   */
 }
 
+
+TEST_F(ItemTest, ItemFuncDesDecrypt)
+{
+  // Bug #59632 Assertion failed: arg_length > length
+  const uint length= 1U;
+  Item_int *item_one= new Item_int(1, length);
+  Item_int *item_two= new Item_int(2, length);
+  Item_func_des_decrypt *item_decrypt=
+    new Item_func_des_decrypt(item_two, item_one);
+  
+  EXPECT_FALSE(item_decrypt->fix_fields(m_thd, NULL));
+  EXPECT_EQ(length, item_one->max_length);
+  EXPECT_EQ(length, item_two->max_length);
+  EXPECT_LE(item_decrypt->max_length, length);
+}
+
 }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (tor.didriksen:3601 to 3602) Bug#59632Tor Didriksen7 Feb