From: Date: March 9 2005 9:15am Subject: bk commit into 4.0 tree (igor:1.2082) BUG#8669 List-Archive: http://lists.mysql.com/internals/22823 X-Bug: 8669 Message-Id: <20050309081557.42488E0EB3@rurik.mysql.com> Below is the list of changes that have just been committed into a local 4.0 repository of igor. When igor 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.2082 05/03/09 00:15:51 igor@stripped +3 -0 func_str.result, func_str.test: Added a test case for bug #8669. item_strfunc.cc: Fixed bug #8669. Function AES_DECRYPT can return NULL value. mysql-test/r/func_str.result 1.33 05/03/09 00:15:26 igor@stripped +15 -0 Added a test case for bug #8669. mysql-test/t/func_str.test 1.33 05/03/09 00:14:54 igor@stripped +17 -0 Added a test case for bug #8669. sql/item_strfunc.cc 1.85 05/03/09 00:13:35 igor@stripped +1 -0 Fixed bug #8669. Function AES_DECRYPT can return NULL value. # 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: igor # Host: rurik.mysql.com # Root: /home/igor/dev/mysql-4.0-0 --- 1.84/sql/item_strfunc.cc Mon Mar 7 07:55:55 2005 +++ 1.85/sql/item_strfunc.cc Wed Mar 9 00:13:35 2005 @@ -208,6 +208,7 @@ void Item_func_aes_decrypt::fix_length_and_dec() { max_length=args[0]->max_length; + maybe_null= 1; } --- 1.32/mysql-test/r/func_str.result Tue Feb 1 18:28:33 2005 +++ 1.33/mysql-test/r/func_str.result Wed Mar 9 00:15:26 2005 @@ -304,3 +304,18 @@ 'A' 'A' DROP TABLE t1; +CREATE TABLE t1 (id int PRIMARY KEY, str char(255) NOT NULL); +CREATE TABLE t2 (id int NOT NULL UNIQUE); +INSERT INTO t2 VALUES (1),(2); +INSERT INTO t1 VALUES (1, aes_encrypt('foo', 'bar')); +INSERT INTO t1 VALUES (2, 'not valid'); +SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id; +id aes_decrypt(str, 'bar') +1 foo +2 NULL +SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id +ORDER BY t1.id; +id aes_decrypt(str, 'bar') +1 foo +2 NULL +DROP TABLE t1, t2; --- 1.32/mysql-test/t/func_str.test Tue Feb 1 18:27:45 2005 +++ 1.33/mysql-test/t/func_str.test Wed Mar 9 00:14:54 2005 @@ -198,3 +198,20 @@ CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3; SELECT QUOTE('A') FROM t1; DROP TABLE t1; + +# +# Test case for bug #8669: null aes_decrypt result in order by query +# + +CREATE TABLE t1 (id int PRIMARY KEY, str char(255) NOT NULL); +CREATE TABLE t2 (id int NOT NULL UNIQUE); +INSERT INTO t2 VALUES (1),(2); +INSERT INTO t1 VALUES (1, aes_encrypt('foo', 'bar')); +INSERT INTO t1 VALUES (2, 'not valid'); + +SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id; +SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id + ORDER BY t1.id; + +DROP TABLE t1, t2; +