CREATE TABLE t (a INT);
|
INSERT INTO t VALUES (1),(2);
|
--error ER_BAD_FIELD_ERROR
|
SELECT 1 IN (SELECT COUNT(*) FROM t t1 JOIN (t t2 JOIN t t3 ON (t1.a != 0)));
|
|
# Cleanup
|
DROP TABLE t;
|
10.4 af810407
|
mysqld: /data/src/10.4/sql/sql_lex.cc:2806: bool st_select_lex::mark_as_dependent(THD*, st_select_lex*, Item_ident*): Assertion `this != last' failed.
|
220430 4:45:17 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007fa0183c3662 in __GI___assert_fail (assertion=0x5572af964e28 "this != last", file=0x5572af964324 "/data/src/10.4/sql/sql_lex.cc", line=2806, function=0x5572af964e38 "bool st_select_lex::mark_as_dependent(THD*, st_select_lex*, Item_ident*)") at assert.c:101
|
#8 0x00005572aec42e6e in st_select_lex::mark_as_dependent (this=0x7fa000014dc0, thd=0x7fa000000d90, last=0x7fa000014dc0, dependency=0x7fa000016a18) at /data/src/10.4/sql/sql_lex.cc:2806
|
#9 0x00005572aefdc243 in mark_as_dependent (thd=0x7fa000000d90, last=0x7fa000014dc0, current=0x7fa000014dc0, resolved_item=0x7fa000016a18, mark_item=0x7fa000016a18, suppress_warning_output=false) at /data/src/10.4/sql/item.cc:5112
|
#10 0x00005572aefde2aa in Item_field::fix_outer_field (this=0x7fa000016a18, thd=0x7fa000000d90, from_field=0x7fa0123939c0, reference=0x7fa000016c50) at /data/src/10.4/sql/item.cc:5801
|
#11 0x00005572aefdead8 in Item_field::fix_fields (this=0x7fa000016a18, thd=0x7fa000000d90, reference=0x7fa000016c50) at /data/src/10.4/sql/item.cc:5985
|
#12 0x00005572aeb60409 in Item::fix_fields_if_needed (this=0x7fa000016a18, thd=0x7fa000000d90, ref=0x7fa000016c50) at /data/src/10.4/sql/item.h:964
|
#13 0x00005572af039c66 in Item_func::fix_fields (this=0x7fa000016bc0, thd=0x7fa000000d90, ref=0x7fa000016318) at /data/src/10.4/sql/item_func.cc:352
|
#14 0x00005572aeb60409 in Item::fix_fields_if_needed (this=0x7fa000016bc0, thd=0x7fa000000d90, ref=0x7fa000016318) at /data/src/10.4/sql/item.h:964
|
#15 0x00005572aeb6043f in Item::fix_fields_if_needed_for_scalar (this=0x7fa000016bc0, thd=0x7fa000000d90, ref=0x7fa000016318) at /data/src/10.4/sql/item.h:968
|
#16 0x00005572aebe5b33 in Item::fix_fields_if_needed_for_bool (this=0x7fa000016bc0, thd=0x7fa000000d90, ref=0x7fa000016318) at /data/src/10.4/sql/item.h:972
|
#17 0x00005572aebe1b50 in setup_on_expr (thd=0x7fa000000d90, table=0x7fa0000162b8, is_update=false) at /data/src/10.4/sql/sql_base.cc:8325
|
#18 0x00005572aebe1fcc in setup_conds (thd=0x7fa000000d90, tables=0x7fa000015488, leaves=..., conds=0x7fa000019c10) at /data/src/10.4/sql/sql_base.cc:8442
|
#19 0x00005572aecbd5fd in setup_without_group (thd=0x7fa000000d90, ref_pointer_array=..., tables=0x7fa000015488, leaves=..., fields=..., all_fields=..., conds=0x7fa000019c10, order=0x0, group=0x0, win_specs=..., win_funcs=..., hidden_group_fields=0x7fa000019aef, reserved=0x7fa0000150c4) at /data/src/10.4/sql/sql_select.cc:724
|
#20 0x00005572aecc044d in JOIN::prepare (this=0x7fa000019808, tables_init=0x7fa000015488, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7fa000014dc0, unit_arg=0x7fa000017ce8) at /data/src/10.4/sql/sql_select.cc:1283
|
#21 0x00005572af09e33f in subselect_single_select_engine::prepare (this=0x7fa000018718, thd=0x7fa000000d90) at /data/src/10.4/sql/item_subselect.cc:3827
|
#22 0x00005572af090a8b in Item_subselect::fix_fields (this=0x7fa0000184f0, thd_param=0x7fa000000d90, ref=0x7fa000018760) at /data/src/10.4/sql/item_subselect.cc:289
|
#23 0x00005572af09d288 in Item_in_subselect::fix_fields (this=0x7fa0000184f0, thd_arg=0x7fa000000d90, ref=0x7fa000018760) at /data/src/10.4/sql/item_subselect.cc:3489
|
#24 0x00005572aeb60409 in Item::fix_fields_if_needed (this=0x7fa0000184f0, thd=0x7fa000000d90, ref=0x7fa000018760) at /data/src/10.4/sql/item.h:964
|
#25 0x00005572aeb6043f in Item::fix_fields_if_needed_for_scalar (this=0x7fa0000184f0, thd=0x7fa000000d90, ref=0x7fa000018760) at /data/src/10.4/sql/item.h:968
|
#26 0x00005572aebdfa8e in setup_fields (thd=0x7fa000000d90, ref_pointer_array=..., fields=..., column_usage=MARK_COLUMNS_READ, sum_func_list=0x7fa0000194b8, pre_fix=0x7fa000014a00, allow_sum_func=true) at /data/src/10.4/sql/sql_base.cc:7707
|
#27 0x00005572aecc0314 in JOIN::prepare (this=0x7fa000019198, tables_init=0x0, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7fa0000148a0, unit_arg=0x7fa000004cc0) at /data/src/10.4/sql/sql_select.cc:1278
|
#28 0x00005572aeccd17b in mysql_select (thd=0x7fa000000d90, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fa000019170, unit=0x7fa000004cc0, select_lex=0x7fa0000148a0) at /data/src/10.4/sql/sql_select.cc:4729
|
#29 0x00005572aecbcbec in handle_select (thd=0x7fa000000d90, lex=0x7fa000004c00, result=0x7fa000019170, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:436
|
#30 0x00005572aec8235c in execute_sqlcom_select (thd=0x7fa000000d90, all_tables=0x7fa000015488) at /data/src/10.4/sql/sql_parse.cc:6465
|
#31 0x00005572aec78b7c in mysql_execute_command (thd=0x7fa000000d90) at /data/src/10.4/sql/sql_parse.cc:3979
|
#32 0x00005572aec862f0 in mysql_parse (thd=0x7fa000000d90, rawbuf=0x7fa0000147a8 "SELECT 1 IN (SELECT COUNT(*) FROM t t1 JOIN (t t2 JOIN t t3 ON (t1.a != 0)))", length=76, parser_state=0x7fa012395550, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8011
|
#33 0x00005572aec72781 in dispatch_command (command=COM_QUERY, thd=0x7fa000000d90, packet=0x7fa00000ac01 "SELECT 1 IN (SELECT COUNT(*) FROM t t1 JOIN (t t2 JOIN t t3 ON (t1.a != 0)))", packet_length=76, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1873
|
#34 0x00005572aec70f73 in do_command (thd=0x7fa000000d90) at /data/src/10.4/sql/sql_parse.cc:1378
|
#35 0x00005572aedffe19 in do_handle_one_connection (connect=0x5572b2d721a0) at /data/src/10.4/sql/sql_connect.cc:1420
|
#36 0x00005572aedffac1 in handle_one_connection (arg=0x5572b2d721a0) at /data/src/10.4/sql/sql_connect.cc:1316
|
#37 0x00005572af31c2fd in pfs_spawn_thread (arg=0x5572b2db7d10) at /data/src/10.4/storage/perfschema/pfs.cc:1869
|
#38 0x00007fa01888fea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#39 0x00007fa01848cdef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
The failure started happening on 10.4 after this commit:
commit 39feab3cd31b5414aa9b428eaba915c251ac34a2
|
Author: Igor Babaev
|
Date: Mon Apr 25 18:08:57 2022 -0700
|
|
MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
|
Before the commit SELECT produced ER_BAD_FIELD_ERROR error.
{"report":{"fcp":2444.5999999046326,"ttfb":683.5999999046326,"pageVisibility":"visible","entityId":110462,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"8707edba-a177-4dd4-b931-5d3f40d643a9","navigationType":0,"readyForUser":2530.4000000953674,"redirectCount":0,"resourceLoadedEnd":1986.5999999046326,"resourceLoadedStart":707.0999999046326,"resourceTiming":[{"duration":640.4000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":707.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":707.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1347.5,"responseStart":0,"secureConnectionStart":0},{"duration":649,"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":707.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":707.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1356.5,"responseStart":0,"secureConnectionStart":0},{"duration":1030.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":707.7000002861023,"connectEnd":707.7000002861023,"connectStart":707.7000002861023,"domainLookupEnd":707.7000002861023,"domainLookupStart":707.7000002861023,"fetchStart":707.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1353.2000002861023,"responseEnd":1738.0999999046326,"responseStart":1499.4000000953674,"secureConnectionStart":707.7000002861023},{"duration":1250.4000000953674,"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":707.9000000953674,"connectEnd":707.9000000953674,"connectStart":707.9000000953674,"domainLookupEnd":707.9000000953674,"domainLookupStart":707.9000000953674,"fetchStart":707.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1350.2000002861023,"responseEnd":1958.3000001907349,"responseStart":1500.4000000953674,"secureConnectionStart":707.9000000953674},{"duration":737.5,"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":708,"connectEnd":708,"connectStart":708,"domainLookupEnd":708,"domainLookupStart":708,"fetchStart":708,"redirectEnd":0,"redirectStart":0,"requestStart":1354.0999999046326,"responseEnd":1445.5,"responseStart":1425,"secureConnectionStart":708},{"duration":736.5,"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":708.2000002861023,"connectEnd":708.2000002861023,"connectStart":708.2000002861023,"domainLookupEnd":708.2000002861023,"domainLookupStart":708.2000002861023,"fetchStart":708.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1354.3000001907349,"responseEnd":1444.7000002861023,"responseStart":1422.8000001907349,"secureConnectionStart":708.2000002861023},{"duration":724.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":708.3000001907349,"connectEnd":708.3000001907349,"connectStart":708.3000001907349,"domainLookupEnd":708.3000001907349,"domainLookupStart":708.3000001907349,"fetchStart":708.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1354.4000000953674,"responseEnd":1433.0999999046326,"responseStart":1419.7000002861023,"secureConnectionStart":708.3000001907349},{"duration":648.1000003814697,"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":708.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":708.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1356.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":737.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":708.8000001907349,"connectEnd":708.8000001907349,"connectStart":708.8000001907349,"domainLookupEnd":708.8000001907349,"domainLookupStart":708.8000001907349,"fetchStart":708.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1354.5,"responseEnd":1446.2000002861023,"responseStart":1432.0999999046326,"secureConnectionStart":708.8000001907349},{"duration":647.7000002861023,"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":709,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":709,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1356.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":736.7000002861023,"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":709.0999999046326,"connectEnd":709.0999999046326,"connectStart":709.0999999046326,"domainLookupEnd":709.0999999046326,"domainLookupStart":709.0999999046326,"fetchStart":709.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1354.5999999046326,"responseEnd":1445.8000001907349,"responseStart":1429.9000000953674,"secureConnectionStart":709.0999999046326},{"duration":1271.9000000953674,"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":709.9000000953674,"connectEnd":709.9000000953674,"connectStart":709.9000000953674,"domainLookupEnd":709.9000000953674,"domainLookupStart":709.9000000953674,"fetchStart":709.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1521.5999999046326,"responseEnd":1981.8000001907349,"responseStart":1969.0999999046326,"secureConnectionStart":709.9000000953674},{"duration":1276.5999999046326,"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":710,"connectEnd":710,"connectStart":710,"domainLookupEnd":710,"domainLookupStart":710,"fetchStart":710,"redirectEnd":0,"redirectStart":0,"requestStart":1810.9000000953674,"responseEnd":1986.5999999046326,"responseStart":1973.8000001907349,"secureConnectionStart":710},{"duration":331.69999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1912.8000001907349,"connectEnd":1912.8000001907349,"connectStart":1912.8000001907349,"domainLookupEnd":1912.8000001907349,"domainLookupStart":1912.8000001907349,"fetchStart":1912.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":2212,"responseEnd":2244.5,"responseStart":2242.9000000953674,"secureConnectionStart":1912.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":491,"responseStart":684,"responseEnd":688,"domLoading":702,"domInteractive":2662,"domContentLoadedEventStart":2662,"domContentLoadedEventEnd":2712,"domComplete":3450,"loadEventStart":3450,"loadEventEnd":3450,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2607.5},{"name":"bigPipe.sidebar-id.end","time":2608.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":2608.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":2609.5},{"name":"activityTabFullyLoaded","time":2725.7000002861023}],"measures":[],"correlationId":"1d0d6f59b67cad","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":105,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
A fix for this bug was pushed into 10.4