#0 0x00000000013316dd in Field::type_std_attributes (this=0x619000159258) at /home/wx/mariadb-11.3.0/sql/field.h:902
#1 Item_field::set_field (this=0x6290000bc7e0, field_par=<optimized out>) at /home/wx/mariadb-11.3.0/sql/item.cc:3141
#2 0x000000000133122a in Item_field::Item_field (this=0x6290000bc7e0, thd=<optimized out>, f=<optimized out>) at /home/wx/mariadb-11.3.0/sql/item.cc:3046
#3 0x00000000015ef5ab in Item_sum::get_tmp_table_item (this=<optimized out>, thd=0x62b00016c218) at /home/wx/mariadb-11.3.0/sql/item_sum.cc:563
#4 0x0000000000c2f1a9 in change_refs_to_tmp_fields (thd=<optimized out>, ref_pointer_array=..., res_selected_fields=..., res_all_fields=..., elements=1, all_fields=...) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:28691
#5 JOIN::make_aggr_tables_info (this=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:3798
#6 0x0000000000bfc660 in JOIN::optimize_stage2 (this=0x6290000ba0c8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:3438
#7 0x0000000000c13911 in JOIN::optimize_inner (this=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2650
#8 0x0000000000bfc156 in JOIN::optimize (this=0x6290000ba0c8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1944
#9 0x0000000000ab5421 in st_select_lex::optimize_unflattened_subqueries (this=<optimized out>, const_only=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4916
#10 0x0000000000a688a6 in mysql_insert (thd=<optimized out>, table_list=0x6290000915e0, fields=..., values_list=..., update_fields=..., update_values=..., duplic=<optimized out>, ignore=<optimized out>, result=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_insert.cc:875
#11 0x0000000000b36566 in mysql_execute_command (thd=0x62b00016c218, is_called_from_prepared_stmt=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:4417
#12 0x0000000000b1fe79 in mysql_parse (thd=thd@entry=0x62b00016c218, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, parser_state@entry=0x7fffd242ca80) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:7734
#13 0x0000000000b19069 in dispatch_command (command=<optimized out>, thd=0x62b00016c218, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1893
#14 0x0000000000b20b71 in do_command (thd=0x62b00016c218, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1406
#15 0x0000000000f03476 in do_handle_one_connection (connect=<optimized out>, put_in_cache=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1445
#16 0x0000000000f02eb9 in handle_one_connection (arg=arg@entry=0x608001c51cb8) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1347
#17 0x0000000001a00c1b in pfs_spawn_thread (arg=0x617000005498) at /home/wx/mariadb-11.3.0/storage/perfschema/pfs.cc:2201
#18 0x00007ffff79f7609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#19 0x00007ffff770f133 in clone () from /lib/x86_64-linux-gnu/libc.so.6
Attachments
Issue Links
is duplicated by
MDEV-32410make_aggr_tables_info: Use-After-Poison at /mariadb-11.3.0/sql/item.cc:3042
Closed
relates to
MDEV-35846Query succeeds despite unresolved reference to column `a`
The crash for the query is eliminated, however it was found that the query itself is not valid. I filed MDEV-35846 for addressing that.
Oleg Smirnov
added a comment - The crash for the query is eliminated, however it was found that the query itself is not valid. I filed MDEV-35846 for addressing that.
Before the patch the same crash can be reproduced with the following test case as well:
CREATETABLE t1 (a intDEFAULT 2);
INSERTINTO t1 VALUES (1), (2);
SELECT * FROM t1 WHERE EXISTS(SELECTavg(3) OVER (ORDERBYCOUNT( DISTINCT t1.a , hex(t1.a))));
Igor Babaev (Inactive)
added a comment - Before the patch the same crash can be reproduced with the following test case as well:
CREATE TABLE t1 (a int DEFAULT 2);
INSERT INTO t1 VALUES (1), (2);
SELECT * FROM t1 WHERE EXISTS( SELECT avg (3) OVER ( ORDER BY COUNT ( DISTINCT t1.a , hex(t1.a))));
The query in the last test case uses degenerated subquery with a window function with ORDER BY list that is eliminated. If we use a FROM clause for the subquery the query is executed without any problems returning the expected result:
MariaDB [test]> CREATE TABLE t2 (b int);
Query OK, 0 rows affected (0.019 sec)
MariaDB [test]> INSERT INTO t2 VALUES (4);
Query OK, 1 row affected (0.013 sec)
MariaDB [test]> SELECT * FROM t1 WHERE EXISTS(SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a))) FROM t2);
+------+
| a |
+------+
| 1 |
| 2 |
+------+
2 rows in set (0.006 sec)
If we set a breakpoint in the function JOIN::make_aggr_tables_info() at the code:
/* Change sum_fields reference to calculated fields in tmp_table */
items1= ref_ptr_array_slice(2);
if ((sort_and_group || curr_tab->table->group ||
tmp_table_param.precomputed_group_by) &&
!implicit_grouping_without_tables)
{
if (change_to_use_tmp_fields(thd, items1,
tmp_fields_list1, tmp_all_fields1,
fields_list.elements, all_fields))
DBUG_RETURN(true);
}
else
{
if (change_refs_to_tmp_fields(thd, items1,
tmp_fields_list1, tmp_all_fields1,
fields_list.elements, all_fields))
DBUG_RETURN(true);
}
we see that for the query
SELECT * FROM t1 WHERE EXISTS(SELECTavg(3) OVER (ORDERBYCOUNT( DISTINCT t1.a , hex(t1.a))));
the 'else' branch with a call of change_refs_to_tmp_fields() is used while for the query
SELECT * FROM t1 WHERE EXISTS(SELECTavg(3) OVER (ORDERBYCOUNT( DISTINCT t1.a , hex(t1.a))) FROM t2);
the 'then' branch is used with a call of change_to_use_tmp_fields()
Let's use the call of change_to_use_tmp_fields() for the first query with the following diff:
if ((sort_and_group || curr_tab->table->group ||
tmp_table_param.precomputed_group_by) &&
- !implicit_grouping_without_tables)
+ (!implicit_grouping_without_tables ||
+ (implicit_grouping_with_window_funcs &&
+ !select_lex->table_list.elements)))
{
if (change_to_use_tmp_fields(thd, items1,
After having applied this patch I have:
MariaDB [test]> SELECT * FROM t1 WHERE EXISTS(SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a))));
+------+
| a |
+------+
| 1 |
| 2 |
+------+
2 rows in set (0.003 sec)
This is the expected result.
However for the query
SELECT * FROM t1 WHERE (SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a)))) = 3;
as well as for the query
SELECT * FROM t1 WHERE (SELECTavg(3) OVER ()) = 3;
we don't have expected results:
MariaDB [test]> SELECT * FROM t1 WHERE (SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a)))) = 3;
Empty set (0.001 sec)
MariaDB [test]> SELECT * FROM t1 WHERE (SELECT avg(3) OVER ()) = 3;
Empty set (0.000 sec)
Indeed
MariaDB [test]> SELECT avg(3) OVER ();
+----------------+
| avg(3) OVER () |
+----------------+
| 3.0000 |
+----------------+
1 row in set (0.001 sec)
This because of another bug concerning degenerated subqueries with window functions noticed in the previous comments. This bug is reported in MDEV-35869. It makes sense to fix MDEV-35869 first.
Igor Babaev (Inactive)
added a comment - - edited The query in the last test case uses degenerated subquery with a window function with ORDER BY list that is eliminated. If we use a FROM clause for the subquery the query is executed without any problems returning the expected result:
MariaDB [test]> CREATE TABLE t2 (b int);
Query OK, 0 rows affected (0.019 sec)
MariaDB [test]> INSERT INTO t2 VALUES (4);
Query OK, 1 row affected (0.013 sec)
MariaDB [test]> SELECT * FROM t1 WHERE EXISTS(SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a))) FROM t2);
+------+
| a |
+------+
| 1 |
| 2 |
+------+
2 rows in set (0.006 sec)
If we set a breakpoint in the function JOIN::make_aggr_tables_info() at the code:
/* Change sum_fields reference to calculated fields in tmp_table */
items1= ref_ptr_array_slice(2);
if ((sort_and_group || curr_tab->table->group ||
tmp_table_param.precomputed_group_by) &&
!implicit_grouping_without_tables)
{
if (change_to_use_tmp_fields(thd, items1,
tmp_fields_list1, tmp_all_fields1,
fields_list.elements, all_fields))
DBUG_RETURN(true);
}
else
{
if (change_refs_to_tmp_fields(thd, items1,
tmp_fields_list1, tmp_all_fields1,
fields_list.elements, all_fields))
DBUG_RETURN(true);
}
we see that for the query
SELECT * FROM t1 WHERE EXISTS( SELECT avg (3) OVER ( ORDER BY COUNT ( DISTINCT t1.a , hex(t1.a))));
the 'else' branch with a call of change_refs_to_tmp_fields() is used while for the query
SELECT * FROM t1 WHERE EXISTS( SELECT avg (3) OVER ( ORDER BY COUNT ( DISTINCT t1.a , hex(t1.a))) FROM t2);
the 'then' branch is used with a call of change_to_use_tmp_fields()
Let's use the call of change_to_use_tmp_fields() for the first query with the following diff:
if ((sort_and_group || curr_tab->table->group ||
tmp_table_param.precomputed_group_by) &&
- !implicit_grouping_without_tables)
+ (!implicit_grouping_without_tables ||
+ (implicit_grouping_with_window_funcs &&
+ !select_lex->table_list.elements)))
{
if (change_to_use_tmp_fields(thd, items1,
After having applied this patch I have:
MariaDB [test]> SELECT * FROM t1 WHERE EXISTS(SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a))));
+------+
| a |
+------+
| 1 |
| 2 |
+------+
2 rows in set (0.003 sec)
This is the expected result.
However for the query
SELECT * FROM t1 WHERE (SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a)))) = 3;
as well as for the query
SELECT * FROM t1 WHERE ( SELECT avg (3) OVER ()) = 3;
we don't have expected results:
MariaDB [test]> SELECT * FROM t1 WHERE (SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a)))) = 3;
Empty set (0.001 sec)
MariaDB [test]> SELECT * FROM t1 WHERE (SELECT avg(3) OVER ()) = 3;
Empty set (0.000 sec)
Indeed
MariaDB [test]> SELECT avg(3) OVER ();
+----------------+
| avg(3) OVER () |
+----------------+
| 3.0000 |
+----------------+
1 row in set (0.001 sec)
This because of another bug concerning degenerated subqueries with window functions noticed in the previous comments. This bug is reported in MDEV-35869 . It makes sense to fix MDEV-35869 first.
The fix is pushed and released, so this issue is closed with specific fix versions. A followup is moved into MDEV-36021. Please, feel free to add more content to MDEV-36021 description
Sergei Golubchik
added a comment - The fix is pushed and released, so this issue is closed with specific fix versions. A followup is moved into MDEV-36021 . Please, feel free to add more content to MDEV-36021 description
People
Oleg Smirnov
Xin Wen
Votes:
0Vote for this issue
Watchers:
9Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1295.8999999761581,"ttfb":341.8000000715256,"pageVisibility":"visible","entityId":125665,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b33b0c44-5530-4f2d-a98a-66fa5df2394d","navigationType":0,"readyForUser":1388.8000000715256,"redirectCount":0,"resourceLoadedEnd":926.3999999761581,"resourceLoadedStart":347.8000000715256,"resourceTiming":[{"duration":66.39999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":347.8000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":347.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":414.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":66.79999995231628,"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":348.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":348.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":414.89999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":421,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":348.3000000715256,"connectEnd":348.3000000715256,"connectStart":348.3000000715256,"domainLookupEnd":348.3000000715256,"domainLookupStart":348.3000000715256,"fetchStart":348.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":419,"responseEnd":769.3000000715256,"responseStart":517.5,"secureConnectionStart":348.3000000715256},{"duration":577.7999999523163,"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":348.60000002384186,"connectEnd":348.60000002384186,"connectStart":348.60000002384186,"domainLookupEnd":348.60000002384186,"domainLookupStart":348.60000002384186,"fetchStart":348.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":418.7000000476837,"responseEnd":926.3999999761581,"responseStart":490.5,"secureConnectionStart":348.60000002384186},{"duration":177.69999992847443,"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":348.7000000476837,"connectEnd":348.7000000476837,"connectStart":348.7000000476837,"domainLookupEnd":348.7000000476837,"domainLookupStart":348.7000000476837,"fetchStart":348.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":419,"responseEnd":526.3999999761581,"responseStart":524.2000000476837,"secureConnectionStart":348.7000000476837},{"duration":188.40000009536743,"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":348.89999997615814,"connectEnd":348.89999997615814,"connectStart":348.89999997615814,"domainLookupEnd":348.89999997615814,"domainLookupStart":348.89999997615814,"fetchStart":348.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":427.60000002384186,"responseEnd":537.3000000715256,"responseStart":527.6000000238419,"secureConnectionStart":348.89999997615814},{"duration":188.5,"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":349.10000002384186,"connectEnd":349.10000002384186,"connectStart":349.10000002384186,"domainLookupEnd":349.10000002384186,"domainLookupStart":349.10000002384186,"fetchStart":349.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":428,"responseEnd":537.6000000238419,"responseStart":532.3000000715256,"secureConnectionStart":349.10000002384186},{"duration":73.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":349.3000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":349.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":422.8000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":188.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":349.5,"connectEnd":349.5,"connectStart":349.5,"domainLookupEnd":349.5,"domainLookupStart":349.5,"fetchStart":349.5,"redirectEnd":0,"redirectStart":0,"requestStart":428.2000000476837,"responseEnd":537.7000000476837,"responseStart":533.7000000476837,"secureConnectionStart":349.5},{"duration":74.60000002384186,"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":349.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":349.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":424.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":227.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":349.8000000715256,"connectEnd":349.8000000715256,"connectStart":349.8000000715256,"domainLookupEnd":349.8000000715256,"domainLookupStart":349.8000000715256,"fetchStart":349.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":429,"responseEnd":577.3000000715256,"responseStart":535.1000000238419,"secureConnectionStart":349.8000000715256},{"duration":564,"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":355.7000000476837,"connectEnd":355.7000000476837,"connectStart":355.7000000476837,"domainLookupEnd":355.7000000476837,"domainLookupStart":355.7000000476837,"fetchStart":355.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":601.7000000476837,"responseEnd":919.7000000476837,"responseStart":888.1000000238419,"secureConnectionStart":355.7000000476837},{"duration":561.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":358.60000002384186,"connectEnd":358.60000002384186,"connectStart":358.60000002384186,"domainLookupEnd":358.60000002384186,"domainLookupStart":358.60000002384186,"fetchStart":358.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":602.1000000238419,"responseEnd":920.1000000238419,"responseStart":889.3999999761581,"secureConnectionStart":358.60000002384186},{"duration":208.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":907.3000000715256,"connectEnd":907.3000000715256,"connectStart":907.3000000715256,"domainLookupEnd":907.3000000715256,"domainLookupStart":907.3000000715256,"fetchStart":907.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":1068.3999999761581,"responseEnd":1115.3999999761581,"responseStart":1102,"secureConnectionStart":907.3000000715256},{"duration":294.39999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1223.1000000238419,"connectEnd":1223.1000000238419,"connectStart":1223.1000000238419,"domainLookupEnd":1223.1000000238419,"domainLookupStart":1223.1000000238419,"fetchStart":1223.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":1482,"responseEnd":1517.5,"responseStart":1513.1000000238419,"secureConnectionStart":1223.1000000238419},{"duration":307.40000009536743,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1276.3999999761581,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1276.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1583.8000000715256,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":115,"responseStart":342,"responseEnd":358,"domLoading":345,"domInteractive":1594,"domContentLoadedEventStart":1594,"domContentLoadedEventEnd":1684,"domComplete":2169,"loadEventStart":2169,"loadEventEnd":2169,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1509.3000000715256},{"name":"bigPipe.sidebar-id.end","time":1510.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":1510.3000000715256},{"name":"bigPipe.activity-panel-pipe-id.end","time":1520},{"name":"activityTabFullyLoaded","time":1703.7000000476837}],"measures":[],"correlationId":"eb6d9907957c","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":150,"dbReadsTimeInMs":29,"dbConnsTimeInMs":41,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
For the build just before the pushed patch we have:
MariaDB [test]> CREATE TABLE t1 (a int DEFAULT 2);
Query OK, 0 rows affected (0.014 sec)
MariaDB [test]> INSERT INTO t1 VALUES (1), (2);
Query OK, 2 rows affected (0.007 sec)
Records: 2 Duplicates: 0 Warnings: 0
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
+------+
2 rows in set (0.001 sec)
MariaDB [test]> INSERT INTO t1 SELECT avg(4);
Query OK, 1 row affected (0.004 sec)
Records: 1 Duplicates: 0 Warnings: 0
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
+------+
3 rows in set (0.001 sec)
MariaDB [test]> INSERT INTO t1 SELECT avg(4) OVER ();
Query OK, 1 row affected (0.003 sec)
Records: 1 Duplicates: 0 Warnings: 0
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
+------+
4 rows in set (0.001 sec)
MariaDB [test]> INSERT INTO t1 VALUES((SELECT avg(4)));
Query OK, 1 row affected (0.004 sec)
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
+------+
5 rows in set (0.003 sec)
MariaDB [test]> INSERT INTO t1 VALUES((SELECT avg(4) OVER ()));
Query OK, 1 row affected (0.005 sec)
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
| NULL |
+------+
6 rows in set (0.002 sec)
MariaDB [test]> SELECT avg(4) OVER ();
+----------------+
| avg(4) OVER () |
+----------------+
| 4.0000 |
+----------------+
1 row in set (0.001 sec)
MariaDB [test]> INSERT INTO t1 SELECT avg(4) OVER (ORDER BY t1.a);
ERROR 1109 (42S02): Unknown table 't1' in order clause
MariaDB [test]> INSERT INTO t1 SELECT avg(4) ORDER BY t1.a;
ERROR 1109 (42S02): Unknown table 't1' in order clause
MariaDB [test]> INSERT INTO t1 VALUES((SELECT avg(4) ORDER BY t1.a));
Query OK, 1 row affected (0.005 sec)
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
| NULL |
| 4 |
+------+
7 rows in set (0.001 sec)
MariaDB [test]> INSERT INTO t1 VALUES((SELECT avg(4) OVER (ORDER BY t1.a)));
Query OK, 1 row affected (0.005 sec)
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
| NULL |
| 4 |
| NULL |
+------+
8 rows in set (0.002 sec)
MariaDB [test]> CREATE TABLE t2 (b int);
Query OK, 0 rows affected (0.018 sec)
MariaDB [test]> INSERT INTO t2 VALUES (2);
Query OK, 1 row affected (0.006 sec)
MariaDB [test]> INSERT INTO t1 SELECT avg(4) OVER () FROM t2;
Query OK, 1 row affected (0.005 sec)
Records: 1 Duplicates: 0 Warnings: 0
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
| NULL |
| 4 |
| NULL |
| 4 |
+------+
9 rows in set (0.002 sec)
MariaDB [test]> INSERT INTO t1 SELECT avg(4) OVER (ORDER BY t1.a) FROM t2;
ERROR 1054 (42S22): Unknown column 't1.a' in 'order clause'
MariaDB [test]> INSERT INTO t1 VALUES((SELECT avg(4) OVER () FROM t2));
Query OK, 1 row affected (0.006 sec)
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
| NULL |
| 4 |
| NULL |
| 4 |
| 4 |
+------+
10 rows in set (0.002 sec)
MariaDB [test]> INSERT INTO t1 SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT a , hex(a)));
ERROR 1054 (42S22): Unknown column 'a' in 'order clause'
MariaDB [test]> INSERT INTO t1 VALUES((SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT a , hex(a)))));
Query OK, 1 row affected (0.005 sec)
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
| NULL |
| 4 |
| NULL |
| 4 |
| 4 |
| NULL |
+------+
11 rows in set (0.002 sec)
MariaDB [test]> INSERT INTO t1 VALUES(EXISTS(SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT a , hex(a)))));
ERROR 2013 (HY000): Lost connection to MySQL server during query
MariaDB [test]> INSERT INTO t1 VALUES(EXISTS(SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a)))));
ERROR 2013 (HY000): Lost connection to MySQL server during query
MariaDB [test]> INSERT INTO t1 VALUES((SELECT avg(3) OVER (ORDER BY COUNT( DISTINCT t1.a , hex(t1.a)))));
Query OK, 1 row affected (0.015 sec)
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
| NULL |
| 4 |
| NULL |
| 4 |
| 4 |
| NULL |
| NULL |
+------+
12 rows in set (0.002 sec)
MariaDB [test]> INSERT INTO t1 SELECT * FROM t2 WHERE (SELECT avg(t1.a) FROM t1 t) > 0;
ERROR 1054 (42S22): Unknown column 't1.a' in 'field list'
MariaDB [test]> INSERT INTO t1 VALUES(( SELECT * FROM t2 WHERE (SELECT avg(t1.a) FROM t1 t) > 0));
Query OK, 1 row affected (0.005 sec)
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
| NULL |
| 4 |
| NULL |
| 4 |
| 4 |
| NULL |
| NULL |
| 2 |
+------+
13 rows in set (0.002 sec)
MariaDB [test]> INSERT INTO t1 VALUES((SELECT t2.b FROM t2 WHERE (SELECT 1 FROM (VALUES((SELECT avg(3) FROM t2))) dt) > 0));
Query OK, 1 row affected (0.004 sec)
MariaDB [test]> SELECT * FROM t1;
+------+
| a |
+------+
| 1 |
| 2 |
| 4 |
| 4 |
| 4 |
| NULL |
| 4 |
| NULL |
| 4 |
| 4 |
| NULL |
| NULL |
| 2 |
| 2 |
+------+
14 rows in set (0.001 sec)
MariaDB [test]> INSERT INTO t1 VALUES((SELECT t2.b FROM t2 WHERE (SELECT 1 FROM (VALUES((SELECT avg(t1.a) FROM t2))) dt) > 0));
ERROR 1054 (42S22): Unknown column 't1.a' in 'field list'
MariaDB [test]> INSERT INTO t1 VALUES((SELECT t2.b FROM t2 WHERE (SELECT 1 FROM (SELECT avg(t1.a) FROM t2) dt) > 0));
ERROR 1054 (42S22): Unknown column 't1.a' in 'field list'