mirror of
https://github.com/MariaDB/server.git
synced 2025-10-22 19:52:58 +03:00
merging with mysql-next-mr-svoj
This commit is contained in:
@@ -5407,4 +5407,60 @@ test.t1 repair status OK
|
||||
select * from t1 limit 1;
|
||||
a
|
||||
drop table t1;
|
||||
#
|
||||
# Test for the following cases
|
||||
# 1) integers and strings enclosed in quotes
|
||||
# 2) integers and strings not enclosed in quotes
|
||||
# 3) \X characters with quotes
|
||||
# 4) \X characters outside quotes
|
||||
#
|
||||
CREATE TABLE t1(c1 INT NOT NULL, c2 VARCHAR(50) NOT NULL) ENGINE=csv;
|
||||
# remove the already existing .CSV file if any
|
||||
# create the .CSV file that contains the hard-coded data used in
|
||||
# testing
|
||||
1,"integer sans quotes"
|
||||
1,string sans quotes
|
||||
1,quotes"in between" strings
|
||||
"1",Integer with quote and string with no quote
|
||||
1,"escape sequence \n \" \\ \r \a within quotes"
|
||||
1,escape sequence \n \" \\ \r \a without quotes
|
||||
# select from the table in which the data has been filled in using
|
||||
# the hard-coded .CSV file
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 integer sans quotes
|
||||
1 string sans quotes
|
||||
1 quotes"in between" strings
|
||||
1 Integer with quote and string with no quote
|
||||
1 escape sequence
|
||||
" \
|
||||
\a within quotes
|
||||
1 escape sequence
|
||||
" \
|
||||
\a without quotes
|
||||
DROP TABLE t1;
|
||||
# Test for the case when a field begins with a quote, but does not end in a
|
||||
# quote.
|
||||
# Note: This results in an error.
|
||||
CREATE TABLE t1(c1 INT NOT NULL, c2 VARCHAR(50) NOT NULL) ENGINE=csv;
|
||||
# remove the already existing .CSV file if any
|
||||
# create the .CSV file that contains the hard-coded data used in
|
||||
# testing
|
||||
1,"string only at the beginning quotes
|
||||
# select from the table in which the data has been filled in using
|
||||
# the hard-coded .CSV file
|
||||
SELECT * FROM t1;
|
||||
ERROR HY000: Table 't1' is marked as crashed and should be repaired
|
||||
DROP TABLE t1;
|
||||
# Test for the case when a field ends with a quote, but does not begin in a
|
||||
# quote.
|
||||
# Note: This results in an error.
|
||||
CREATE TABLE t1(c1 INT NOT NULL, c2 VARCHAR(50) NOT NULL) ENGINE=csv;
|
||||
# remove the already existing .CSV file if any
|
||||
# create the .CSV file that contains the hard-coded data used in
|
||||
# testing
|
||||
1,string with only ending quotes"
|
||||
# select from the table in which the data has been filled in using
|
||||
# the hard-coded .CSV file
|
||||
SELECT * FROM t1;
|
||||
ERROR HY000: Table 't1' is marked as crashed and should be repaired
|
||||
|
@@ -1819,4 +1819,84 @@ repair table t1;
|
||||
select * from t1 limit 1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #40814 CSV engine does not parse \X characters when they occur in unquoted fields
|
||||
#
|
||||
|
||||
--echo #
|
||||
--echo # Test for the following cases
|
||||
--echo # 1) integers and strings enclosed in quotes
|
||||
--echo # 2) integers and strings not enclosed in quotes
|
||||
--echo # 3) \X characters with quotes
|
||||
--echo # 4) \X characters outside quotes
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(c1 INT NOT NULL, c2 VARCHAR(50) NOT NULL) ENGINE=csv;
|
||||
|
||||
--echo # remove the already existing .CSV file if any
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.CSV
|
||||
|
||||
--echo # create the .CSV file that contains the hard-coded data used in
|
||||
--echo # testing
|
||||
--write_file $MYSQLD_DATADIR/test/t1.CSV
|
||||
1,"integer sans quotes"
|
||||
1,string sans quotes
|
||||
1,quotes"in between" strings
|
||||
"1",Integer with quote and string with no quote
|
||||
1,"escape sequence \n \" \\ \r \a within quotes"
|
||||
1,escape sequence \n \" \\ \r \a without quotes
|
||||
EOF
|
||||
--cat_file $MYSQLD_DATADIR/test/t1.CSV
|
||||
|
||||
--echo # select from the table in which the data has been filled in using
|
||||
--echo # the hard-coded .CSV file
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # Test for the case when a field begins with a quote, but does not end in a
|
||||
--echo # quote.
|
||||
--echo # Note: This results in an error.
|
||||
|
||||
CREATE TABLE t1(c1 INT NOT NULL, c2 VARCHAR(50) NOT NULL) ENGINE=csv;
|
||||
|
||||
--echo # remove the already existing .CSV file if any
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.CSV
|
||||
|
||||
--echo # create the .CSV file that contains the hard-coded data used in
|
||||
--echo # testing
|
||||
--write_file $MYSQLD_DATADIR/test/t1.CSV
|
||||
1,"string only at the beginning quotes
|
||||
EOF
|
||||
--cat_file $MYSQLD_DATADIR/test/t1.CSV
|
||||
|
||||
--echo # select from the table in which the data has been filled in using
|
||||
--echo # the hard-coded .CSV file
|
||||
--error ER_CRASHED_ON_USAGE
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # Test for the case when a field ends with a quote, but does not begin in a
|
||||
--echo # quote.
|
||||
--echo # Note: This results in an error.
|
||||
|
||||
CREATE TABLE t1(c1 INT NOT NULL, c2 VARCHAR(50) NOT NULL) ENGINE=csv;
|
||||
|
||||
--echo # remove the already existing .CSV file if any
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.CSV
|
||||
|
||||
--echo # create the .CSV file that contains the hard-coded data used in
|
||||
--echo # testing
|
||||
--write_file $MYSQLD_DATADIR/test/t1.CSV
|
||||
1,string with only ending quotes"
|
||||
EOF
|
||||
--cat_file $MYSQLD_DATADIR/test/t1.CSV
|
||||
|
||||
--echo # select from the table in which the data has been filled in using
|
||||
--echo # the hard-coded .CSV file
|
||||
--error ER_CRASHED_ON_USAGE
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
--echo End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user