Commit 6312ad25 authored by ram@gw.mysql.r18.ru's avatar ram@gw.mysql.r18.ru

Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1

into gw.mysql.r18.ru:/usr/home/ram/work/4.1
parents 3ff17e7d 28c92200
...@@ -97,6 +97,7 @@ peter@linux.local ...@@ -97,6 +97,7 @@ peter@linux.local
peter@mysql.com peter@mysql.com
peterg@mysql.com peterg@mysql.com
pgulutzan@linux.local pgulutzan@linux.local
ram@gw.mysql.r18.ru
ram@gw.udmsearch.izhnet.ru ram@gw.udmsearch.izhnet.ru
ram@mysql.r18.ru ram@mysql.r18.ru
ram@ram.(none) ram@ram.(none)
......
...@@ -40,3 +40,9 @@ uncompress(compress("")) ...@@ -40,3 +40,9 @@ uncompress(compress(""))
select uncompressed_length(""); select uncompressed_length("");
uncompressed_length("") uncompressed_length("")
0 0
select compress(NULL);
compress(NULL)
NULL
select uncompress(NULL);
uncompress(NULL)
NULL
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;
...@@ -23,3 +23,9 @@ select uncompress(""); ...@@ -23,3 +23,9 @@ select uncompress("");
select uncompress(compress("")); select uncompress(compress(""));
select uncompressed_length(""); select uncompressed_length("");
#
# NULL (Bug #1333)
#
select compress(NULL);
select uncompress(NULL);
--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;
...@@ -2539,6 +2539,11 @@ longlong Item_func_crc32::val_int() ...@@ -2539,6 +2539,11 @@ longlong Item_func_crc32::val_int()
String *Item_func_compress::val_str(String *str) String *Item_func_compress::val_str(String *str)
{ {
String *res= args[0]->val_str(str); String *res= args[0]->val_str(str);
if (!res)
{
null_value= 1;
return 0;
}
if (res->is_empty()) return res; if (res->is_empty()) return res;
int err= Z_OK; int err= Z_OK;
...@@ -2589,6 +2594,11 @@ String *Item_func_compress::val_str(String *str) ...@@ -2589,6 +2594,11 @@ String *Item_func_compress::val_str(String *str)
String *Item_func_uncompress::val_str(String *str) String *Item_func_uncompress::val_str(String *str)
{ {
String *res= args[0]->val_str(str); String *res= args[0]->val_str(str);
if (!res)
{
null_value= 1;
return 0;
}
if (res->is_empty()) return res; if (res->is_empty()) return res;
ulong new_size= uint4korr(res->c_ptr()) & 0x3FFFFFFF; ulong new_size= uint4korr(res->c_ptr()) & 0x3FFFFFFF;
......
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