mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
bug #22372 (LOAD DATA crashes the table with the geometry field)
The problem is that the GEOMETRY NOT NULL can't automatically set any value as a default one. We always tried to complete LOAD DATA command even if there's not enough data in file. That doesn't work for GEOMETRY NOT NULL. Now Field_*::reset() returns an error sign and it's checked in mysql_load()
This commit is contained in:
@ -671,3 +671,9 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
|
||||
def asbinary(g) 252 8192 0 Y 128 0 63
|
||||
asbinary(g)
|
||||
drop table t1;
|
||||
create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
|
||||
alter table t1 disable keys;
|
||||
load data infile '../../std_data/bad_gis_data.dat' into table t1;
|
||||
ERROR 01000: Data truncated; NULL supplied to NOT NULL column 'b' at row 1
|
||||
alter table t1 enable keys;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user