mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
This commit is contained in:
commit
1b7a907979
2 changed files with 163 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
SET NAMES utf8;
|
||||
#
|
||||
# Testing errors
|
||||
#
|
||||
|
@ -142,3 +143,83 @@ REPLACE(LOAD_FILE('DATADIR/test/t2.csv'),'\r\n','\n')
|
|||
test1,1
|
||||
test2,2
|
||||
|
||||
#
|
||||
# Testing international data
|
||||
#
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
|
||||
CHARSET=utf8;
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
á
|
||||
DROP TABLE t1;
|
||||
SELECT HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'));;
|
||||
HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
|
||||
C3A10A
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
|
||||
CHARSET=utf8 DATA_CHARSET=latin1;
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
á
|
||||
DROP TABLE t1;
|
||||
SELECT HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'));;
|
||||
HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
|
||||
E10A
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv';
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
á
|
||||
DROP TABLE t1;
|
||||
SELECT HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'));;
|
||||
HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
|
||||
E10A
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
|
||||
CHARSET=latin1;
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
á
|
||||
DROP TABLE t1;
|
||||
SELECT HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'));;
|
||||
HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
|
||||
E10A
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
|
||||
CHARSET=latin1 DATA_CHARSET=utf8;
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
á
|
||||
DROP TABLE t1;
|
||||
SELECT HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'));;
|
||||
HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
|
||||
C3A10A
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12) CHARACTER SET latin1,
|
||||
c2 CHAR(12) CHARACTER SET utf8
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv';
|
||||
INSERT INTO t1 VALUES ('á','á');
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
á á
|
||||
DROP TABLE t1;
|
||||
SELECT HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'));;
|
||||
HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
|
||||
E12CC3A10A
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--copy_file $MYSQL_TEST_DIR/suite/connect/std_data/people.csv $MYSQLD_DATADIR/test/people.csv
|
||||
|
||||
SET NAMES utf8;
|
||||
|
||||
--echo #
|
||||
--echo # Testing errors
|
||||
--echo #
|
||||
|
@ -94,6 +96,86 @@ DROP TABLE t1;
|
|||
--eval SELECT REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t2.csv'),'\r\n','\n');
|
||||
--remove_file $MYSQLD_DATADIR/test/t2.csv
|
||||
|
||||
--echo #
|
||||
--echo # Testing international data
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
|
||||
CHARSET=utf8;
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--chmod 0777 $MYSQLD_DATADIR/test/t1.csv
|
||||
--replace_result $MYSQLD_DATADIR DATADIR
|
||||
--eval SELECT HEX(REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t1.csv'),'\r\n','\n'));
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.csv
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
|
||||
CHARSET=utf8 DATA_CHARSET=latin1;
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--chmod 0777 $MYSQLD_DATADIR/test/t1.csv
|
||||
--replace_result $MYSQLD_DATADIR DATADIR
|
||||
--eval SELECT HEX(REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t1.csv'),'\r\n','\n'));
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.csv
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv';
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--chmod 0777 $MYSQLD_DATADIR/test/t1.csv
|
||||
--replace_result $MYSQLD_DATADIR DATADIR
|
||||
--eval SELECT HEX(REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t1.csv'),'\r\n','\n'));
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.csv
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
|
||||
CHARSET=latin1;
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--chmod 0777 $MYSQLD_DATADIR/test/t1.csv
|
||||
--replace_result $MYSQLD_DATADIR DATADIR
|
||||
--eval SELECT HEX(REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t1.csv'),'\r\n','\n'));
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.csv
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12)
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
|
||||
CHARSET=latin1 DATA_CHARSET=utf8;
|
||||
INSERT INTO t1 VALUES ('á');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--chmod 0777 $MYSQLD_DATADIR/test/t1.csv
|
||||
--replace_result $MYSQLD_DATADIR DATADIR
|
||||
--eval SELECT HEX(REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t1.csv'),'\r\n','\n'));
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.csv
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
c1 CHAR(12) CHARACTER SET latin1,
|
||||
c2 CHAR(12) CHARACTER SET utf8
|
||||
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv';
|
||||
INSERT INTO t1 VALUES ('á','á');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
--chmod 0777 $MYSQLD_DATADIR/test/t1.csv
|
||||
--replace_result $MYSQLD_DATADIR DATADIR
|
||||
--eval SELECT HEX(REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t1.csv'),'\r\n','\n'));
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.csv
|
||||
|
||||
|
||||
#
|
||||
# Clean up
|
||||
|
|
Loading…
Reference in a new issue