summaryrefslogtreecommitdiff
path: root/mysql-test/r/loaddata.result
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2010-03-23 17:07:00 +0200
committerGeorgi Kodinov <joro@sun.com>2010-03-23 17:07:00 +0200
commitd9175c214777ab3b37cd3752290c80f33c49be41 (patch)
tree71054058de67ea839694187d4caf855a62f8131e /mysql-test/r/loaddata.result
parenta4332c256edded6a6d2378ad3edca945ea57a77f (diff)
downloadmariadb-git-d9175c214777ab3b37cd3752290c80f33c49be41.tar.gz
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).
Diffstat (limited to 'mysql-test/r/loaddata.result')
-rw-r--r--mysql-test/r/loaddata.result11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 1e488b320d7..0c3f8d04463 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -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