CREATE TABLE t1 (a INT, b INT, c VARCHAR(3)) ENGINE=MyISAM;
|
INSERT INTO t1 VALUES (1,1,'CAN'),(2,2,'AUS');
|
|
CREATE TABLE t2 (f INT) ENGINE=MyISAM;
|
INSERT INTO t2 VALUES (3);
|
|
SELECT * FROM t2 WHERE f NOT IN (
|
SELECT b FROM t1 WHERE 0 OR ( c IN ('USA') OR c NOT IN ('USA') ) AND a = b
|
);
|
Note: If the crash is not reproducible, run with valgrind.
#3 <signal handler called>
|
#4 0x000000000058a8bd in base_list_iterator::next_fast (this=0x7f06c9076f50) at sql_list.h:449
|
#5 0x000000000058cab5 in List_iterator_fast<Item>::operator++ (this=0x7f06c9076f50) at sql_list.h:561
|
#6 0x0000000000602d7c in Item_equal_iterator<List_iterator_fast, Item>::operator++ (this=0x7f06c9076f50) at item_cmpfunc.h:1824
|
#7 0x00000000005fe7a7 in Item_equal::contains (this=0x29c4370, field=0x29b5a90) at item_cmpfunc.cc:5603
|
#8 0x00000000005abe9f in Item_field::find_item_equal (this=0x298ded8, cond_equal=0x29bf8e8) at item.cc:4970
|
#9 0x0000000000745053 in eliminate_item_equal (cond=0x0, upper_levels=0x29bf8e8, item_equal=0x29c2198) at sql_select.cc:11945
|
#10 0x00000000007459b2 in substitute_for_best_equal_field (context_tab=0x1, cond=0x29c2198, cond_equal=0x29bf8e8, table_join_idx=0x29c2718) at sql_select.cc:12236
|
#11 0x0000000000745699 in substitute_for_best_equal_field (context_tab=0x1, cond=0x298e510, cond_equal=0x29c4758, table_join_idx=0x29c2718) at sql_select.cc:12163
|
#12 0x0000000000745699 in substitute_for_best_equal_field (context_tab=0x1, cond=0x29c4670, cond_equal=0x29c4758, table_join_idx=0x29c2718) at sql_select.cc:12163
|
#13 0x0000000000728878 in JOIN::optimize (this=0x29c04a0) at sql_select.cc:1253
|
#14 0x0000000000588e9b in st_select_lex::optimize_unflattened_subqueries (this=0x290b620) at sql_lex.cc:3166
|
#15 0x00000000008182bb in JOIN::optimize_unflattened_subqueries (this=0x29bfd08) at opt_subselect.cc:4903
|
#16 0x0000000000729b71 in JOIN::optimize (this=0x29bfd08) at sql_select.cc:1575
|
#17 0x000000000072ec11 in mysql_select (thd=0x2908b88, rref_pointer_array=0x290b878, tables=0x298cb60, wild_num=1, fields=..., conds=0x29bfbb8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=0x298e8a0, unit=0x290b118, select_lex=0x290b620) at sql_select.cc:2993
|
#18 0x000000000072570d in handle_select (thd=0x2908b88, lex=0x290b078, result=0x298e8a0, setup_tables_done_option=0) at sql_select.cc:288
|
#19 0x00000000006b4444 in execute_sqlcom_select (thd=0x2908b88, all_tables=0x298cb60) at sql_parse.cc:5172
|
#20 0x00000000006ab5e0 in mysql_execute_command (thd=0x2908b88) at sql_parse.cc:2305
|
#21 0x00000000006b6dab in mysql_parse (thd=0x2908b88, rawbuf=0x298c8c0 "SELECT * FROM t2 WHERE f NOT IN ( \nSELECT b FROM t1 WHERE 0 OR ( c IN ('USA') OR c NOT IN ('USA') ) AND a = b \n)", length=112, found_semicolon=0x7f06c9078cb8) at sql_parse.cc:6173
|
#22 0x00000000006a8dc0 in dispatch_command (command=COM_QUERY, thd=0x2908b88, packet=0x2983459 "SELECT * FROM t2 WHERE f NOT IN ( \nSELECT b FROM t1 WHERE 0 OR ( c IN ('USA') OR c NOT IN ('USA') ) AND a = b \n)", packet_length=112) at sql_parse.cc:1243
|
#23 0x00000000006a80ac in do_command (thd=0x2908b88) at sql_parse.cc:923
|
#24 0x00000000006a4f3d in handle_one_connection (arg=0x2908b88) at sql_connect.cc:1231
|
#25 0x00007f06d2867b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
|
#26 0x00007f06d1c0aa7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
|
Stack trace from:
revision-id: psergey@askmonty.org-20140214212653-cjbm9hqh0gpxapba
|
revno: 3758
|
branch-nick: 5.3
|
BUILD/compile-pentium-debug-max-no-ndb
|
The problem started appearing on 5.3 tree with the following revision:
revno: 3627
|
revision-id: igor@askmonty.org-20130222011312-0n7i0ki83efkz17e
|
parent: igor@askmonty.org-20130221032202-ed2p8w1a984bxa2p
|
committer: Igor Babaev <igor@askmonty.org>
|
branch nick: maria-5.3-mdev4172
|
timestamp: Thu 2013-02-21 17:13:12 -0800
|
message:
|
Fixed bug mdev-4172.
|
This bug in the legacy code could manifest itself in queries with
|
semi-join materialized subqueries.
|
...
|
{"report":{"fcp":1097.4000000059605,"ttfb":202.69999998807907,"pageVisibility":"visible","entityId":30931,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":16,"apdex":0.5,"journeyId":"6ca334ba-8247-4d9c-91cf-77cae4da4210","navigationType":0,"readyForUser":1200.4000000059605,"redirectCount":0,"resourceLoadedEnd":715.1999999880791,"resourceLoadedStart":215,"resourceTiming":[{"duration":20.69999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":215,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":215,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":235.69999998807907,"responseStart":0,"secureConnectionStart":0},{"duration":23,"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":215.19999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":215.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":238.19999998807907,"responseStart":0,"secureConnectionStart":0},{"duration":284.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":215.2999999821186,"connectEnd":215.2999999821186,"connectStart":215.2999999821186,"domainLookupEnd":215.2999999821186,"domainLookupStart":215.2999999821186,"fetchStart":215.2999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":240.19999998807907,"responseEnd":499.59999999403954,"responseStart":271.09999999403954,"secureConnectionStart":215.2999999821186},{"duration":499.7999999821186,"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":215.40000000596046,"connectEnd":215.40000000596046,"connectStart":215.40000000596046,"domainLookupEnd":215.40000000596046,"domainLookupStart":215.40000000596046,"fetchStart":215.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":240.90000000596046,"responseEnd":715.1999999880791,"responseStart":301.90000000596046,"secureConnectionStart":215.40000000596046},{"duration":67.7999999821186,"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":215.5,"connectEnd":215.5,"connectStart":215.5,"domainLookupEnd":215.5,"domainLookupStart":215.5,"fetchStart":215.5,"redirectEnd":0,"redirectStart":0,"requestStart":241,"responseEnd":283.2999999821186,"responseStart":276.7999999821186,"secureConnectionStart":215.5},{"duration":67.90000000596046,"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":215.59999999403954,"connectEnd":215.59999999403954,"connectStart":215.59999999403954,"domainLookupEnd":215.59999999403954,"domainLookupStart":215.59999999403954,"fetchStart":215.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":241.19999998807907,"responseEnd":283.5,"responseStart":277.69999998807907,"secureConnectionStart":215.59999999403954},{"duration":67.7000000178814,"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":215.69999998807907,"connectEnd":215.69999998807907,"connectStart":215.69999998807907,"domainLookupEnd":215.69999998807907,"domainLookupStart":215.69999998807907,"fetchStart":215.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":241.40000000596046,"responseEnd":283.40000000596046,"responseStart":277.2999999821186,"secureConnectionStart":215.69999998807907},{"duration":23.5,"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":215.7999999821186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":215.7999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":239.2999999821186,"responseStart":0,"secureConnectionStart":0},{"duration":68.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":215.90000000596046,"connectEnd":215.90000000596046,"connectStart":215.90000000596046,"domainLookupEnd":215.90000000596046,"domainLookupStart":215.90000000596046,"fetchStart":215.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":241.5,"responseEnd":284.09999999403954,"responseStart":278.2999999821186,"secureConnectionStart":215.90000000596046},{"duration":23.900000005960464,"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":216,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":216,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":239.90000000596046,"responseStart":0,"secureConnectionStart":0},{"duration":67.80000001192093,"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":216.09999999403954,"connectEnd":216.09999999403954,"connectStart":216.09999999403954,"domainLookupEnd":216.09999999403954,"domainLookupStart":216.09999999403954,"fetchStart":216.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":241.7999999821186,"responseEnd":283.90000000596046,"responseStart":278,"secureConnectionStart":216.09999999403954},{"duration":424,"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":216.69999998807907,"connectEnd":216.69999998807907,"connectStart":216.69999998807907,"domainLookupEnd":216.69999998807907,"domainLookupStart":216.69999998807907,"fetchStart":216.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":282.59999999403954,"responseEnd":640.6999999880791,"responseStart":629.1999999880791,"secureConnectionStart":216.69999998807907},{"duration":425.5,"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":216.7999999821186,"connectEnd":216.7999999821186,"connectStart":216.7999999821186,"domainLookupEnd":216.7999999821186,"domainLookupStart":216.7999999821186,"fetchStart":216.7999999821186,"redirectEnd":0,"redirectStart":0,"requestStart":297.2999999821186,"responseEnd":642.2999999821186,"responseStart":634.4000000059605,"secureConnectionStart":216.7999999821186},{"duration":243.69999998807907,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":669.5999999940395,"connectEnd":669.5999999940395,"connectStart":669.5999999940395,"domainLookupEnd":669.5999999940395,"domainLookupStart":669.5999999940395,"fetchStart":669.5999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":861.6999999880791,"responseEnd":913.2999999821186,"responseStart":912.7999999821186,"secureConnectionStart":669.5999999940395},{"duration":388.2999999821186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1046,"connectEnd":1046,"connectStart":1046,"domainLookupEnd":1046,"domainLookupStart":1046,"fetchStart":1046,"redirectEnd":0,"redirectStart":0,"requestStart":1404.4000000059605,"responseEnd":1434.2999999821186,"responseStart":1433.5999999940395,"secureConnectionStart":1046},{"duration":327.2999999821186,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1089.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1089.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1416.7999999821186,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":54,"responseStart":203,"responseEnd":212,"domLoading":206,"domInteractive":1361,"domContentLoadedEventStart":1361,"domContentLoadedEventEnd":1423,"domComplete":2003,"loadEventStart":2003,"loadEventEnd":2003,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1323.0999999940395},{"name":"bigPipe.sidebar-id.end","time":1324.0999999940395},{"name":"bigPipe.activity-panel-pipe-id.start","time":1324.4000000059605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1325.199999988079},{"name":"activityTabFullyLoaded","time":1435.699999988079}],"measures":[],"correlationId":"77585ac7a71d4c","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":71,"dbReadsTimeInMs":9,"dbConnsTimeInMs":15,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The fix for this bug was pushed into the 5.3 tree.