diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2010-02-17 16:13:42 +0400 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2010-02-17 16:13:42 +0400 |
commit | 4b260b668d66cfd6f7e8c2612461c66d2914219d (patch) | |
tree | bdbc73dd4f1984bcdae9fc74b5711cd70d3f2b34 /mysql-test/r/csv.result | |
parent | 6cb7abe667533084e09f3df6951591332138ae0e (diff) | |
download | mariadb-git-4b260b668d66cfd6f7e8c2612461c66d2914219d.tar.gz |
Bug#33717 INSERT...(default) fails for enum. Crashes CSV tables, loads spaces for MyISAM
Table corruption happens during table reading in ha_tina::find_current_row() func.
Field::store() method returns error(true) if stored value is 0.
The fix:
added special case for enum type which correctly processes 0 value.
Additional fix:
INSERT...(default) and INSERT...() have the same behaviour now for enum type.
mysql-test/r/csv.result:
test result
mysql-test/r/default.result:
result fix
mysql-test/t/csv.test:
test case
sql/item.cc:
Changes:
do not print warning for 'enum' type if there is no default value.
set default value.
storage/csv/ha_tina.cc:
Table corruption happens during table reading in ha_tina::find_current_row() func.
Field::store() method returns error(true) if stored value is 0.
The fix:
added special case for enum type which correctly processes 0 value.
Diffstat (limited to 'mysql-test/r/csv.result')
-rw-r--r-- | mysql-test/r/csv.result | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index 4b96f5a5ed0..e2eebdfc992 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -5394,17 +5394,24 @@ select * from t1; ERROR HY000: File 'MYSQLD_DATADIR/test/t1.CSV' not found (Errcode: 2) unlock tables; drop table t1; -create table t1(a enum ('a') not null) engine=csv; -insert into t1 values (2); +CREATE TABLE t1 (e enum('foo','bar') NOT NULL) ENGINE = CSV; +INSERT INTO t1 VALUES(); +INSERT INTO t1 VALUES(default); +INSERT INTO t1 VALUES(0); Warnings: -Warning 1265 Data truncated for column 'a' at row 1 -select * from t1 limit 1; -ERROR HY000: Table 't1' is marked as crashed and should be repaired -repair table t1; -Table Op Msg_type Msg_text -test.t1 repair Warning Data truncated for column 'a' at row 1 -test.t1 repair status OK -select * from t1 limit 1; -a -drop table t1; +Warning 1265 Data truncated for column 'e' at row 1 +INSERT INTO t1 VALUES(3); +Warnings: +Warning 1265 Data truncated for column 'e' at row 1 +INSERT INTO t1 VALUES(-1); +Warnings: +Warning 1265 Data truncated for column 'e' at row 1 +SELECT * FROM t1; +e +foo +foo + + + +DROP TABLE t1; End of 5.1 tests |