If you create a server object in MariaDB, and then create a Spider table that depends on that server, and then you have recreate the server for whatever reason, Spider continues to use the old definition.
e.g. if I do the following on the remote server:
CREATE DATABASE spider_test;
|
|
GRANT ALL PRIVILEGES ON spider_test.* TO spider_test@'%' IDENTIFIED BY 'password';
|
|
USE spider_test;
|
|
CREATE TABLE local_tab (
|
id int auto_increment primary key,
|
str varchar(50)
|
) ENGINE=InnoDB;
|
And then the following on the Spider server:
CREATE SERVER srv1
|
FOREIGN DATA WRAPPER mysql
|
OPTIONS(
|
HOST 'hostdoesntexist',
|
DATABASE 'spider_test',
|
USER 'spider_test',
|
PASSWORD 'password'
|
);
|
|
CREATE DATABASE spider_test;
|
|
USE spider_test;
|
|
CREATE TABLE spider_tab (
|
id int auto_increment primary key,
|
str varchar(50)
|
) ENGINE=Spider COMMENT='wrapper "mysql", srv "srv1", table "local_tab"';
|
This is obviously a bad server definition, so querying this table will fail:
MariaDB [spider_test]> SELECT * FROM spider_tab;
|
ERROR 1429 (HY000): Unable to connect to foreign data source: srv1
|
So the intuitive fix would be to drop the server object and recreate it with the fixed parameters:
DROP SERVER srv1;
|
|
CREATE SERVER srv1
|
FOREIGN DATA WRAPPER mysql
|
OPTIONS(
|
HOST '172.30.0.249',
|
DATABASE 'spider_test',
|
USER 'spider_test',
|
PASSWORD 'password'
|
);
|
However, Spider still seems to use the old definition of the server object:
MariaDB [spider_test]> SELECT * FROM spider_tab;
|
ERROR 1429 (HY000): Unable to connect to foreign data source: srv1
|
Dropping the table and recreating it with the same definition allows the table to work:
MariaDB [spider_test]> SELECT * FROM spider_tab;
|
ERROR 1429 (HY000): Unable to connect to foreign data source: srv1
|
MariaDB [spider_test]> SHOW CREATE TABLE spider_tab\G
|
*************************** 1. row ***************************
|
Table: spider_tab
|
Create Table: CREATE TABLE `spider_tab` (
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`str` varchar(50) DEFAULT NULL,
|
PRIMARY KEY (`id`)
|
) ENGINE=SPIDER DEFAULT CHARSET=latin1 COMMENT='wrapper "mysql", srv "srv1", table "local_tab"'
|
1 row in set, 2 warnings (0.00 sec)
|
|
MariaDB [spider_test]> DROP TABLE spider_tab;
|
Query OK, 0 rows affected (0.01 sec)
|
|
MariaDB [spider_test]> CREATE TABLE `spider_tab` (
|
-> `id` int(11) NOT NULL AUTO_INCREMENT,
|
-> `str` varchar(50) DEFAULT NULL,
|
-> PRIMARY KEY (`id`)
|
-> ) ENGINE=SPIDER DEFAULT CHARSET=latin1 COMMENT='wrapper "mysql", srv "srv1", table "local_tab"';
|
Query OK, 0 rows affected (0.01 sec)
|
|
MariaDB [spider_test]> SELECT * FROM spider_tab;
|
Empty set (0.01 sec)
|
{"report":{"fcp":807.1999998092651,"ttfb":250.19999980926514,"pageVisibility":"visible","entityId":66557,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":1,"journeyId":"a7023fd9-ed87-48db-b06b-9394865b294c","navigationType":0,"readyForUser":926.0999999046326,"redirectCount":0,"resourceLoadedEnd":884.8999996185303,"resourceLoadedStart":255.69999980926514,"resourceTiming":[{"duration":17,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":255.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":255.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":272.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":17.199999809265137,"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":256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":273.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":77.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":256.19999980926514,"connectEnd":256.19999980926514,"connectStart":256.19999980926514,"domainLookupEnd":256.19999980926514,"domainLookupStart":256.19999980926514,"fetchStart":256.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":256.19999980926514,"responseEnd":333.2999997138977,"responseStart":333.2999997138977,"secureConnectionStart":256.19999980926514},{"duration":160.7000002861023,"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":256.3999996185303,"connectEnd":256.3999996185303,"connectStart":256.3999996185303,"domainLookupEnd":256.3999996185303,"domainLookupStart":256.3999996185303,"fetchStart":256.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":256.3999996185303,"responseEnd":417.09999990463257,"responseStart":417.09999990463257,"secureConnectionStart":256.3999996185303},{"duration":164.19999980926514,"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":256.69999980926514,"connectEnd":256.69999980926514,"connectStart":256.69999980926514,"domainLookupEnd":256.69999980926514,"domainLookupStart":256.69999980926514,"fetchStart":256.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":256.69999980926514,"responseEnd":420.8999996185303,"responseStart":420.8999996185303,"secureConnectionStart":256.69999980926514},{"duration":164.59999990463257,"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":256.7999997138977,"connectEnd":256.7999997138977,"connectStart":256.7999997138977,"domainLookupEnd":256.7999997138977,"domainLookupStart":256.7999997138977,"fetchStart":256.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":256.7999997138977,"responseEnd":421.3999996185303,"responseStart":421.3999996185303,"secureConnectionStart":256.7999997138977},{"duration":164.7999997138977,"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":257,"connectEnd":257,"connectStart":257,"domainLookupEnd":257,"domainLookupStart":257,"fetchStart":257,"redirectEnd":0,"redirectStart":0,"requestStart":257,"responseEnd":421.7999997138977,"responseStart":421.7999997138977,"secureConnectionStart":257},{"duration":224.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":257.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":257.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":481.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":165,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":257.2999997138977,"connectEnd":257.2999997138977,"connectStart":257.2999997138977,"domainLookupEnd":257.2999997138977,"domainLookupStart":257.2999997138977,"fetchStart":257.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":257.2999997138977,"responseEnd":422.2999997138977,"responseStart":422.2999997138977,"secureConnectionStart":257.2999997138977},{"duration":224.19999980926514,"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":257.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":257.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":481.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":165.30000019073486,"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":257.69999980926514,"connectEnd":257.69999980926514,"connectStart":257.69999980926514,"domainLookupEnd":257.69999980926514,"domainLookupStart":257.69999980926514,"fetchStart":257.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":257.69999980926514,"responseEnd":423,"responseStart":423,"secureConnectionStart":257.69999980926514},{"duration":291.7999997138977,"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":258.5,"connectEnd":258.5,"connectStart":258.5,"domainLookupEnd":258.5,"domainLookupStart":258.5,"fetchStart":258.5,"redirectEnd":0,"redirectStart":0,"requestStart":258.5,"responseEnd":550.2999997138977,"responseStart":550.2999997138977,"secureConnectionStart":258.5},{"duration":396.2000002861023,"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":262.8999996185303,"connectEnd":262.8999996185303,"connectStart":262.8999996185303,"domainLookupEnd":262.8999996185303,"domainLookupStart":262.8999996185303,"fetchStart":262.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":262.8999996185303,"responseEnd":659.0999999046326,"responseStart":659.0999999046326,"secureConnectionStart":262.8999996185303},{"duration":76.7000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":499.3999996185303,"connectEnd":499.3999996185303,"connectStart":499.3999996185303,"domainLookupEnd":499.3999996185303,"domainLookupStart":499.3999996185303,"fetchStart":499.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":499.3999996185303,"responseEnd":576.0999999046326,"responseStart":576.0999999046326,"secureConnectionStart":499.3999996185303},{"duration":125.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&slack-enabled=true&whisper-enabled=true","startTime":759.1999998092651,"connectEnd":759.1999998092651,"connectStart":759.1999998092651,"domainLookupEnd":759.1999998092651,"domainLookupStart":759.1999998092651,"fetchStart":759.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":759.1999998092651,"responseEnd":884.8999996185303,"responseStart":884.8999996185303,"secureConnectionStart":759.1999998092651},{"duration":182.7999997138977,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":800.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":800.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":983.2999997138977,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":85,"responseStart":250,"responseEnd":256,"domLoading":254,"domInteractive":993,"domContentLoadedEventStart":993,"domContentLoadedEventEnd":1042,"domComplete":1193,"loadEventStart":1193,"loadEventEnd":1193,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":967.0999999046326},{"name":"bigPipe.sidebar-id.end","time":967.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.start","time":967.8999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":969.5},{"name":"activityTabFullyLoaded","time":1056.3999996185303}],"measures":[],"correlationId":"74d811a4a7b14e","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":9,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Kenneth Dyer has documented the need for using FLUSH TABLES after changing a server definition: Unable-to-Connect-Errors