While the join_cache_level variable is set to a value > 2, a query with a join on a derived table with a TEXT column in it could result to a server crash when LIMIT x OFFSET x is used on the derived table.
To reproduce the crash, import the attached SQL then execute the following query :
EXPLAIN SELECT 1 FROM (SELECT url, id FROM t2 LIMIT 1 OFFSET 20) derived RIGHT JOIN t1 ON t1.id = derived.id;
|
Here is the error log output :
mysqld: 130919 14:11:26 [ERROR] mysqld got signal 11 ;
|
mysqld: This could be because you hit a bug. It is also possible that this binary
|
mysqld: or one of the libraries it was linked against is corrupt, improperly built,
|
mysqld: or misconfigured. This error can also be caused by malfunctioning hardware.
|
mysqld:
|
mysqld: To report this bug, see http://kb.askmonty.org/en/reporting-bugs
|
mysqld:
|
mysqld: We will try our best to scrape up some info that will hopefully help
|
mysqld: diagnose the problem, but since we have already crashed,
|
mysqld: something is definitely wrong and this may fail.
|
mysqld:
|
mysqld: Server version: 5.5.33-MariaDB-1~squeeze
|
mysqld: key_buffer_size=2147483648
|
mysqld: read_buffer_size=2097152
|
mysqld: max_used_connections=1
|
mysqld: max_threads=252
|
mysqld: thread_count=1
|
mysqld: It is possible that mysqld could use up to
|
mysqld: key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 3133826 K bytes of memory
|
mysqld: Hope that's ok; if not, decrease some variables in the equation.
|
mysqld:
|
mysqld: Thread pointer: 0x0x7fb69bcfb5f0
|
mysqld: Attempting backtrace. You can use the following information to find out
|
mysqld: where mysqld died. If you see no messages after this, something went
|
mysqld: terribly wrong...
|
mysqld: stack_bottom = 0x7fb37714ae58 thread_stack 0x48000
|
mysqld: /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x7fb69035d80e]
|
mysqld: /usr/sbin/mysqld(handle_fatal_signal+0x4ac)[0x7fb68ff5cd7c]
|
mysqld: /lib/libpthread.so.0(+0xeff0)[0x7fb68f659ff0]
|
mysqld: /usr/sbin/mysqld(_ZN10DsMrr_impl15choose_mrr_implEjyPjS0_P9COST_VECT+0x54)[0x7fb68feff724]
|
mysqld: /usr/sbin/mysqld(_ZN10DsMrr_impl10dsmrr_infoEjjjjPjS0_P9COST_VECT+0xe3)[0x7fb68feffad3]
|
mysqld: /usr/sbin/mysqld(_Z33check_join_cache_usage_for_tablesP4JOINyj+0x694)[0x7fb68fe40ed4]
|
mysqld: /usr/sbin/mysqld(_ZN4JOIN8optimizeEv+0x16c7)[0x7fb68fe4f477]
|
mysqld: /usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xd2)[0x7fb68fe568e2]
|
mysqld: /usr/sbin/mysqld(_Z19mysql_explain_unionP3THDP18st_select_lex_unitP13select_result+0x10c)[0x7fb68fe5726c]
|
mysqld: /usr/sbin/mysqld(+0x37771f)[0x7fb68fdfe71f]
|
mysqld: /usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x35f9)[0x7fb68fe05539]
|
mysqld: /usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x1cc)[0x7fb68fe080ec]
|
mysqld: /usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1792)[0x7fb68fe09892]
|
mysqld: /usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x419)[0x7fb68fece809]
|
mysqld: /usr/sbin/mysqld(handle_one_connection+0x51)[0x7fb68fece8c1]
|
mysqld: /lib/libpthread.so.0(+0x68ca)[0x7fb68f6518ca]
|
mysqld: /lib/libc.so.6(clone+0x6d)[0x7fb68dfd0b6d]
|
mysqld:
|
mysqld: Trying to get some variables.
|
mysqld: Some pointers may be invalid and cause the dump to abort.
|
mysqld: Query (0x7fb69bd467f8): EXPLAIN SELECT 1 FROM (SELECT url, id FROM t2 LIMIT 1 OFFSET 20) derived RIGHT JOIN t1 ON t1.id = derived.id
|
mysqld:
|
mysqld: Connection ID (thread ID): 1
|
mysqld: Status: NOT_KILLED
|
mysqld:
|
mysqld: Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
|
mysqld:
|
mysqld: The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
|
mysqld: information that should help you find out what is causing the crash.
|
mysqld_safe: Number of processes running now: 0
|
mysqld_safe: mysqld restarted
|
{"report":{"fcp":1423.3999998569489,"ttfb":618.7999999523163,"pageVisibility":"visible","entityId":25726,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"be257aa4-5a29-47a3-b00c-10b3cadd8683","navigationType":0,"readyForUser":1512.7999999523163,"redirectCount":0,"resourceLoadedEnd":1636.5,"resourceLoadedStart":624.7000000476837,"resourceTiming":[{"duration":301.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":624.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":624.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":925.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":301.09999990463257,"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":625,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":625,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":926.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":314,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":625.0999999046326,"connectEnd":625.0999999046326,"connectStart":625.0999999046326,"domainLookupEnd":625.0999999046326,"domainLookupStart":625.0999999046326,"fetchStart":625.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":625.0999999046326,"responseEnd":939.0999999046326,"responseStart":939.0999999046326,"secureConnectionStart":625.0999999046326},{"duration":377,"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":625.2999999523163,"connectEnd":625.2999999523163,"connectStart":625.2999999523163,"domainLookupEnd":625.2999999523163,"domainLookupStart":625.2999999523163,"fetchStart":625.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":625.2999999523163,"responseEnd":1002.2999999523163,"responseStart":1002.2000000476837,"secureConnectionStart":625.2999999523163},{"duration":380.7000000476837,"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":625.5,"connectEnd":625.5,"connectStart":625.5,"domainLookupEnd":625.5,"domainLookupStart":625.5,"fetchStart":625.5,"redirectEnd":0,"redirectStart":0,"requestStart":625.5,"responseEnd":1006.2000000476837,"responseStart":1006.2000000476837,"secureConnectionStart":625.5},{"duration":381.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":625.7000000476837,"connectEnd":625.7000000476837,"connectStart":625.7000000476837,"domainLookupEnd":625.7000000476837,"domainLookupStart":625.7000000476837,"fetchStart":625.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":625.7000000476837,"responseEnd":1006.7999999523163,"responseStart":1006.7000000476837,"secureConnectionStart":625.7000000476837},{"duration":381.2000000476837,"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":625.8999998569489,"connectEnd":625.8999998569489,"connectStart":625.8999998569489,"domainLookupEnd":625.8999998569489,"domainLookupStart":625.8999998569489,"fetchStart":625.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":625.8999998569489,"responseEnd":1007.0999999046326,"responseStart":1007.0999999046326,"secureConnectionStart":625.8999998569489},{"duration":456.5,"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":626.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":626.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1082.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":381.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":626.2000000476837,"connectEnd":626.2000000476837,"connectStart":626.2000000476837,"domainLookupEnd":626.2000000476837,"domainLookupStart":626.2000000476837,"fetchStart":626.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":626.2000000476837,"responseEnd":1007.5,"responseStart":1007.5,"secureConnectionStart":626.2000000476837},{"duration":456.30000019073486,"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":626.3999998569489,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":626.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1082.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":381.5,"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":626.5999999046326,"connectEnd":626.5999999046326,"connectStart":626.5999999046326,"domainLookupEnd":626.5999999046326,"domainLookupStart":626.5999999046326,"fetchStart":626.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":626.5999999046326,"responseEnd":1008.0999999046326,"responseStart":1008.0999999046326,"secureConnectionStart":626.5999999046326},{"duration":608.5999999046326,"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":627.2999999523163,"connectEnd":627.2999999523163,"connectStart":627.2999999523163,"domainLookupEnd":627.2999999523163,"domainLookupStart":627.2999999523163,"fetchStart":627.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":627.2999999523163,"responseEnd":1235.8999998569489,"responseStart":1235.8999998569489,"secureConnectionStart":627.2999999523163},{"duration":948.2000000476837,"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":627.3999998569489,"connectEnd":627.3999998569489,"connectStart":627.3999998569489,"domainLookupEnd":627.3999998569489,"domainLookupStart":627.3999998569489,"fetchStart":627.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":627.3999998569489,"responseEnd":1575.5999999046326,"responseStart":1575.5999999046326,"secureConnectionStart":627.3999998569489},{"duration":174.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1094.5,"connectEnd":1094.5,"connectStart":1094.5,"domainLookupEnd":1094.5,"domainLookupStart":1094.5,"fetchStart":1094.5,"redirectEnd":0,"redirectStart":0,"requestStart":1094.5,"responseEnd":1269.0999999046326,"responseStart":1269.0999999046326,"secureConnectionStart":1094.5},{"duration":257,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1375.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1375.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1632.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":256.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/50bc9be5bfead1a25e72c1a9338c94f6-CDN/lu2cib/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/css/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1375.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1375.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1632.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":252.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1376.5999999046326,"connectEnd":1376.5999999046326,"connectStart":1376.5999999046326,"domainLookupEnd":1376.5999999046326,"domainLookupStart":1376.5999999046326,"fetchStart":1376.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1376.5999999046326,"responseEnd":1629.5,"responseStart":1629.5,"secureConnectionStart":1376.5999999046326},{"duration":259.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":1377,"connectEnd":1377,"connectStart":1377,"domainLookupEnd":1377,"domainLookupStart":1377,"fetchStart":1377,"redirectEnd":0,"redirectStart":0,"requestStart":1377,"responseEnd":1636.5,"responseStart":1636.5,"secureConnectionStart":1377},{"duration":290.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/e0bf5781d46ea69fb123572974cf39de-CDN/lu2cib/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/js/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":1377.3999998569489,"connectEnd":1377.3999998569489,"connectStart":1377.3999998569489,"domainLookupEnd":1377.3999998569489,"domainLookupStart":1377.3999998569489,"fetchStart":1377.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":1377.3999998569489,"responseEnd":1667.5999999046326,"responseStart":1667.5,"secureConnectionStart":1377.3999998569489}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":450,"responseStart":619,"responseEnd":620,"domLoading":622,"domInteractive":1638,"domContentLoadedEventStart":1638,"domContentLoadedEventEnd":1684,"domComplete":2246,"loadEventStart":2246,"loadEventEnd":2246,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1605},{"name":"bigPipe.sidebar-id.end","time":1606.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1606.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1608.2999999523163},{"name":"activityTabFullyLoaded","time":1701.5}],"measures":[],"correlationId":"49ed68d5b2e1ec","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":102,"dbReadsTimeInMs":9,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7f8d700 (LWP 8548)]
0x0000000000742b3c in DsMrr_impl::check_cpk_scan (this=0x7fffb4ced4b8, thd=0x7fffc3fe9060, keyno=0, mrr_flags=129) at /home/psergey/dev2/5.5/sql/multi_range_read.cc:1523
Missing separate debuginfos, use: debuginfo-install zlib-1.2.5-6.fc16.x86_64
(gdb) p this
$2 = (DsMrr_impl * const) 0x7fffb4ced4b8
(gdb) print table
$4 = (TABLE *) 0x0
up
up
up
#4 0x00000000006524fe in check_join_cache_usage (tab=0x7fffb4c62800, options=4, no_jbuf_after=2, table_index=1, prev_tab=0x7fffb4c624e0) at /home/psergey/dev2/5.5/sql/sql_select.cc:9798
(gdb) list
9793 flags= HA_MRR_NO_NULL_ENDPOINTS | HA_MRR_SINGLE_POINT;
9794 if (tab->table->covering_keys.is_set(tab->ref.key))
9795 flags|= HA_MRR_INDEX_ONLY;
9796 rows= tab->table->file->multi_range_read_info(tab->ref.key, 10, 20,
9797 tab->ref.key_parts,
9798 &bufsz, &flags, &cost);
9799 }
(gdb) p tab->table
$18 = (TABLE *) 0x7fffb4c9d078
(gdb) p tab->table->alias.Ptr
$22 = 0x7fffb4c46c78 "derived"