From: Date: May 10 2006 4:22am Subject: bk commit into 5.0 tree (cmiller:1.2129) BUG#19564 List-Archive: http://lists.mysql.com/commits/6174 X-Bug: 19564 Message-Id: <20060510022252.D327A5C059@zippy> Below is the list of changes that have just been committed into a local 5.0 repository of cmiller. When cmiller 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 1.2129 06/05/09 22:22:46 cmiller@zippy.(none) +3 -0 Bug#19564: mysql displays NULL instead of space Correct a bug (that I introduced, after using Oracle's database software for too many years) where the length of the database-sent data is incorrectly used to infer NULLness. mysql-test/t/mysql.test 1.10 06/05/09 22:22:42 cmiller@zippy.(none) +8 -0 Add test and version marker mysql-test/r/mysql.result 1.9 06/05/09 22:22:42 cmiller@zippy.(none) +10 -2 Add result and version marker, and correct previous result. client/mysql.cc 1.204 06/05/09 22:22:42 cmiller@zippy.(none) +1 -1 No longer use the length of the data to infer whether it is NULL or not. # 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: cmiller # Host: zippy.(none) # Root: /home/cmiller/work/mysql/mysql-5.0__bug19564 --- 1.203/client/mysql.cc 2006-04-28 02:33:36 -04:00 +++ 1.204/client/mysql.cc 2006-05-09 22:22:42 -04:00 @@ -2319,7 +2319,7 @@ uint extra_padding; /* If this column may have a null value, use "NULL" for empty. */ - if (! not_null_flag[off] && (lengths[off] == 0)) + if (! not_null_flag[off] && (cur[off] == NULL)) { buffer= "NULL"; data_length= 4; --- 1.8/mysql-test/r/mysql.result 2006-04-16 17:17:33 -04:00 +++ 1.9/mysql-test/r/mysql.result 2006-05-09 22:22:42 -04:00 @@ -74,7 +74,7 @@ +----------------------+------------+--------+ | >a < | b | 123421 | | >a < | 0123456789 | 4 | -| >abcd< | NULL | 4 | +| >abcd< | | 4 | +----------------------+------------+--------+ +------+------+---------------------------+ | i | j | k | @@ -94,6 +94,14 @@ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+-------+ | i | int(11) | YES | | NULL | | -| j | int(11) | NO | | NULL | | +| j | int(11) | NO | | | | | k | int(11) | YES | | NULL | | +-------+---------+------+-----+---------+-------+ ++------+------+ +| i | s1 | ++------+------+ +| 1 | x | +| 2 | NULL | +| 3 | | ++------+------+ +End of 5.0 tests --- 1.9/mysql-test/t/mysql.test 2006-04-16 17:17:33 -04:00 +++ 1.10/mysql-test/t/mysql.test 2006-05-09 22:22:42 -04:00 @@ -72,3 +72,11 @@ # --exec $MYSQL -t --default-character-set utf8 test -e "create table t1 (i int, j int not null, k int); insert into t1 values (null, 1, null); select * from t1; describe t1; drop table t1;" +# +# Bug#19564: mysql displays NULL instead of space +# +--exec $MYSQL -t test -e "create table b19564 (i int, s1 char(1)); insert into b19564 values (1, 'x'); insert into b19564 values (2, NULL); insert into b19564 values (3, ' '); select * from b19564 order by i; drop table b19564;" + +--echo End of 5.0 tests + +