Commit 76937502 authored by unknown's avatar unknown

Merge rurik.mysql.com:/home/igor/mysql-4.1

into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
parents 810e280a 099fccd2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<!--
This is a dummy changelog file. Don't use it yet.
It merges upward without conflict.
-->
<appendix id="news-4-0-x">
<title>
Changes in release 4.0.x
</title>
<para>
This is a dummy changelog file. Don't use it yet.
</para>
</appendix>
......@@ -739,3 +739,18 @@ ySQL
SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column;
my_column
4
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;
......@@ -482,3 +482,19 @@ DROP TABLE t1;
#
SELECT CHAR(NULL,121,83,81,'76') as my_column;
SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column;
#
# 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;
......@@ -235,6 +235,7 @@ String *Item_func_aes_decrypt::val_str(String *str)
void Item_func_aes_decrypt::fix_length_and_dec()
{
max_length=args[0]->max_length;
maybe_null= 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment