I don't use the critical priority frivolously, but I have a query that always works on a mysql server, but only once at the first execution every 20 to 60 minutes on a MariaDB server. I am able to reproduce, that the query gives a different (wrong) result, if executed a few seconds after it gave the correct result. It also runs about 10 times slower on MariaDB than on mysql 5.7.
I am ready to give you more information than just the query, but the data is sensitive. I have a pseudonymized database dump (101 MB compressed) and a screen recording (87 MB) that I could send to the developers who want to look into the problem. The screen recording shows me executing the query twice with different results and a proof via query log and diff tool, that the queries are the same.
I filed this issue under "Data Definition - Temporary" because I did not find a component for issues with query results and had a vague feeling, that the temporary table has to do with it. However, I tried renaming it every time, but to no avail! Could it be the query cache?
This bug affects our production environment.
I appended the query results with columns separated by tabs, since I could not display them cleanly with this editor.
Here is the query:
DROP TEMPORARY TABLE IF EXISTS top5ads;
|
|
CREATE TEMPORARY TABLE top5ads (click_count INT(10) UNSIGNED, ad_id INT(10) UNSIGNED);
|
|
INSERT INTO top5ads (click_count, ad_id)
|
SELECT
|
COUNT(*) AS click_count,
|
ads.id AS ad_id
|
FROM
|
employ__ad_clicks ad_clicks
|
JOIN employ__ads ads ON ads.id = ad_clicks.ad_id
|
JOIN employ__companies cmps ON cmps.id = ads.company_id
|
WHERE
|
cmps.vdma_company_id > 0 AND
|
ads.job_type_id IN (1,2,3,4,5,13,19) AND
|
ad_clicks.host <> '' AND
|
-- {job_type_id} AND
|
click_date BETWEEN '2018-01-01' AND '2018-07-01'
|
GROUP BY
|
ads.id
|
ORDER BY
|
click_count DESC
|
LIMIT 5;
|
|
SELECT
|
click_count,
|
CONCAT
|
(
|
TRIM(ads.title), ' | ',
|
(
|
SELECT
|
CONCAT(pcs.postal_code, ' ', ad_pcs.city)
|
FROM
|
employ__ads_postal_codes ad_pcs
|
JOIN employ__postal_codes pcs ON pcs.id = ad_pcs.postal_code_id
|
WHERE
|
ad_pcs.ad_id = ads.id
|
LIMIT 1
|
), ' | ',
|
click_count,
|
'\n',
|
cmps.name, ' ', cmps.second_name, ' | ', DATE_FORMAT(ads.created_at, '%d.%m.%Y'), ' | ',
|
CASE WHEN
|
ads.published AND
|
CURRENT_DATE BETWEEN ads.publishes_at AND ads.ends_at
|
THEN
|
'online'
|
ELSE
|
'offline'
|
END
|
) AS ad_title,
|
ads.job_type_id,
|
ads.permalink,
|
mpgs_clicks_lists.mpgs_clicks_list,
|
'Top' AS x_label
|
FROM
|
top5ads
|
JOIN employ__ads ads ON ads.id = top5ads.ad_id
|
JOIN employ__companies cmps ON cmps.id = ads.company_id
|
JOIN
|
(
|
SELECT
|
adcs_ad_id,
|
GROUP_CONCAT(mpg_name_click_count ORDER BY mpg_name_click_count SEPARATOR '\n') AS mpgs_clicks_list
|
FROM
|
(
|
SELECT
|
adcs_ad_id,
|
CONCAT(click_counts_mpgs.name, ': ', click_counts_mpgs.click_count_mpg) AS mpg_name_click_count
|
FROM
|
(
|
SELECT
|
adcs.ad_id AS adcs_ad_id,
|
COUNT(*) as click_count_mpg,
|
mpgs.name
|
FROM
|
employ__ad_clicks adcs
|
JOIN employ__marketplace_group_hosts mpg_hosts ON adcs.host = mpg_hosts.name
|
JOIN employ__marketplace_groups mpgs ON mpgs.id = mpg_hosts.marketplace_group_id
|
WHERE
|
adcs.host <> '' AND
|
adcs.click_date BETWEEN '2018-01-01' AND '2018-07-01'
|
GROUP BY
|
mpgs.name,
|
adcs.ad_id
|
) click_counts_mpgs
|
) mpg_name_click_counts
|
GROUP BY
|
adcs_ad_id
|
ORDER BY mpg_name_click_counts.adcs_ad_id
|
)
|
mpgs_clicks_lists ON mpgs_clicks_lists.adcs_ad_id = ads.id;
|
|
- is duplicated by
-
MDEV-16182
innodb.temp_table_savepoint failed in buildbot with wrong result
-
-
Closed
{"report":{"fcp":704.4000000953674,"ttfb":206.5,"pageVisibility":"visible","entityId":68952,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"01d03dd9-1321-4f80-a496-d73a774e6f86","navigationType":0,"readyForUser":812.6000000238419,"redirectCount":0,"resourceLoadedEnd":720.6000000238419,"resourceLoadedStart":212.90000009536743,"resourceTiming":[{"duration":19.699999928474426,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":212.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":212.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":232.60000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":20.100000023841858,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":213.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":233.30000007152557,"responseStart":0,"secureConnectionStart":0},{"duration":77.69999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":213.30000007152557,"connectEnd":213.30000007152557,"connectStart":213.30000007152557,"domainLookupEnd":213.30000007152557,"domainLookupStart":213.30000007152557,"fetchStart":213.30000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":213.30000007152557,"responseEnd":291,"responseStart":291,"secureConnectionStart":213.30000007152557},{"duration":182.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":213.5,"connectEnd":213.5,"connectStart":213.5,"domainLookupEnd":213.5,"domainLookupStart":213.5,"fetchStart":213.5,"redirectEnd":0,"redirectStart":0,"requestStart":213.5,"responseEnd":396.10000002384186,"responseStart":396.10000002384186,"secureConnectionStart":213.5},{"duration":178.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":213.5,"connectEnd":213.5,"connectStart":213.5,"domainLookupEnd":213.5,"domainLookupStart":213.5,"fetchStart":213.5,"redirectEnd":0,"redirectStart":0,"requestStart":213.5,"responseEnd":392.10000002384186,"responseStart":392.10000002384186,"secureConnectionStart":213.5},{"duration":183.30000007152557,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":213.60000002384186,"connectEnd":213.60000002384186,"connectStart":213.60000002384186,"domainLookupEnd":213.60000002384186,"domainLookupStart":213.60000002384186,"fetchStart":213.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":213.60000002384186,"responseEnd":396.90000009536743,"responseStart":396.90000009536743,"secureConnectionStart":213.60000002384186},{"duration":185.60000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":213.80000007152557,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":399.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":184.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":213.80000007152557,"connectEnd":213.80000007152557,"connectStart":213.80000007152557,"domainLookupEnd":213.80000007152557,"domainLookupStart":213.80000007152557,"fetchStart":213.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":213.80000007152557,"responseEnd":398.7000000476837,"responseStart":398.7000000476837,"secureConnectionStart":213.80000007152557},{"duration":185.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":213.90000009536743,"connectEnd":213.90000009536743,"connectStart":213.90000009536743,"domainLookupEnd":213.90000009536743,"domainLookupStart":213.90000009536743,"fetchStart":213.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":213.90000009536743,"responseEnd":399.40000009536743,"responseStart":399.40000009536743,"secureConnectionStart":213.90000009536743},{"duration":187.30000007152557,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":214,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":401.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":187.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":214.20000004768372,"connectEnd":214.20000004768372,"connectStart":214.20000004768372,"domainLookupEnd":214.20000004768372,"domainLookupStart":214.20000004768372,"fetchStart":214.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":214.20000004768372,"responseEnd":401.40000009536743,"responseStart":401.40000009536743,"secureConnectionStart":214.20000004768372},{"duration":500.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":214.90000009536743,"connectEnd":214.90000009536743,"connectStart":214.90000009536743,"domainLookupEnd":214.90000009536743,"domainLookupStart":214.90000009536743,"fetchStart":214.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":214.90000009536743,"responseEnd":715.4000000953674,"responseStart":715.4000000953674,"secureConnectionStart":214.90000009536743},{"duration":505.6999999284744,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":214.90000009536743,"connectEnd":214.90000009536743,"connectStart":214.90000009536743,"domainLookupEnd":214.90000009536743,"domainLookupStart":214.90000009536743,"fetchStart":214.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":214.90000009536743,"responseEnd":720.6000000238419,"responseStart":720.6000000238419,"secureConnectionStart":214.90000009536743},{"duration":260.7999999523163,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":444.8000000715256,"connectEnd":444.8000000715256,"connectStart":444.8000000715256,"domainLookupEnd":444.8000000715256,"domainLookupStart":444.8000000715256,"fetchStart":444.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":444.8000000715256,"responseEnd":705.6000000238419,"responseStart":705.6000000238419,"secureConnectionStart":444.8000000715256},{"duration":26.799999952316284,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":696.3000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":696.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":723.1000000238419,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":19,"responseStart":206,"responseEnd":211,"domLoading":210,"domInteractive":951,"domContentLoadedEventStart":951,"domContentLoadedEventEnd":1012,"domComplete":1273,"loadEventStart":1273,"loadEventEnd":1274,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":928.1000000238419},{"name":"bigPipe.sidebar-id.end","time":929},{"name":"bigPipe.activity-panel-pipe-id.start","time":929.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.end","time":931},{"name":"activityTabFullyLoaded","time":1029.1000000238419}],"measures":[],"correlationId":"89dbdb8caadf6b","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
right, please use ftps://ftp.mariadb.com/ in this case