From f3bb583c3e4ea71a342f21c6e01014a05c89fd98 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Nov 2007 14:01:11 +0400 Subject: BUG#32050 - table logging gone wrong. INSERT/UPDATE against CSV table created by MySQL earlier than 5.1.23 with NULL-able column results in server crash in debug builds. Starting with 5.1.23 CSV doesn't permit creation of NULL-able columns, but it is still possible to get such table from older MySQL versions. Fixed by removing excessive DBUG_ASSERT(). scripts/mysql_system_tables_fix.sql: Starting with 5.1.23 CSV doesn't permit creation of NULL-able columns. Alter system CSV tables structure so that all columns are NOT NULL. storage/csv/ha_tina.cc: Starting with 5.1.23 CSV doesn't permit creation of NULL-able columns, but it is still possible to get such table from older MySQL versions. Removed excessive DBUG_ASSERT(). --- storage/csv/ha_tina.cc | 8 -------- 1 file changed, 8 deletions(-) (limited to 'storage/csv') diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 6a87b8ecc72..75c3f70dec4 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -472,14 +472,6 @@ int ha_tina::encode_quote(uchar *buf) const char *ptr; const char *end_ptr; const bool was_null= (*field)->is_null(); - - /* - CSV does not support nulls. ::create() prevents creation of a table - with nullable columns so if we encounter them here, there is a bug. - This may only occur if the frm was created by an older version of - mysqld which permitted table creation with nullable columns. - */ - DBUG_ASSERT(!(*field)->maybe_null()); /* assistance for backwards compatibility in production builds. -- cgit v1.2.1 From 0fdc16bd13bca09abe4026d892d71eccb99fd121 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Dec 2007 14:44:03 +0400 Subject: BUG#32817 - though CSV is marked as supported create table is rejected with error 1005. CSV doesn't support nullable fields. Report descriptive error if create table with nullable field is requested. mysql-test/r/csv.result: A test case for BUG#32817. mysql-test/t/csv.test: A test case for BUG#32817. storage/csv/ha_tina.cc: CSV doesn't support nullable fields. Report descriptive error if create table with nullable field is requested. --- storage/csv/ha_tina.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'storage/csv') diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 75c3f70dec4..b5ef4620108 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -1486,7 +1486,10 @@ int ha_tina::create(const char *name, TABLE *table_arg, for (Field **field= table_arg->s->field; *field; field++) { if ((*field)->real_maybe_null()) - DBUG_RETURN(-1); + { + my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "nullable columns"); + DBUG_RETURN(HA_ERR_UNSUPPORTED); + } } -- cgit v1.2.1