"LOAD DATA INFILE" fails, for binary (or, geometry) data , for the file created with SELECT * INTO OUTFILE
I'm attaching example data where it can be demonstrated.
To reproduce, extract the dump file and load it
mariadb -uroot test < /mnt/e/airport_geo.mysqldump.sql
|
mariadb -uroot test -e "SELECT * FROM airport_geo INTO OUTFILE '/mnt/e/airport_geo.tsv'"
|
mariadb -uroot test -e "TRUNCATE airport_geo; LOAD DATA INFILE '/mnt/e/airport_geo.tsv' INTO TABLE airport_geo"
|
The last command fails with
--------------
|
LOAD DATA INFILE '/mnt/e/airport_geo.tsv' INTO TABLE airport_geo
|
--------------
|
|
ERROR 1263 (22004) at line 1: Column set to default value; NULL supplied to NOT NULL column 'geolocation' at row 42
|
this is the DDL for the create table, column "geolocation" is a POINT
CREATE TABLE `airport_geo` (
|
`airport_id` smallint(6) NOT NULL,
|
`name` varchar(50) NOT NULL,
|
`city` varchar(50) DEFAULT NULL,
|
`country` varchar(50) DEFAULT NULL,
|
`latitude` decimal(11,8) NOT NULL,
|
`longitude` decimal(11,8) NOT NULL,
|
`geolocation` point NOT NULL,
|
KEY `flughafen_idx` (`airport_id`),
|
SPATIAL KEY `geolokation_spt` (`geolocation`)
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
"git bisect" points to MDEV-19123 as first bad commit
36eba98817339f53cc57f1d4884ace3efb38db8d is the first bad commit
|
commit 36eba98817339f53cc57f1d4884ace3efb38db8d
|
Date: Tue May 28 09:08:51 2024 +0400
|
|
MDEV-19123 Change default charset from latin1 to utf8mb4
|
|
Changing the default server character set from latin1 to utf8mb4.
|
{"report":{"fcp":1068.8000001907349,"ttfb":422.1000003814697,"pageVisibility":"visible","entityId":130647,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"550b50f3-5c06-421d-ab99-cc09bd19bdaa","navigationType":0,"readyForUser":1155.1000003814697,"redirectCount":0,"resourceLoadedEnd":725,"resourceLoadedStart":428.40000009536743,"resourceTiming":[{"duration":53.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":428.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":428.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":481.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":54,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":428.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":428.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":482.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":174.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":428.7000002861023,"connectEnd":428.7000002861023,"connectStart":428.7000002861023,"domainLookupEnd":428.7000002861023,"domainLookupStart":428.7000002861023,"fetchStart":428.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":486,"responseEnd":602.9000000953674,"responseStart":501.1000003814697,"secureConnectionStart":428.7000002861023},{"duration":296,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":429,"connectEnd":429,"connectStart":429,"domainLookupEnd":429,"domainLookupStart":429,"fetchStart":429,"redirectEnd":0,"redirectStart":0,"requestStart":486.5,"responseEnd":725,"responseStart":505.2000002861023,"secureConnectionStart":429},{"duration":71.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":429.1000003814697,"connectEnd":429.1000003814697,"connectStart":429.1000003814697,"domainLookupEnd":429.1000003814697,"domainLookupStart":429.1000003814697,"fetchStart":429.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":486.90000009536743,"responseEnd":501,"responseStart":499.80000019073486,"secureConnectionStart":429.1000003814697},{"duration":77.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":429.30000019073486,"connectEnd":429.30000019073486,"connectStart":429.30000019073486,"domainLookupEnd":429.30000019073486,"domainLookupStart":429.30000019073486,"fetchStart":429.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":489.30000019073486,"responseEnd":507.1000003814697,"responseStart":504.6000003814697,"secureConnectionStart":429.30000019073486},{"duration":77.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":429.5,"connectEnd":429.5,"connectStart":429.5,"domainLookupEnd":429.5,"domainLookupStart":429.5,"fetchStart":429.5,"redirectEnd":0,"redirectStart":0,"requestStart":489.6000003814697,"responseEnd":506.90000009536743,"responseStart":504,"secureConnectionStart":429.5},{"duration":59.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":429.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":429.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":489.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":78.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":429.90000009536743,"connectEnd":429.90000009536743,"connectStart":429.90000009536743,"domainLookupEnd":429.90000009536743,"domainLookupStart":429.90000009536743,"fetchStart":429.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":491.40000009536743,"responseEnd":508.7000002861023,"responseStart":507.6000003814697,"secureConnectionStart":429.90000009536743},{"duration":59.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":430,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":430,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":489.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":89.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":430.1000003814697,"connectEnd":430.1000003814697,"connectStart":430.1000003814697,"domainLookupEnd":430.1000003814697,"domainLookupStart":430.1000003814697,"fetchStart":430.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":493,"responseEnd":519.9000000953674,"responseStart":512.1000003814697,"secureConnectionStart":430.1000003814697},{"duration":262.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":437.2000002861023,"connectEnd":437.2000002861023,"connectStart":437.2000002861023,"domainLookupEnd":437.2000002861023,"domainLookupStart":437.2000002861023,"fetchStart":437.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":574.8000001907349,"responseEnd":700.1000003814697,"responseStart":696.5,"secureConnectionStart":437.2000002861023},{"duration":262.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":437.80000019073486,"connectEnd":437.80000019073486,"connectStart":437.80000019073486,"domainLookupEnd":437.80000019073486,"domainLookupStart":437.80000019073486,"fetchStart":437.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":575.7000002861023,"responseEnd":700.4000000953674,"responseStart":697.2000002861023,"secureConnectionStart":437.80000019073486},{"duration":117.80000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":735.3000001907349,"connectEnd":735.3000001907349,"connectStart":735.3000001907349,"domainLookupEnd":735.3000001907349,"domainLookupStart":735.3000001907349,"fetchStart":735.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":815.2000002861023,"responseEnd":853.1000003814697,"responseStart":852.4000000953674,"secureConnectionStart":735.3000001907349},{"duration":220.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":980.1000003814697,"connectEnd":980.1000003814697,"connectStart":980.1000003814697,"domainLookupEnd":980.1000003814697,"domainLookupStart":980.1000003814697,"fetchStart":980.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":1166.6000003814697,"responseEnd":1200.7000002861023,"responseStart":1198,"secureConnectionStart":980.1000003814697},{"duration":265.8999996185303,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1055.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1055.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1321.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":225,"responseStart":422,"responseEnd":434,"domLoading":426,"domInteractive":1244,"domContentLoadedEventStart":1244,"domContentLoadedEventEnd":1321,"domComplete":1747,"loadEventStart":1747,"loadEventEnd":1747,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1204.3000001907349},{"name":"bigPipe.sidebar-id.end","time":1205},{"name":"bigPipe.activity-panel-pipe-id.start","time":1205.2000002861023},{"name":"bigPipe.activity-panel-pipe-id.end","time":1210},{"name":"activityTabFullyLoaded","time":1342.2000002861023}],"measures":[],"correlationId":"350b4775b68246","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":125,"dbReadsTimeInMs":14,"dbConnsTimeInMs":26,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
A workaround is:
or better:
This command also worked for me: