MySQL Lists are EOL. Please join:

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

 2744 Satya B	2008-11-24
      Fix for Bug#33696 - CSV storage engine allows nullable columns via 
      ALTER TABLE statements
            
      After the fast online-alter table changes, CSV engine allows nullable
      columns via alter table and also the existing non-null columns can be
      modified to null columns. All columns in CSV Engine should be NON-NULL 
      always.
            
      Found that we evaluate the changes that will be made to altered table. 
      During this evaluation, we check for the behaviour of the new fields 
      in temporary altered table with the fields in the original table and
      maintain as table_changes. This is passed to storage engines along 
      with the new information. Storage engines can add further checks and 
      return the compatibility state.CSV Engine has this information but 
      ignores it and returns always true. Changed the behaviour to return 
      compatible or not based on the information passed from server
      
      Note: No testcase added as it already exists in the repository
modified:
  mysql-test/t/disabled.def
  storage/csv/ha_tina.cc

per-file messages:
  mysql-test/t/disabled.def
    Enabling the disabled test csv_alter_table.test
  storage/csv/ha_tina.cc
    modified check_if_incompatiable_data to return the correct status
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2008-11-21 16:03:01 +0000
+++ b/mysql-test/t/disabled.def	2008-11-24 15:20:28 +0000
@@ -16,7 +16,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-10-28 14:17:05 +0000
+++ b/storage/csv/ha_tina.cc	2008-11-24 15:20:28 +0000
@@ -1607,10 +1607,21 @@ int ha_tina::check(THD* thd, HA_CHECK_OP
 }
 
 
+/**
+   Return the compatiblity of alter table changes, created for new 
+   fast on-line alter table operation.
+   @param    info                Information about  new altered table properties
+   @param    table_changes       Information if the table layout is changed
+   @retval   COMPATIBLE_DATA_NO  Altered table changes made are incompatible
+   @retval   COMPATIBLE_DATA_YES Altered table changes made are compatible
+*/
 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-backup branch (satya.bn:2744) Bug#33696Satya B24 Nov