I don't know if this is supposed to be supported, because I couldn't find any documentation. But in all cases, note that this syntax is supported by Oracle, so it is at least a reasonable attempt.
Attachments
Issue Links
duplicates
MDEV-17894Assertion `(thd->lex)->current_select' failed in MYSQLparse(), query with VALUES()
In the meanwhile, I suggest to document the VALUES statement, so it will be clear if ORDER BY is supposed to be allowed or not.
Federico Razzoli
added a comment - In the meanwhile, I suggest to document the VALUES statement, so it will be clear if ORDER BY is supposed to be allowed or not.
Thank you for the report!
It crashes server, on debug server - assertion
mysqld: /git/10.3/sql/sql_yacc.yy:12791: int MYSQLparse(THD*): Assertion `sel->master_unit()->fake_select_lex' failed.
181213 17:21:34 [ERROR] mysqld got signal 6 ;
linux/raise.c:54(__GI_raise)[0x7f0ce1bd5428]
stdlib/abort.c:91(__GI_abort)[0x7f0ce1bd702a]
assert/assert.c:92(__assert_fail_base)[0x7f0ce1bcdbd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f0ce1bcdc82]
sql/sql_yacc.yy:12792(MYSQLparse(THD*))[0x56023c681a17]
sql/sql_parse.cc:10102(parse_sql(THD*, Parser_state*, Object_creation_ctx*, bool))[0x56023c15c39a]
sql/sql_parse.cc:8044(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x56023c14ff03]
sql/sql_parse.cc:1852(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x56023c12ae30]
sql/sql_parse.cc:1395(do_command(THD*))[0x56023c127fc8]
sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x56023c47af0b]
sql/sql_connect.cc:1309(handle_one_connection)[0x56023c47a8e8]
perfschema/pfs.cc:1864(pfs_spawn_thread)[0x56023d7a1ab7]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f0ce28126ba]
x86_64/clone.S:111(clone)[0x7f0ce1ca741d]
Query (0x62b0000003d0): VALUES (1), (2), (3) ORDER BY 1
mysqld: /git/10.3/sql/sql_yacc.yy:12833: int MYSQLparse(THD*): Assertion `(thd->lex)->current_select' failed.
181213 17:22:35 [ERROR] mysqld got signal 6 ;
linux/raise.c:54(__GI_raise)[0x7f42570a3428]
stdlib/abort.c:91(__GI_abort)[0x7f42570a502a]
assert/assert.c:92(__assert_fail_base)[0x7f425709bbd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f425709bc82]
sql/sql_yacc.yy:12841(MYSQLparse(THD*))[0x55e8a4b0fe84]
sql/sql_parse.cc:10102(parse_sql(THD*, Parser_state*, Object_creation_ctx*, bool))[0x55e8a45ea39a]
sql/sql_parse.cc:8044(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55e8a45ddf03]
sql/sql_parse.cc:1852(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55e8a45b8e30]
sql/sql_parse.cc:1395(do_command(THD*))[0x55e8a45b5fc8]
sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x55e8a4908f0b]
sql/sql_connect.cc:1309(handle_one_connection)[0x55e8a49088e8]
perfschema/pfs.cc:1864(pfs_spawn_thread)[0x55e8a5c2fab7]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f4257ce06ba]
x86_64/clone.S:111(clone)[0x7f425717541d]
Query (0x62b0000003d0): VALUES (1), (2), (3) limit 1