Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.6 , 10.11 , 11.4 , 11.8 , 12.0
PREPARE p FROM 'LOCK TABLE t WRITE' ;
CREATE VIEW t AS SELECT 1 AS a;
EXECUTE p;
START TRANSACTION ;
RENAME TABLE t TO t2;
CREATE TABLE t (c INT ,d INT , INDEX (c));
EXECUTE p;
SELECT * FROM t;
Leads to:
CS 11.8.1 33e0796e7a154e02a5e53c55cefc5d6feb4f5e6d (Debug) Build 15/02/2025
mariadbd: /test/11.8_dbg/sql/handler.cc:3735: int handler::ha_rnd_next(uchar *): Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed.
CS 11.8.1 33e0796e7a154e02a5e53c55cefc5d6feb4f5e6d (Debug) Build 15/02/2025
Core was generated by `/test/MD150225-mariadb-11.8.1-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
Program terminated with signal SIGABRT, Aborted.
Download failed: Invalid argument. Continuing without source file ./nptl/./nptl/pthread_kill.c.
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
[Current thread is 1 (LWP 2443078)]
(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
#3 0x000014ac7804526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
#4 0x000014ac780288ff in __GI_abort () at ./stdlib/abort.c:79
#5 0x000014ac7802881b in __assert_fail_base (fmt=0x14ac781d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x558afce8ba13 "table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2", file=file@entry=0x558afce8a906 "/test/11.8_dbg/sql/handler.cc", line=line@entry=3735, function=function@entry=0x558afce8ba4e "int handler::ha_rnd_next(uchar *)")at ./assert/assert.c:94
#6 0x000014ac7803b507 in __assert_fail (assertion=0x558afce8ba13 "table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2", file=0x558afce8a906 "/test/11.8_dbg/sql/handler.cc", line=3735, function=0x558afce8ba4e "int handler::ha_rnd_next(uchar *)")at ./assert/assert.c:103
#7 0x0000558afc203015 in handler::ha_rnd_next (this=0x14ac100333a8, buf=0x14ac10033c00 "\377") at /test/11.8_dbg/sql/handler.cc:3734
#8 0x0000558afbc9a500 in rr_sequential (info=0x14ac1001cf00)at /test/11.8_dbg/sql/records.cc:509
#9 0x0000558afbc7fe46 in READ_RECORD::read_record (this=0x14ac1001cf00)at /test/11.8_dbg/sql/records.h:77
#10 0x0000558afbe689cf in join_init_read_record (tab=0x14ac1001ce30)at /test/11.8_dbg/sql/sql_select.cc:25251
#11 0x0000558afbe449d1 in sub_select (join=0x14ac1001b438, join_tab=0x14ac1001ce30, end_of_records=false)at /test/11.8_dbg/sql/sql_select.cc:24183
#12 0x0000558afbe6bec4 in do_select (join=0x14ac1001b438, procedure=0x0)at /test/11.8_dbg/sql/sql_select.cc:23697
#13 0x0000558afbe6b233 in JOIN::exec_inner (this=0x14ac1001b438)at /test/11.8_dbg/sql/sql_select.cc:5059
#14 0x0000558afbe6a0de in JOIN::exec (this=0x14ac1001b438)at /test/11.8_dbg/sql/sql_select.cc:4842
#15 0x0000558afbe4534d in mysql_select (thd=0x14ac10000d58, tables=0x14ac1001a3d0, fields=@0x14ac1001a050: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14ac1001a380, last = 0x14ac1001be80, elements = 2}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2166622976, result=0x14ac1001b410, unit=0x14ac10005080, select_lex=0x14ac10019d98) at /test/11.8_dbg/sql/sql_select.cc:5375
#16 0x0000558afbe44dd5 in handle_select (thd=0x14ac10000d58, lex=0x14ac10004fa0, result=0x14ac1001b410, setup_tables_done_option=0)at /test/11.8_dbg/sql/sql_select.cc:633
#17 0x0000558afbdec771 in execute_sqlcom_select (thd=0x14ac10000d58, all_tables=0x14ac1001a3d0) at /test/11.8_dbg/sql/sql_parse.cc:6191
#18 0x0000558afbde1650 in mysql_execute_command (thd=0x14ac10000d58, is_called_from_prepared_stmt=false) at /test/11.8_dbg/sql/sql_parse.cc:3979
#19 0x0000558afbdd97d4 in mysql_parse (thd=0x14ac10000d58, rawbuf=0x14ac10019d20 "SELECT * FROM t", length=15, parser_state=0x14ac70aa2a20) at /test/11.8_dbg/sql/sql_parse.cc:7915
#20 0x0000558afbdd6ba4 in dispatch_command (command=COM_QUERY, thd=0x14ac10000d58, packet=0x14ac1000b099 "", packet_length=15, blocking=true) at /test/11.8_dbg/sql/sql_parse.cc:1902
#21 0x0000558afbdda383 in do_command (thd=0x14ac10000d58, blocking=true)at /test/11.8_dbg/sql/sql_parse.cc:1415
#22 0x0000558afbfc3a19 in do_handle_one_connection (connect=0x558b00750138, put_in_cache=true) at /test/11.8_dbg/sql/sql_connect.cc:1415
#23 0x0000558afbfc37be in handle_one_connection (arg=0x558b00769348)at /test/11.8_dbg/sql/sql_connect.cc:1327
#24 0x000014ac7809ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
#25 0x000014ac78129c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Bug confirmed present in:
MariaDB: 10.6.22 (dbg), 10.11.12 (dbg), 11.4.6 (dbg), 11.8.1 (dbg), 12.0.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.5.29 (dbg), 10.5.29 (opt), 10.6.22 (opt), 10.11.12 (opt), 11.4.6 (opt), 11.8.1 (opt), 12.0.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.44 (dbg), 5.7.44 (opt), 8.0.36 (dbg), 8.0.36 (opt), 9.1.0 (dbg), 9.1.0 (opt)
No ASAN/UBSAN issues were observed for the given testcase.
relates to
MDEV-18163
Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed in handler::ha_rnd_next(); / Assertion `table_list->table' failed in find_field_in_table_ref / ERROR 1901 (on optimized builds)
Closed
{"report":{"fcp":2833,"ttfb":1068.7999997138977,"pageVisibility":"visible","entityId":133013,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b6a1ec88-0d59-4b63-8c77-de2a762616da","navigationType":0,"readyForUser":2935.5999999046326,"redirectCount":0,"resourceLoadedEnd":3378.5,"resourceLoadedStart":1078.3999996185303,"resourceTiming":[{"duration":1063.1000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":1078.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1078.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2141.5,"responseStart":0,"secureConnectionStart":0},{"duration":1063.6999998092651,"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":1078.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1078.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2142.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":1142.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":1078.8999996185303,"connectEnd":1078.8999996185303,"connectStart":1078.8999996185303,"domainLookupEnd":1078.8999996185303,"domainLookupStart":1078.8999996185303,"fetchStart":1078.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1078.8999996185303,"responseEnd":2221.5,"responseStart":2221.5,"secureConnectionStart":1078.8999996185303},{"duration":1302.7999997138977,"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":1079.0999999046326,"connectEnd":1079.0999999046326,"connectStart":1079.0999999046326,"domainLookupEnd":1079.0999999046326,"domainLookupStart":1079.0999999046326,"fetchStart":1079.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1079.0999999046326,"responseEnd":2381.8999996185303,"responseStart":2381.8999996185303,"secureConnectionStart":1079.0999999046326},{"duration":1307.8000001907349,"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":1079.2999997138977,"connectEnd":1079.2999997138977,"connectStart":1079.2999997138977,"domainLookupEnd":1079.2999997138977,"domainLookupStart":1079.2999997138977,"fetchStart":1079.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1079.2999997138977,"responseEnd":2387.0999999046326,"responseStart":2387.0999999046326,"secureConnectionStart":1079.2999997138977},{"duration":1308.5999999046326,"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":1079.5,"connectEnd":1079.5,"connectStart":1079.5,"domainLookupEnd":1079.5,"domainLookupStart":1079.5,"fetchStart":1079.5,"redirectEnd":0,"redirectStart":0,"requestStart":1079.5,"responseEnd":2388.0999999046326,"responseStart":2388.0999999046326,"secureConnectionStart":1079.5},{"duration":1309,"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":1079.6999998092651,"connectEnd":1079.6999998092651,"connectStart":1079.6999998092651,"domainLookupEnd":1079.6999998092651,"domainLookupStart":1079.6999998092651,"fetchStart":1079.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1079.6999998092651,"responseEnd":2388.699999809265,"responseStart":2388.699999809265,"secureConnectionStart":1079.6999998092651},{"duration":1324.8000001907349,"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":1079.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1079.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2404.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":1309.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":1079.8999996185303,"connectEnd":1079.8999996185303,"connectStart":1079.8999996185303,"domainLookupEnd":1079.8999996185303,"domainLookupStart":1079.8999996185303,"fetchStart":1079.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1079.8999996185303,"responseEnd":2389.2999997138977,"responseStart":2389.199999809265,"secureConnectionStart":1079.8999996185303},{"duration":1324.6999998092651,"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":1080.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1080.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2404.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":1309.6999998092651,"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":1080.1999998092651,"connectEnd":1080.1999998092651,"connectStart":1080.1999998092651,"domainLookupEnd":1080.1999998092651,"domainLookupStart":1080.1999998092651,"fetchStart":1080.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1080.1999998092651,"responseEnd":2389.8999996185303,"responseStart":2389.8999996185303,"secureConnectionStart":1080.1999998092651},{"duration":2263,"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":1081.0999999046326,"connectEnd":1081.0999999046326,"connectStart":1081.0999999046326,"domainLookupEnd":1081.0999999046326,"domainLookupStart":1081.0999999046326,"fetchStart":1081.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1081.0999999046326,"responseEnd":3344.0999999046326,"responseStart":3344.0999999046326,"secureConnectionStart":1081.0999999046326},{"duration":2297.300000190735,"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":1081.1999998092651,"connectEnd":1081.1999998092651,"connectStart":1081.1999998092651,"domainLookupEnd":1081.1999998092651,"domainLookupStart":1081.1999998092651,"fetchStart":1081.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1081.1999998092651,"responseEnd":3378.5,"responseStart":3378.5,"secureConnectionStart":1081.1999998092651},{"duration":906.8000001907349,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":2446.199999809265,"connectEnd":2446.199999809265,"connectStart":2446.199999809265,"domainLookupEnd":2446.199999809265,"domainLookupStart":2446.199999809265,"fetchStart":2446.199999809265,"redirectEnd":0,"redirectStart":0,"requestStart":2446.199999809265,"responseEnd":3353,"responseStart":3353,"secureConnectionStart":2446.199999809265},{"duration":578.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":2824.199999809265,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2824.199999809265,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":3402.699999809265,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":914,"responseStart":1069,"responseEnd":1074,"domLoading":1073,"domInteractive":3410,"domContentLoadedEventStart":3410,"domContentLoadedEventEnd":3464,"domComplete":4948,"loadEventStart":4948,"loadEventEnd":4951,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":3380.7999997138977},{"name":"bigPipe.sidebar-id.end","time":3381.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":3381.699999809265},{"name":"bigPipe.activity-panel-pipe-id.end","time":3384.3999996185303},{"name":"activityTabFullyLoaded","time":3477}],"measures":[],"correlationId":"e21785c4581358","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":90,"dbReadsTimeInMs":9,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}