"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":856.0999999046326,"ttfb":270.19999980926514,"pageVisibility":"visible","entityId":130647,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":1,"journeyId":"c852259b-b840-4eec-beaf-f4d24608267e","navigationType":0,"readyForUser":947.5999999046326,"redirectCount":0,"resourceLoadedEnd":589.5999999046326,"resourceLoadedStart":277.5,"resourceTiming":[{"duration":10.299999713897705,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":277.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":277.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":287.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":10.400000095367432,"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":277.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":277.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":288.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":139.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":277.90000009536743,"connectEnd":277.90000009536743,"connectStart":277.90000009536743,"domainLookupEnd":277.90000009536743,"domainLookupStart":277.90000009536743,"fetchStart":277.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":290.59999990463257,"responseEnd":417,"responseStart":316.19999980926514,"secureConnectionStart":277.90000009536743},{"duration":311.5,"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":278.09999990463257,"connectEnd":278.09999990463257,"connectStart":278.09999990463257,"domainLookupEnd":278.09999990463257,"domainLookupStart":278.09999990463257,"fetchStart":278.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":295.40000009536743,"responseEnd":589.5999999046326,"responseStart":414.09999990463257,"secureConnectionStart":278.09999990463257},{"duration":45.80000019073486,"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":278.2999997138977,"connectEnd":278.2999997138977,"connectStart":278.2999997138977,"domainLookupEnd":278.2999997138977,"domainLookupStart":278.2999997138977,"fetchStart":278.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":295.69999980926514,"responseEnd":324.09999990463257,"responseStart":320.2999997138977,"secureConnectionStart":278.2999997138977},{"duration":45.5,"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":278.40000009536743,"connectEnd":278.40000009536743,"connectStart":278.40000009536743,"domainLookupEnd":278.40000009536743,"domainLookupStart":278.40000009536743,"fetchStart":278.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":295.59999990463257,"responseEnd":323.90000009536743,"responseStart":319.5,"secureConnectionStart":278.40000009536743},{"duration":46.09999990463257,"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":278.59999990463257,"connectEnd":278.59999990463257,"connectStart":278.59999990463257,"domainLookupEnd":278.59999990463257,"domainLookupStart":278.59999990463257,"fetchStart":278.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":296.2999997138977,"responseEnd":324.69999980926514,"responseStart":321.19999980926514,"secureConnectionStart":278.59999990463257},{"duration":15.599999904632568,"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":279,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":279,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":294.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":45.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":279.09999990463257,"connectEnd":279.09999990463257,"connectStart":279.09999990463257,"domainLookupEnd":279.09999990463257,"domainLookupStart":279.09999990463257,"fetchStart":279.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":298.90000009536743,"responseEnd":325,"responseStart":321.90000009536743,"secureConnectionStart":279.09999990463257},{"duration":16.100000381469727,"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":279.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":279.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":295.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":48.5,"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":279.5,"connectEnd":279.5,"connectStart":279.5,"domainLookupEnd":279.5,"domainLookupStart":279.5,"fetchStart":279.5,"redirectEnd":0,"redirectStart":0,"requestStart":299,"responseEnd":328,"responseStart":322.7999997138977,"secureConnectionStart":279.5},{"duration":302.30000019073486,"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":283.59999990463257,"connectEnd":283.59999990463257,"connectStart":283.59999990463257,"domainLookupEnd":283.59999990463257,"domainLookupStart":283.59999990463257,"fetchStart":283.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":335.19999980926514,"responseEnd":585.9000000953674,"responseStart":582.2999997138977,"secureConnectionStart":283.59999990463257},{"duration":302.5,"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":284.19999980926514,"connectEnd":284.19999980926514,"connectStart":284.19999980926514,"domainLookupEnd":284.19999980926514,"domainLookupStart":284.19999980926514,"fetchStart":284.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":335.40000009536743,"responseEnd":586.6999998092651,"responseStart":584.1999998092651,"secureConnectionStart":284.19999980926514},{"duration":121.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":573.5999999046326,"connectEnd":573.5999999046326,"connectStart":573.5999999046326,"domainLookupEnd":573.5999999046326,"domainLookupStart":573.5999999046326,"fetchStart":573.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":664.2999997138977,"responseEnd":694.7999997138977,"responseStart":694.1999998092651,"secureConnectionStart":573.5999999046326},{"duration":239.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":814.0999999046326,"connectEnd":814.0999999046326,"connectStart":814.0999999046326,"domainLookupEnd":814.0999999046326,"domainLookupStart":814.0999999046326,"fetchStart":814.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1018,"responseEnd":1053.1999998092651,"responseStart":1052.5999999046326,"secureConnectionStart":814.0999999046326},{"duration":201,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":850.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":850.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1051.4000000953674,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":68,"responseStart":270,"responseEnd":282,"domLoading":273,"domInteractive":1068,"domContentLoadedEventStart":1068,"domContentLoadedEventEnd":1131,"domComplete":1424,"loadEventStart":1424,"loadEventEnd":1424,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1024.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1024.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1025.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1029.5999999046326},{"name":"activityTabFullyLoaded","time":1155.2999997138977}],"measures":[],"correlationId":"25dfd9a30f411","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":120,"dbReadsTimeInMs":15,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
A workaround is:
or better:
This command also worked for me: