1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug #51850: crash/memory overlap when using load data infile and set

col equal to itself!

There's no need to copy the value of a field into itself.
While generally harmless (except for some performance penalties)
it may be dangerous when the copy code doesn't expect this.
Fixed by checking if the source field is the same as the destination
field before copying the data.
Note that we must preserve the order of assignment of the null 
flags (hence the null_value assignment addition).
This commit is contained in:
Georgi Kodinov
2010-03-23 17:07:00 +02:00
parent a4332c256e
commit d9175c2147
3 changed files with 37 additions and 4 deletions

View File

@ -484,4 +484,15 @@ SET character_set_filesystem=default;
select @@character_set_filesystem;
@@character_set_filesystem
binary
#
# Bug #51850: crash/memory overlap when using load data infile and set
# col equal to itself!
#
CREATE TABLE t1(col0 LONGBLOB);
SELECT 'test' INTO OUTFILE 't1.txt';
LOAD DATA INFILE 't1.txt' IGNORE INTO TABLE t1 SET col0=col0;
SELECT * FROM t1;
col0
test
DROP TABLE t1;
End of 5.1 tests