Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1b7a9079
Commit
1b7a9079
authored
Feb 20, 2013
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Plain Diff
No commit message
No commit message
parents
c448839c
1483aebe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
163 additions
and
0 deletions
+163
-0
mysql-test/suite/connect/r/csv.result
mysql-test/suite/connect/r/csv.result
+81
-0
mysql-test/suite/connect/t/csv.test
mysql-test/suite/connect/t/csv.test
+82
-0
No files found.
mysql-test/suite/connect/r/csv.result
View file @
1b7a9079
SET NAMES utf8;
#
#
# Testing errors
# Testing errors
#
#
...
@@ -142,3 +143,83 @@ REPLACE(LOAD_FILE('DATADIR/test/t2.csv'),'\r\n','\n')
...
@@ -142,3 +143,83 @@ REPLACE(LOAD_FILE('DATADIR/test/t2.csv'),'\r\n','\n')
test1,1
test1,1
test2,2
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
mysql-test/suite/connect/t/csv.test
View file @
1b7a9079
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
--
copy_file
$MYSQL_TEST_DIR
/
suite
/
connect
/
std_data
/
people
.
csv
$MYSQLD_DATADIR
/
test
/
people
.
csv
--
copy_file
$MYSQL_TEST_DIR
/
suite
/
connect
/
std_data
/
people
.
csv
$MYSQLD_DATADIR
/
test
/
people
.
csv
SET
NAMES
utf8
;
--
echo
#
--
echo
#
--
echo
# Testing errors
--
echo
# Testing errors
--
echo
#
--
echo
#
...
@@ -94,6 +96,86 @@ DROP TABLE t1;
...
@@ -94,6 +96,86 @@ DROP TABLE t1;
--
eval
SELECT
REPLACE
(
LOAD_FILE
(
'$MYSQLD_DATADIR/test/t2.csv'
),
'\r\n'
,
'\n'
);
--
eval
SELECT
REPLACE
(
LOAD_FILE
(
'$MYSQLD_DATADIR/test/t2.csv'
),
'\r\n'
,
'\n'
);
--
remove_file
$MYSQLD_DATADIR
/
test
/
t2
.
csv
--
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
# Clean up
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment