diff options
author | unknown <ram@gw.mysql.r18.ru> | 2003-09-22 11:39:29 +0500 |
---|---|---|
committer | unknown <ram@gw.mysql.r18.ru> | 2003-09-22 11:39:29 +0500 |
commit | dc11b113b26bbaebf3183a8e9317c12b17b83748 (patch) | |
tree | 6f36794bd08105de4256870e955e812a841e390b | |
parent | 96eb819704adb0cce5319b8603087e45da87b8fd (diff) | |
parent | 748a351376c35ea5a4f81881dd77bb78d6ce3fcd (diff) | |
download | mariadb-git-dc11b113b26bbaebf3183a8e9317c12b17b83748.tar.gz |
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1
sql/item_strfunc.cc:
Auto merged
-rw-r--r-- | BitKeeper/etc/logging_ok | 1 | ||||
-rw-r--r-- | mysql-test/r/func_compress.result | 6 | ||||
-rw-r--r-- | mysql-test/r/mysqldump.result | 20 | ||||
-rw-r--r-- | mysql-test/t/func_compress.test | 6 | ||||
-rw-r--r-- | mysql-test/t/mysqldump.test | 10 | ||||
-rw-r--r-- | sql/item_strfunc.cc | 10 |
6 files changed, 53 insertions, 0 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index dff4cec203c..48144e71863 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -97,6 +97,7 @@ peter@linux.local peter@mysql.com peterg@mysql.com pgulutzan@linux.local +ram@gw.mysql.r18.ru ram@gw.udmsearch.izhnet.ru ram@mysql.r18.ru ram@ram.(none) diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index c4d2eacf363..57eef44b3bb 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -40,3 +40,9 @@ uncompress(compress("")) select uncompressed_length(""); uncompressed_length("") 0 +select compress(NULL); +compress(NULL) +NULL +select uncompress(NULL); +uncompress(NULL) +NULL diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result new file mode 100644 index 00000000000..cf1ef55ca69 --- /dev/null +++ b/mysql-test/r/mysqldump.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); +<?xml version="1.0"?> +<mysqldump> +<database name="test"> +DROP TABLE IF EXISTS t1; +LOCK TABLES t1 WRITE; + <table name="t1"> + <row> + <field name="a">1</field> + </row> + <row> + <field name="a">2</field> + </row> + </table> +UNLOCK TABLES; +</database> +</mysqldump> +DROP TABLE t1; diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 826721a4053..7462c020357 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -23,3 +23,9 @@ select uncompress(""); select uncompress(compress("")); select uncompressed_length(""); +# +# NULL (Bug #1333) +# + +select compress(NULL); +select uncompress(NULL); diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test new file mode 100644 index 00000000000..c98fd4050f2 --- /dev/null +++ b/mysql-test/t/mysqldump.test @@ -0,0 +1,10 @@ +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# XML output + +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); +--exec $MYSQL_DUMP -X test t1 +DROP TABLE t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index bde1deea46e..98e8ee3914e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2539,6 +2539,11 @@ longlong Item_func_crc32::val_int() String *Item_func_compress::val_str(String *str) { String *res= args[0]->val_str(str); + if (!res) + { + null_value= 1; + return 0; + } if (res->is_empty()) return res; int err= Z_OK; @@ -2589,6 +2594,11 @@ String *Item_func_compress::val_str(String *str) String *Item_func_uncompress::val_str(String *str) { String *res= args[0]->val_str(str); + if (!res) + { + null_value= 1; + return 0; + } if (res->is_empty()) return res; ulong new_size= uint4korr(res->c_ptr()) & 0x3FFFFFFF; |