"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":1431.6000000238419,"ttfb":526.2000000476837,"pageVisibility":"visible","entityId":130647,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"11cd30cd-260c-485b-ab27-605407b52216","navigationType":0,"readyForUser":1506.2000000476837,"redirectCount":0,"resourceLoadedEnd":1262,"resourceLoadedStart":581.1000000238419,"resourceTiming":[{"duration":96.79999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":581.1000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":581.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":677.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":96.60000002384186,"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":581.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":581.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":678.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":250.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":581.6000000238419,"connectEnd":581.6000000238419,"connectStart":581.6000000238419,"domainLookupEnd":581.6000000238419,"domainLookupStart":581.6000000238419,"fetchStart":581.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":677,"responseEnd":832.3999999761581,"responseStart":690.3999999761581,"secureConnectionStart":581.6000000238419},{"duration":308.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":581.8999999761581,"connectEnd":581.8999999761581,"connectStart":581.8999999761581,"domainLookupEnd":581.8999999761581,"domainLookupStart":581.8999999761581,"fetchStart":581.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":678,"responseEnd":890.3999999761581,"responseStart":733,"secureConnectionStart":581.8999999761581},{"duration":199.29999995231628,"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":582.1000000238419,"connectEnd":582.1000000238419,"connectStart":582.1000000238419,"domainLookupEnd":582.1000000238419,"domainLookupStart":582.1000000238419,"fetchStart":582.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":679.2999999523163,"responseEnd":781.3999999761581,"responseStart":735.3999999761581,"secureConnectionStart":582.1000000238419},{"duration":231.69999992847443,"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":582.2000000476837,"connectEnd":582.2000000476837,"connectStart":582.2000000476837,"domainLookupEnd":582.2000000476837,"domainLookupStart":582.2000000476837,"fetchStart":582.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":680.2999999523163,"responseEnd":813.8999999761581,"responseStart":798.8999999761581,"secureConnectionStart":582.2000000476837},{"duration":236,"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":582.3999999761581,"connectEnd":582.3999999761581,"connectStart":582.3999999761581,"domainLookupEnd":582.3999999761581,"domainLookupStart":582.3999999761581,"fetchStart":582.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":683.2000000476837,"responseEnd":818.3999999761581,"responseStart":817.7000000476837,"secureConnectionStart":582.3999999761581},{"duration":98.10000002384186,"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":582.6000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":582.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":680.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":242.30000007152557,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":582.7999999523163,"connectEnd":582.7999999523163,"connectStart":582.7999999523163,"domainLookupEnd":582.7999999523163,"domainLookupStart":582.7999999523163,"fetchStart":582.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":684.3999999761581,"responseEnd":825.1000000238419,"responseStart":824,"secureConnectionStart":582.7999999523163},{"duration":99.80000007152557,"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":582.8999999761581,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":582.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":682.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":240.59999990463257,"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":583.2000000476837,"connectEnd":583.2000000476837,"connectStart":583.2000000476837,"domainLookupEnd":583.2000000476837,"domainLookupStart":583.2000000476837,"fetchStart":583.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":685.8999999761581,"responseEnd":823.7999999523163,"responseStart":820.2999999523163,"secureConnectionStart":583.2000000476837},{"duration":655.7999999523163,"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":606,"connectEnd":606,"connectStart":606,"domainLookupEnd":606,"domainLookupStart":606,"fetchStart":606,"redirectEnd":0,"redirectStart":0,"requestStart":1087.7000000476837,"responseEnd":1261.7999999523163,"responseStart":1249,"secureConnectionStart":606},{"duration":594.3999999761581,"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":667.6000000238419,"connectEnd":667.6000000238419,"connectStart":667.6000000238419,"domainLookupEnd":667.6000000238419,"domainLookupStart":667.6000000238419,"fetchStart":667.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":1089.5,"responseEnd":1262,"responseStart":1252.6000000238419,"secureConnectionStart":667.6000000238419},{"duration":222.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1060,"connectEnd":1060,"connectStart":1060,"domainLookupEnd":1060,"domainLookupStart":1060,"fetchStart":1060,"redirectEnd":0,"redirectStart":0,"requestStart":1210.5,"responseEnd":1282.5,"responseStart":1263.1000000238419,"secureConnectionStart":1060},{"duration":212.60000002384186,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1338.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1338.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1550.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":216.89999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1397.2000000476837,"connectEnd":1397.2000000476837,"connectStart":1397.2000000476837,"domainLookupEnd":1397.2000000476837,"domainLookupStart":1397.2000000476837,"fetchStart":1397.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1559.7999999523163,"responseEnd":1614.1000000238419,"responseStart":1599.2999999523163,"secureConnectionStart":1397.2000000476837}],"fetchStart":0,"domainLookupStart":307,"domainLookupEnd":317,"connectStart":317,"connectEnd":337,"secureConnectionStart":326,"requestStart":338,"responseStart":526,"responseEnd":667,"domLoading":556,"domInteractive":1593,"domContentLoadedEventStart":1593,"domContentLoadedEventEnd":1640,"domComplete":1987,"loadEventStart":1987,"loadEventEnd":1987,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1554.6000000238419},{"name":"bigPipe.sidebar-id.end","time":1555.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1555.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":1560.1000000238419},{"name":"activityTabFullyLoaded","time":1662.6000000238419}],"measures":[],"correlationId":"aa4906d8d89ee8","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":118,"dbReadsTimeInMs":17,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
A workaround is:
or better:
This command also worked for me: