[MDEV-29548] LOAD DATA INFILE doesn't read NULL values accurately Created: 2022-09-15 Updated: 2023-10-31 Resolved: 2023-10-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation |
| Affects Version/s: | 10.9.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Duong Thien Ly | Assignee: | Ian Gilfillan |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Steps to reproduce.
It reads NULL as a string. |
| Comments |
| Comment by Alice Sherepa [ 2022-09-19 ] | ||||||||||||||||||||||
|
Thank you for the report!I repeated as described on 10.3-10.10.
| ||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-09-19 ] | ||||||||||||||||||||||
|
This doesn't seem to be a bug, but a very insufficient documentation related to how FIELDS ... and LINES ... clauses work and interact. Compare with https://dev.mysql.com/doc/refman/8.0/en/load-data.html — it says that
In your case the ENCLOSED BY is empty, and ESCAPED BY is empty too, because of NO_BACKSLASH_ESCAPES. As a result, both NULL value and a 'NULL' string literal are written a literal word NULL, which is ambiguous. LOAD DATA prefers to interpret it as a string literal 'NULL'. | ||||||||||||||||||||||
| Comment by Michael Widenius [ 2023-10-31 ] | ||||||||||||||||||||||
|
Closed based on Serg's last comment |