MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:antony Date:September 25 2006 5:29pm
Subject:bk commit into 5.1 tree (acurtis:1.2324) BUG#20501
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of antony. When antony 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-09-25 10:29:42-07:00, acurtis@stripped +5 -0
  Bug#20501
    "NULL not supported in CSV tables"
    Add support for NULL values

  mysql-test/r/csv.result@stripped, 2006-09-25 10:29:38-07:00, acurtis@stripped +15 -0
    Test for fix

  mysql-test/r/log_state.result@stripped, 2006-09-25 10:29:38-07:00, acurtis@stripped +1 -1
    change of result

  mysql-test/r/log_tables.result@stripped, 2006-09-25 10:29:38-07:00, acurtis@stripped +1 -4
    change of result

  mysql-test/t/csv.test@stripped, 2006-09-25 10:29:38-07:00, acurtis@stripped +13 -0
    test for fix

  storage/csv/ha_tina.cc@stripped, 2006-09-25 10:29:38-07:00, acurtis@stripped +13 -1
    Bug#20501
      "NULL not supported in CSV tables"
      Add support for NULL values

# 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:	acurtis
# Host:	ltamd64.xiphis.org
# Root:	/home/antony/work2/p3-bug20501.2

--- 1.13/mysql-test/r/csv.result	2006-09-25 10:29:53 -07:00
+++ 1.14/mysql-test/r/csv.result	2006-09-25 10:29:53 -07:00
@@ -5224,3 +5224,18 @@
 Table	Op	Msg_type	Msg_text
 test.bug22080_3	check	error	Corrupt
 drop tables bug22080_1,bug22080_2,bug22080_3;
+create table t1 (id int,string varchar(64)) Engine=CSV;
+insert into t1 values(1,'string 1');
+insert into t1 values(2,NULL);
+insert into t1 values(NULL,'string 2');
+insert into t1 values(3,'string 3');
+"1","string 1"
+"2",NULL
+NULL,"string 2"
+"3","string 3"
+select * from t1 where string is not null;
+id	string
+1	string 1
+NULL	string 2
+3	string 3
+drop table t1;

--- 1.16/mysql-test/t/csv.test	2006-09-25 10:29:53 -07:00
+++ 1.17/mysql-test/t/csv.test	2006-09-25 10:29:53 -07:00
@@ -1605,3 +1605,16 @@
 check table bug22080_3;
 
 drop tables bug22080_1,bug22080_2,bug22080_3;
+
+#
+# BUG20501 "NULL not supported"
+#
+
+create table t1 (id int,string varchar(64)) Engine=CSV;
+insert into t1 values(1,'string 1');
+insert into t1 values(2,NULL);
+insert into t1 values(NULL,'string 2');
+insert into t1 values(3,'string 3');
+--exec cat $MYSQLTEST_VARDIR/master-data/test/t1.CSV
+select * from t1 where string is not null;
+drop table t1;

--- 1.62/storage/csv/ha_tina.cc	2006-09-25 10:29:53 -07:00
+++ 1.63/storage/csv/ha_tina.cc	2006-09-25 10:29:53 -07:00
@@ -541,7 +541,7 @@
     */
     if ((*field)->is_null())
     {
-      buffer.append(STRING_WITH_LEN("\"\","));
+      buffer.append(STRING_WITH_LEN("NULL,"));
       continue;
     }
     else
@@ -665,6 +665,18 @@
   for (Field **field=table->field ; *field ; field++)
   {
     buffer.length(0);
+    if (curr_offset + 3 < end_offset &&
+        file_buff->get_value(curr_offset) == 'N' &&
+        file_buff->get_value(curr_offset + 1) == 'U' &&
+        file_buff->get_value(curr_offset + 2) == 'L' &&
+        file_buff->get_value(curr_offset + 3) == 'L' &&
+        (file_buff->get_value(curr_offset + 4) == ',' ||
+         curr_offset + 4 == end_offset))
+    {
+      curr_offset+= 5;
+      (*field)->set_null();
+      continue;
+    }
     if (curr_offset < end_offset &&
         file_buff->get_value(curr_offset) == '"')
       curr_offset++; // Incrementpast the first quote

--- 1.8/mysql-test/r/log_tables.result	2006-09-25 10:29:53 -07:00
+++ 1.9/mysql-test/r/log_tables.result	2006-09-25 10:29:53 -07:00
@@ -71,7 +71,7 @@
 0
 select * from mysql.slow_log;
 start_time	user_host	query_time	lock_time	rows_sent	rows_examined	db	last_insert_id	insert_id	server_id	sql_text
-TIMESTAMP	USER_HOST	QUERY_TIME	00:00:00	1	0	test	0	0	1	select sleep(2)
+TIMESTAMP	USER_HOST	QUERY_TIME	00:00:00	1	0	test	NULL	NULL	1	select sleep(2)
 alter table mysql.general_log engine=myisam;
 ERROR HY000: You can't alter a log table if logging is enabled
 alter table mysql.slow_log engine=myisam;
@@ -111,9 +111,6 @@
 ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
 alter table mysql.general_log engine=myisam;
 alter table mysql.slow_log engine=myisam;
-Warnings:
-Warning	1264	Out of range value for column 'last_insert_id' at row 0
-Warning	1264	Out of range value for column 'insert_id' at row 0
 show create table mysql.general_log;
 Table	Create Table
 general_log	CREATE TABLE `general_log` (

--- 1.3/mysql-test/r/log_state.result	2006-09-25 10:29:53 -07:00
+++ 1.4/mysql-test/r/log_state.result	2006-09-25 10:29:53 -07:00
@@ -46,7 +46,7 @@
 0
 select * from mysql.slow_log;
 start_time	user_host	query_time	lock_time	rows_sent	rows_examined	db	last_insert_id	insert_id	server_id	sql_text
-TIMESTAMP	USER_HOST	QUERY_TIME	00:00:00	1	0	test	0	0	1	select sleep(2)
+TIMESTAMP	USER_HOST	QUERY_TIME	00:00:00	1	0	test	NULL	NULL	1	select sleep(2)
 show global variables
 where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
 Variable_name = 'general_log' or Variable_name = 'slow_query_log';
Thread
bk commit into 5.1 tree (acurtis:1.2324) BUG#20501antony25 Sep