MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Jim Winstead Date:July 11 2006 2:50am
Subject:bk commit into 5.0 tree (jimw:1.2225) BUG#18539
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw 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@stripped, 2006-07-10 19:50:40-07:00, jimw@rama.(none) +3 -0
  Bug #18539: uncompress(d) is null: impossible?
  
    The UNCOMPRESS() function was not marked as maybe_null, even though
    it returns NULL on invalid data. This confused the optimizer.

  mysql-test/r/func_compress.result@stripped, 2006-07-10 19:50:39-07:00, jimw@rama.(none) +28 -0
    Add new results

  mysql-test/t/func_compress.test@stripped, 2006-07-10 19:50:39-07:00, jimw@rama.(none) +14 -0
    Add new regression test

  sql/item_strfunc.h@stripped, 2006-07-10 19:50:39-07:00, jimw@rama.(none) +1 -1
    Set maybe_null within Item_func_uncompress::fix_length_and_dec()

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.0-18539

--- 1.108/sql/item_strfunc.h	2006-07-10 19:50:44 -07:00
+++ 1.109/sql/item_strfunc.h	2006-07-10 19:50:44 -07:00
@@ -784,7 +784,7 @@
   String buffer;
 public:
   Item_func_uncompress(Item *a): Item_str_func(a){}
-  void fix_length_and_dec(){max_length= MAX_BLOB_WIDTH;}
+  void fix_length_and_dec(){ maybe_null= 1; max_length= MAX_BLOB_WIDTH; }
   const char *func_name() const{return "uncompress";}
   String *val_str(String *) ZLIB_DEPENDED_FUNCTION
 };

--- 1.17/mysql-test/r/func_compress.result	2006-07-10 19:50:44 -07:00
+++ 1.18/mysql-test/r/func_compress.result	2006-07-10 19:50:44 -07:00
@@ -79,3 +79,31 @@
 NULL	NULL
 a	1
 drop table t1;
+create table t1 (a varchar(32) not null);
+insert into t1 values ('foo');
+explain select * from t1 where uncompress(a) is null;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	
+Warnings:
+Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
+select * from t1 where uncompress(a) is null;
+a
+foo
+Warnings:
+Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
+explain select *, uncompress(a) from t1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	
+select *, uncompress(a) from t1;
+a	uncompress(a)
+foo	NULL
+Warnings:
+Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
+select *, uncompress(a), uncompress(a) is null from t1;
+a	uncompress(a)	uncompress(a) is null
+foo	NULL	1
+Warnings:
+Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
+Error	1256	Uncompressed data size too large; the maximum size is 104857600 (probably, length of uncompressed data was corrupted)
+drop table t1;
+End of 5.0 tests

--- 1.13/mysql-test/t/func_compress.test	2006-07-10 19:50:44 -07:00
+++ 1.14/mysql-test/t/func_compress.test	2006-07-10 19:50:44 -07:00
@@ -57,3 +57,17 @@
 drop table t1;
 
 # End of 4.1 tests
+
+#
+# Bug #18539: uncompress(d) is null: impossible?
+#
+create table t1 (a varchar(32) not null);
+insert into t1 values ('foo');
+explain select * from t1 where uncompress(a) is null;
+select * from t1 where uncompress(a) is null;
+explain select *, uncompress(a) from t1;
+select *, uncompress(a) from t1;
+select *, uncompress(a), uncompress(a) is null from t1;
+drop table t1;
+
+--echo End of 5.0 tests
Thread
bk commit into 5.0 tree (jimw:1.2225) BUG#18539Jim Winstead11 Jul