mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-34883 LOAD DATA INFILE with geometry data fails
We write field using field data charset, so we should read it using the field charset.
This commit is contained in:
@ -686,3 +686,44 @@ SELECT * FROM t1;
|
||||
id
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-34883: LOAD DATA INFILE with geometry data fails
|
||||
#
|
||||
CREATE OR REPLACE TABLE t1 (
|
||||
p point NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)'));
|
||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv';
|
||||
Warnings:
|
||||
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
|
||||
CREATE OR REPLACE TABLE t2 LIKE t1;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv' INTO TABLE t2;
|
||||
drop table t1, t2;
|
||||
CREATE OR REPLACE TABLE t1 (
|
||||
p point NOT NULL,
|
||||
chr char(20)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
INSERT INTO t1 VALUES (GeomFromText('POINT(37.646944 -75.761111)'),"їєі");
|
||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv';
|
||||
Warnings:
|
||||
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
|
||||
CREATE OR REPLACE TABLE t2 LIKE t1;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv' INTO TABLE t2 CHARACTER SET latin1;
|
||||
select ST_AsText(p), chr from t1;
|
||||
ST_AsText(p) chr
|
||||
POINT(37.646944 -75.761111) їєі
|
||||
# incorrect string (but correct geom)
|
||||
select ST_AsText(p), chr from t2;
|
||||
ST_AsText(p) chr
|
||||
POINT(37.646944 -75.761111) їєі
|
||||
delete from t2;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.tsv' INTO TABLE t2 CHARACTER SET utf8mb4;
|
||||
select ST_AsText(p), chr from t1;
|
||||
ST_AsText(p) chr
|
||||
POINT(37.646944 -75.761111) їєі
|
||||
# all is correct
|
||||
select ST_AsText(p), chr from t2;
|
||||
ST_AsText(p) chr
|
||||
POINT(37.646944 -75.761111) їєі
|
||||
drop table t1, t2;
|
||||
# End of 10.5 tests
|
||||
|
Reference in New Issue
Block a user