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); + + + +DROP TABLE IF EXISTS t1; +LOCK TABLES t1 WRITE; + + + 1 + + + 2 + +
+UNLOCK TABLES; +
+
+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;