This problem exists if in table more than 10 rows
eg.
CREATE TABLE `action` (
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`create_ts` int(10) unsigned DEFAULT '0',
|
PRIMARY KEY (`id`)
|
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
|
|
# and my test for this table
|
# 1) creating routine
|
|
DELIMITER $$
|
DROP PROCEDURE IF EXISTS `p` $$
|
CREATE PROCEDURE p (IN step TINYINT(1))
|
BEGIN
|
DECLARE counts INT DEFAULT 0;
|
DECLARE cur1 CURSOR FOR
|
|
SELECT ct.id
|
FROM (SELECT NULL) AS z
|
JOIN (
|
SELECT id
|
FROM `action`
|
LIMIT 10
|
) AS ct
|
JOIN (SELECT NULL) AS x ON(
|
EXISTS(
|
SELECT 1
|
FROM `action`
|
WHERE id=ct.id
|
LIMIT 1
|
)
|
);
|
|
IF step=1 THEN
|
TRUNCATE action;
|
REPEAT
|
INSERT INTO `action`
|
(create_ts) VALUES
|
(UNIX_TIMESTAMP());
|
|
SET counts=counts+1;
|
UNTIL counts>150 END REPEAT;
|
|
SET max_sp_recursion_depth=1;
|
|
CALL p(2);
|
CALL p(2);
|
ELSEIF step=2 THEN
|
OPEN cur1; CLOSE cur1;
|
END IF;
|
END $$
|
DELIMITER ;
|
|
CALL p(1);
|
And as result - Lost connection to MySQL server during query
- relates to
-
MDEV-6054
ER_BAD_FIELD_ERROR (Unknown column in where clause) on the 2nd execution of PS
-
-
Stalled
{"report":{"fcp":1394.1000003814697,"ttfb":215,"pageVisibility":"visible","entityId":29800,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"7045d880-e8b3-47de-ac38-ff0e36dc2935","navigationType":0,"readyForUser":1501.7000002861023,"redirectCount":0,"resourceLoadedEnd":904.4000000953674,"resourceLoadedStart":223.90000009536743,"resourceTiming":[{"duration":103.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":223.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":223.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":327.5,"responseStart":0,"secureConnectionStart":0},{"duration":103.69999980926514,"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":224.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":224.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":327.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":402.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":224.40000009536743,"connectEnd":224.40000009536743,"connectStart":224.40000009536743,"domainLookupEnd":224.40000009536743,"domainLookupStart":224.40000009536743,"fetchStart":224.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":332.40000009536743,"responseEnd":626.9000000953674,"responseStart":351.80000019073486,"secureConnectionStart":224.40000009536743},{"duration":679.9000000953674,"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":224.5,"connectEnd":224.5,"connectStart":224.5,"domainLookupEnd":224.5,"domainLookupStart":224.5,"fetchStart":224.5,"redirectEnd":0,"redirectStart":0,"requestStart":332.7000002861023,"responseEnd":904.4000000953674,"responseStart":359.2000002861023,"secureConnectionStart":224.5},{"duration":125.69999980926514,"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":224.7000002861023,"connectEnd":224.7000002861023,"connectStart":224.7000002861023,"domainLookupEnd":224.7000002861023,"domainLookupStart":224.7000002861023,"fetchStart":224.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":332.80000019073486,"responseEnd":350.40000009536743,"responseStart":346.2000002861023,"secureConnectionStart":224.7000002861023},{"duration":131.09999990463257,"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":224.90000009536743,"connectEnd":224.90000009536743,"connectStart":224.90000009536743,"domainLookupEnd":224.90000009536743,"domainLookupStart":224.90000009536743,"fetchStart":224.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":333,"responseEnd":356,"responseStart":353.90000009536743,"secureConnectionStart":224.90000009536743},{"duration":127.90000009536743,"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":225,"connectEnd":225,"connectStart":225,"domainLookupEnd":225,"domainLookupStart":225,"fetchStart":225,"redirectEnd":0,"redirectStart":0,"requestStart":333,"responseEnd":352.90000009536743,"responseStart":351,"secureConnectionStart":225},{"duration":103.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":225.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":225.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":328.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":137,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":225.40000009536743,"connectEnd":225.40000009536743,"connectStart":225.40000009536743,"domainLookupEnd":225.40000009536743,"domainLookupStart":225.40000009536743,"fetchStart":225.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":333.5,"responseEnd":362.40000009536743,"responseStart":360.7000002861023,"secureConnectionStart":225.40000009536743},{"duration":103.69999980926514,"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":225.60000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":225.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":329.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":154.90000009536743,"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":225.7000002861023,"connectEnd":225.7000002861023,"connectStart":225.7000002861023,"domainLookupEnd":225.7000002861023,"domainLookupStart":225.7000002861023,"fetchStart":225.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":333.7000002861023,"responseEnd":380.6000003814697,"responseStart":354.6000003814697,"secureConnectionStart":225.7000002861023},{"duration":628.1999998092651,"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":251.60000038146973,"connectEnd":251.60000038146973,"connectStart":251.60000038146973,"domainLookupEnd":251.60000038146973,"domainLookupStart":251.60000038146973,"fetchStart":251.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":503,"responseEnd":879.8000001907349,"responseStart":876.4000000953674,"secureConnectionStart":251.60000038146973},{"duration":621.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":258.6000003814697,"connectEnd":258.6000003814697,"connectStart":258.6000003814697,"domainLookupEnd":258.6000003814697,"domainLookupStart":258.6000003814697,"fetchStart":258.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":557,"responseEnd":880.1000003814697,"responseStart":878.2000002861023,"secureConnectionStart":258.6000003814697},{"duration":254,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":815.1000003814697,"connectEnd":815.1000003814697,"connectStart":815.1000003814697,"domainLookupEnd":815.1000003814697,"domainLookupStart":815.1000003814697,"fetchStart":815.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":966.9000000953674,"responseEnd":1069.1000003814697,"responseStart":1066.7000002861023,"secureConnectionStart":815.1000003814697},{"duration":532,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1295.4000000953674,"connectEnd":1295.4000000953674,"connectStart":1295.4000000953674,"domainLookupEnd":1295.4000000953674,"domainLookupStart":1295.4000000953674,"fetchStart":1295.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1793.6000003814697,"responseEnd":1827.4000000953674,"responseStart":1826.2000002861023,"secureConnectionStart":1295.4000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":47,"responseStart":215,"responseEnd":258,"domLoading":218,"domInteractive":1764,"domContentLoadedEventStart":1764,"domContentLoadedEventEnd":1899,"domComplete":2446,"loadEventStart":2446,"loadEventEnd":2447,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1597.7000002861023},{"name":"bigPipe.sidebar-id.end","time":1599},{"name":"bigPipe.activity-panel-pipe-id.start","time":1599.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":1602.2000002861023},{"name":"activityTabFullyLoaded","time":1954.3000001907349}],"measures":[],"correlationId":"1f181472ff2d7d","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":98,"dbReadsTimeInMs":11,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Thank you for the report and the test case.
#3 <signal handler called>
#4 0x000000000069260f in optimize_keyuse (join=0x7feea47f17e0, keyuse_array=0x7feea47f1ae8) at 10.0/sql/sql_select.cc:5350
#5 0x000000000068ebd2 in make_join_statistics (join=0x7feea47f17e0, tables_list=..., conds=0x7feea47efbc8, keyuse_array=0x7feea47f1ae8) at 10.0/sql/sql_select.cc:3985
#6 0x00000000006856db in JOIN::optimize_inner (this=0x7feea47f17e0) at 10.0/sql/sql_select.cc:1328
#7 0x000000000068460a in JOIN::optimize (this=0x7feea47f17e0) at 10.0/sql/sql_select.cc:1013
#8 0x0000000000643493 in st_select_lex::optimize_unflattened_subqueries (this=0x7feea4544828, const_only=false) at 10.0/sql/sql_lex.cc:3480
#9 0x00000000007bd24c in JOIN::optimize_unflattened_subqueries (this=0x7feea47f1278) at 10.0/sql/opt_subselect.cc:4951
#10 0x00000000006870fd in JOIN::optimize_inner (this=0x7feea47f1278) at 10.0/sql/sql_select.cc:1772
#11 0x000000000068460a in JOIN::optimize (this=0x7feea47f1278) at 10.0/sql/sql_select.cc:1013
#12 0x000000000068c473 in mysql_select (thd=0x7feea63ec070, rref_pointer_array=0x7feea4544a98, tables=0x7feea4545a70, wild_num=0, fields=..., conds=0x7feea454eca0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x7feea47f10d8, unit=0x7feea4544148, select_lex=0x7feea4544828) at 10.0/sql/sql_select.cc:3280
#13 0x0000000000682960 in handle_select (thd=0x7feea63ec070, lex=0x7feea4544088, result=0x7feea47f10d8, setup_tables_done_option=0) at 10.0/sql/sql_select.cc:372
#14 0x00000000006566c0 in execute_sqlcom_select (thd=0x7feea63ec070, all_tables=0x7feea4545a70) at 10.0/sql/sql_parse.cc:5250
#15 0x000000000064e7cc in mysql_execute_command (thd=0x7feea63ec070) at 10.0/sql/sql_parse.cc:2571
#16 0x00000000009962b2 in mysql_open_cursor (thd=0x7feea63ec070, result=0x7feea474d510, pcursor=0x7feea474d540) at 10.0/sql/sql_cursor.cc:123
#17 0x0000000000986f0c in sp_cursor::open (this=0x7feea474d508, thd=0x7feea63ec070) at 10.0/sql/sp_rcontext.cc:456
#18 0x0000000000981cdf in sp_instr_copen::exec_core (this=0x7feea47c3f70, thd=0x7feea63ec070, nextp=0x7feeaec9a6a8) at 10.0/sql/sp_head.cc:3773
#19 0x00000000009800bb in sp_lex_keeper::reset_lex_and_exec_core (this=0x7feea454f480, thd=0x7feea63ec070, nextp=0x7feeaec9a6a8, open_tables=false, instr=0x7feea47c3f70) at 10.0/sql/sp_head.cc:2954
#20 0x0000000000981c44 in sp_instr_copen::execute (this=0x7feea47c3f70, thd=0x7feea63ec070, nextp=0x7feeaec9a6a8) at 10.0/sql/sp_head.cc:3758
#21 0x000000000097c252 in sp_head::execute (this=0x7feea474f088, thd=0x7feea63ec070, merge_da_on_success=true) at 10.0/sql/sp_head.cc:1360
#22 0x000000000097e060 in sp_head::execute_procedure (this=0x7feea474f088, thd=0x7feea63ec070, args=0x7feea45ecdd8) at 10.0/sql/sp_head.cc:2147
#23 0x00000000006548ef in mysql_execute_command (thd=0x7feea63ec070) at 10.0/sql/sql_parse.cc:4662
#24 0x0000000000980962 in sp_instr_stmt::exec_core (this=0x7feea45e2ed8, thd=0x7feea63ec070, nextp=0x7feeaec9b6d8) at 10.0/sql/sp_head.cc:3184
#25 0x00000000009800bb in sp_lex_keeper::reset_lex_and_exec_core (this=0x7feea45e2f18, thd=0x7feea63ec070, nextp=0x7feeaec9b6d8, open_tables=false, instr=0x7feea45e2ed8) at 10.0/sql/sp_head.cc:2954
#26 0x0000000000980674 in sp_instr_stmt::execute (this=0x7feea45e2ed8, thd=0x7feea63ec070, nextp=0x7feeaec9b6d8) at 10.0/sql/sp_head.cc:3103
#27 0x000000000097c252 in sp_head::execute (this=0x7feea45bc088, thd=0x7feea63ec070, merge_da_on_success=true) at 10.0/sql/sp_head.cc:1360
#28 0x000000000097e060 in sp_head::execute_procedure (this=0x7feea45bc088, thd=0x7feea63ec070, args=0x7feea63f09c8) at 10.0/sql/sp_head.cc:2147
#29 0x00000000006548ef in mysql_execute_command (thd=0x7feea63ec070) at 10.0/sql/sql_parse.cc:4662
#30 0x0000000000658f26 in mysql_parse (thd=0x7feea63ec070, rawbuf=0x7feea4503088 "CALL p(1)", length=9, parser_state=0x7feeaec9c4b0) at 10.0/sql/sql_parse.cc:6394
#31 0x000000000064b8a8 in dispatch_command (command=COM_QUERY, thd=0x7feea63ec070, packet=0x7feea6f35071 "CALL p(1)", packet_length=9) at 10.0/sql/sql_parse.cc:1296
#32 0x000000000064abf6 in do_command (thd=0x7feea63ec070) at 10.0/sql/sql_parse.cc:993
#33 0x000000000076b705 in do_handle_one_connection (thd_arg=0x7feea63ec070) at 10.0/sql/sql_connect.cc:1379
#34 0x000000000076b458 in handle_one_connection (arg=0x7feea63ec070) at 10.0/sql/sql_connect.cc:1293
#35 0x0000000000a1219b in pfs_spawn_thread (arg=0x7feea625b850) at 10.0/storage/perfschema/pfs.cc:1853
#36 0x00007feeae073e9a in start_thread (arg=0x7feeaec9d700) at pthread_create.c:308
#37 0x00007feeacf673fd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#38 0x0000000000000000 in ?? ()