diff options
author | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-06-27 16:20:00 +0500 |
---|---|---|
committer | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-06-27 16:20:00 +0500 |
commit | 2a76abce96bed0b60274e443a0922534ee610b59 (patch) | |
tree | 3b78108214294686d1f152888f9060c438f3e464 /mysql-test/t/csv.test | |
parent | 0314c73ad8f159018fc0f1d51e0253f011894de1 (diff) | |
download | mariadb-git-2a76abce96bed0b60274e443a0922534ee610b59.tar.gz |
Fix for bug #29353: inserting a negative value to a csv table leads to the table corruption
Problem: we believe a number cannot start with '-' ['+'] sign reading rows.
Fix: let field->store() check given values.
mysql-test/r/csv.result:
Fix for bug #29353: inserting a negative value to a csv table leads to the table corruption
- test result.
mysql-test/t/csv.test:
Fix for bug #29353: inserting a negative value to a csv table leads to the table corruption
- test case.
storage/csv/ha_tina.cc:
Fix for bug #29353: inserting a negative value to a csv table leads to the table corruption
- code optimization: removed unnecessary file_buff->get_value() calls.
- let field->store() check given value correctness.
Diffstat (limited to 'mysql-test/t/csv.test')
-rw-r--r-- | mysql-test/t/csv.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index c7c7f3e13ab..6d24b38ee10 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1674,3 +1674,28 @@ CREATE TABLE `bug21328` ( insert into bug21328 values (1,NULL,NULL); alter table bug21328 engine=myisam; drop table bug21328; + +# +# Bug #29353: negative values +# +create table t1(a int) engine=csv; +insert into t1 values(-1), (-123.34), (2), (-23); +select * from t1; +check table t1; +drop table t1; + +create table t1(a int, b int) engine=csv; +--write_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV +1, 1E-2 +-2E2, .9 +-10E-1, -.9 +-1, -100.1 +1a, -2b +EOF +repair table t1; +check table t1; +select * from t1; +check table t1; +drop table t1; + +--echo End of 5.1 tests |