Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.6
Environment:
Focal, mariadb:latest tag
When using the query for REST API (note you need to have curl installed:
MariaDB [test]> create table cusers3 engine= connect http= 'http://jsonplaceholder.typicode.com/users' table_type=json;
The result is:
when used locally (VM Ubuntu Focal, MariaDB 10.6) , the result is:
Query OK, 0 rows affected, 1 warning (0.140 sec)
MariaDB [test]> show grants for current_user ;
+ -----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for anel@localhost |
+ -----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO `anel`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket WITH GRANT OPTION |
+ -----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
MariaDB [test]> show create table cusers3\G
*************************** 1. row ***************************
Table : cusers3
Create Table : CREATE TABLE `cusers3` (
`id` int (2) NOT NULL `JPATH`= '$.id' ,
` name ` char (24) NOT NULL `JPATH`= '$.name' ,
`username` char (16) NOT NULL `JPATH`= '$.username' ,
`email` char (25) NOT NULL `JPATH`= '$.email' ,
`address_street` char (17) NOT NULL `JPATH`= '$.address.street' ,
`address_suite` char (9) NOT NULL `JPATH`= '$.address.suite' ,
`address_city` char (14) NOT NULL `JPATH`= '$.address.city' ,
`address_zipcode` char (10) NOT NULL `JPATH`= '$.address.zipcode' ,
`address_geo_lat` char (8) NOT NULL `JPATH`= '$.address.geo.lat' ,
`address_geo_lng` char (9) NOT NULL `JPATH`= '$.address.geo.lng' ,
`phone` char (21) NOT NULL `JPATH`= '$.phone' ,
`website` char (13) NOT NULL `JPATH`= '$.website' ,
`company_name` char (18) NOT NULL `JPATH`= '$.company.name' ,
`company_catchPhrase` char (40) NOT NULL `JPATH`= '$.company.catchPhrase' ,
`company_bs` char (36) NOT NULL `JPATH`= '$.company.bs'
) ENGINE= CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`= 'json' `HTTP`= 'http://jsonplaceholder.typicode.com/users'
1 row in set (0.000 sec)
in Docker is an error
MariaDB [web_users]> create table cusers3 engine= connect http= 'http://jsonplaceholder.typicode.com/users' table_type=json;
ERROR 1105 (HY000): Can only retrieve columns from object rows
MariaDB [web_users]> select current_user ;
+ ----------------+
| current_user |
+ ----------------+
| root@localhost |
+ ----------------+
MariaDB [web_users]> show grants for current_user ;
+ ----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost |
+ ----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*EC427DF1E97E95DCB88D86BEDFE9AF58AE7D3563' WITH GRANT OPTION |
| GRANT PROXY ON '' @ '%' TO 'root' @ 'localhost' WITH GRANT OPTION |
+ ----------------------------------------------------------------------------------------------------------------------------------------+
The first thing CONNECT is doing is to create the file (in above example cusers.json , and from it is doing table discovery.
In Docker file is created in data directory - /var/lib/mysql/web_users , directory that has file permissions of mysql:mysql .
My testing involved different tests regarding curl versions (Ubuntu bionic default 7.58 and Focal default 7.68), hoping to get different types of files, but no, it is not curl related.
I tested locally on Focal VM and it works, so my conclusion is that has something to do with Docker permissions.
Docker container is started with:
docker run -d -e MARIADB_USER=anel \
-e MARIADB_PASSWORD=anel -e MARIADB_DATABASE=web_users \
-e MARIADB_RANDOM_ROOT_PASSWORD=1 \
-e MARIADB_ROOT_HOST=mariadb_server1 \
-v $PWD/my_container_files:/etc/mysql/conf.d \
--name mariadb-server1 \
mariadb:latest
where the config file in my_container_files/ dir is:
printf "[mariadb]\nplugin-load-add=ha_connect\nplugin_dir=/usr/lib/mysql/plugin\n" >my_container.conf
Haven't tested in other images but expecting to have the same behavior.
{"report":{"fcp":942.3999996185303,"ttfb":231.60000038146973,"pageVisibility":"visible","entityId":103458,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"ceab2a51-3b9f-4da0-92c7-4597ac891648","navigationType":0,"readyForUser":1071.6999998092651,"redirectCount":0,"resourceLoadedEnd":1190.5,"resourceLoadedStart":237.69999980926514,"resourceTiming":[{"duration":200.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":237.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":237.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":438.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":200.5999994277954,"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":238.10000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":238.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":438.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":209.9000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":238.19999980926514,"connectEnd":238.19999980926514,"connectStart":238.19999980926514,"domainLookupEnd":238.19999980926514,"domainLookupStart":238.19999980926514,"fetchStart":238.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":238.19999980926514,"responseEnd":448.1000003814697,"responseStart":448.1000003814697,"secureConnectionStart":238.19999980926514},{"duration":290.70000076293945,"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":238.39999961853027,"connectEnd":238.39999961853027,"connectStart":238.39999961853027,"domainLookupEnd":238.39999961853027,"domainLookupStart":238.39999961853027,"fetchStart":238.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":238.39999961853027,"responseEnd":529.1000003814697,"responseStart":529.1000003814697,"secureConnectionStart":238.39999961853027},{"duration":295.29999923706055,"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":238.60000038146973,"connectEnd":238.60000038146973,"connectStart":238.60000038146973,"domainLookupEnd":238.60000038146973,"domainLookupStart":238.60000038146973,"fetchStart":238.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":238.60000038146973,"responseEnd":533.8999996185303,"responseStart":533.8999996185303,"secureConnectionStart":238.60000038146973},{"duration":295.69999980926514,"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":238.69999980926514,"connectEnd":238.69999980926514,"connectStart":238.69999980926514,"domainLookupEnd":238.69999980926514,"domainLookupStart":238.69999980926514,"fetchStart":238.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":238.69999980926514,"responseEnd":534.3999996185303,"responseStart":534.3999996185303,"secureConnectionStart":238.69999980926514},{"duration":295.80000019073486,"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":239,"connectEnd":239,"connectStart":239,"domainLookupEnd":239,"domainLookupStart":239,"fetchStart":239,"redirectEnd":0,"redirectStart":0,"requestStart":239,"responseEnd":534.8000001907349,"responseStart":534.8000001907349,"secureConnectionStart":239},{"duration":358.6000003814697,"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":239.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":239.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":597.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":296,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":239.30000019073486,"connectEnd":239.30000019073486,"connectStart":239.30000019073486,"domainLookupEnd":239.30000019073486,"domainLookupStart":239.30000019073486,"fetchStart":239.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":239.30000019073486,"responseEnd":535.3000001907349,"responseStart":535.3000001907349,"secureConnectionStart":239.30000019073486},{"duration":358.29999923706055,"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":239.60000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":239.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":597.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":296.69999980926514,"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":239.69999980926514,"connectEnd":239.69999980926514,"connectStart":239.69999980926514,"domainLookupEnd":239.69999980926514,"domainLookupStart":239.69999980926514,"fetchStart":239.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":239.69999980926514,"responseEnd":536.3999996185303,"responseStart":536.3000001907349,"secureConnectionStart":239.69999980926514},{"duration":944.8000001907349,"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":245.30000019073486,"connectEnd":245.30000019073486,"connectStart":245.30000019073486,"domainLookupEnd":245.30000019073486,"domainLookupStart":245.30000019073486,"fetchStart":245.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":245.30000019073486,"responseEnd":1190.1000003814697,"responseStart":1190,"secureConnectionStart":245.30000019073486},{"duration":945.1000003814697,"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":245.39999961853027,"connectEnd":245.39999961853027,"connectStart":245.39999961853027,"domainLookupEnd":245.39999961853027,"domainLookupStart":245.39999961853027,"fetchStart":245.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":245.39999961853027,"responseEnd":1190.5,"responseStart":1190.5,"secureConnectionStart":245.39999961853027},{"duration":426.70000076293945,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":625.8999996185303,"connectEnd":625.8999996185303,"connectStart":625.8999996185303,"domainLookupEnd":625.8999996185303,"domainLookupStart":625.8999996185303,"fetchStart":625.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":625.8999996185303,"responseEnd":1052.6000003814697,"responseStart":1052.6000003814697,"secureConnectionStart":625.8999996185303},{"duration":286.80000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":934.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":934.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1221.6999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":59,"responseStart":231,"responseEnd":238,"domLoading":235,"domInteractive":1225,"domContentLoadedEventStart":1225,"domContentLoadedEventEnd":1280,"domComplete":2132,"loadEventStart":2132,"loadEventEnd":2134,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1199.3000001907349},{"name":"bigPipe.sidebar-id.end","time":1200.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1200.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1205.5},{"name":"activityTabFullyLoaded","time":1288}],"measures":[],"correlationId":"9557f8025d611d","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":105,"dbReadsTimeInMs":12,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}