MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Satya B Date:November 4 2008 5:24am
Subject:bzr commit into mysql-6.0 branch (satya.bn:2900) Bug#33696
View as plain text  
#At file:///home/satya/WORK/mysql-6.0-bugteam-33696/

 2900 Satya B	2008-11-04
      Fix for Bug#33696 - CSV storage engine allows nullable columns via ALTER TABLE statements
added:
  mysql-test/r/csv_alter_table.result
modified:
  mysql-test/t/disabled.def
  storage/csv/ha_tina.cc

per-file messages:
  mysql-test/r/csv_alter_table.result
    result for csv_alter_table.test
  mysql-test/t/disabled.def
    Enabling the disabled test csv_alter_table
  storage/csv/ha_tina.cc
    fixed check_if_incompatible_data to return the correct compatability state
=== added file 'mysql-test/r/csv_alter_table.result'
--- a/mysql-test/r/csv_alter_table.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/csv_alter_table.result	2008-11-04 05:24:38 +0000
@@ -0,0 +1,40 @@
+# ===== csv_alter_table.1 =====
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
+ALTER TABLE t1 ADD COLUMN b CHAR(5) NOT NULL;
+DESC t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO		NULL	
+b	char(5)	NO		NULL	
+ALTER TABLE t1 DROP COLUMN b;
+DESC t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO		NULL	
+ALTER TABLE t1 MODIFY a BIGINT NOT NULL;
+DESC t1;
+Field	Type	Null	Key	Default	Extra
+a	bigint(20)	NO		NULL	
+ALTER TABLE t1 CHANGE a a INT NOT NULL;
+DESC t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO		NULL	
+DROP TABLE t1;
+# ===== csv_alter_table.2 =====
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
+ALTER TABLE t1 ADD COLUMN b CHAR(5);
+ERROR 42000: The storage engine for the table doesn't support nullable columns
+DESC t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO		NULL	
+ALTER TABLE t1 MODIFY a BIGINT;
+ERROR 42000: The storage engine for the table doesn't support nullable columns
+DESC t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO		NULL	
+ALTER TABLE t1 CHANGE a a INT;
+ERROR 42000: The storage engine for the table doesn't support nullable columns
+DESC t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO		NULL	
+DROP TABLE t1;

=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2008-10-15 19:12:49 +0000
+++ b/mysql-test/t/disabled.def	2008-11-04 05:24:38 +0000
@@ -17,7 +17,6 @@ lowercase_table3         : Bug#32667 low
 rpl_log_pos          : Bug#8693 Test 'rpl_log_pos' fails sometimes
 ctype_create         : Bug#32965 main.ctype_create fails
 backup_no_engine     : Bug#36021 2008-04-13 rsomla server crashes when openning table with unknown storage engine
-csv_alter_table      : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables
 query_cache_wlock_invalidate_func: Bug#35390 causes not deterministic results.
 cast                 : Bug#35594 2008-03-27 main.cast fails on Windows2003-64
 maria-preload        : Bug#35107 crashes

=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc	2008-08-23 00:18:35 +0000
+++ b/storage/csv/ha_tina.cc	2008-11-04 05:24:38 +0000
@@ -1598,7 +1598,10 @@ int ha_tina::check(THD* thd, HA_CHECK_OP
 bool ha_tina::check_if_incompatible_data(HA_CREATE_INFO *info,
 					   uint table_changes)
 {
-  return COMPATIBLE_DATA_YES;
+  if (table_changes == IS_EQUAL_NO)  
+    return COMPATIBLE_DATA_NO;
+  else
+    return COMPATIBLE_DATA_YES;    
 }
 
 struct st_mysql_storage_engine csv_storage_engine=

Thread
bzr commit into mysql-6.0 branch (satya.bn:2900) Bug#33696Satya B4 Nov
  • Re: bzr commit into mysql-6.0 branch (satya.bn:2900) Bug#33696Ingo Strüwing4 Nov