Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
11.7
Description
CREATE TABLE t1 (a INT, b VARCHAR(1024)); |
INSERT INTO t1 VALUES (1,REPEAT('x',513)); |
UPDATE t1 SET a = 2 ORDER BY b; |
|
CREATE TABLE t2 (c INT); |
INSERT INTO t2 SELECT c FROM t2; |
|
# Cleanup
|
DROP TABLE t1, t2; |
main-based non-debug build |
mysqltest: At line 6: query 'INSERT INTO t2 SELECT c FROM t2' failed: WARN_SORTING_ON_TRUNCATED_LENGTH (4202): 1 values were longer than max_sort_length. Sorting used only the first 1024 bytes
|
Given that there is no ORDER BY in the INSERT statement, and the table is empty anyway (nothing to sort), the complaint is surprising. Maybe it was meant to be issued for the earlier UPDATE, but note that it's an error, not a warning.
On a debug build, INSERT fails on the traditional diagnostics area assertion:
main 4b6922a315fa5411665ac99c0b40fd7238093403 |
mariadbd: /data/bld/1x.main/sql/sql_error.cc:470: void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*): Assertion `! is_set() || m_can_overwrite_status' failed.
|
241028 18:28:57 [ERROR] mysqld got signal 6 ;
|
|
#9 0x00007fd572a53e32 in __GI___assert_fail (assertion=0x55b76540cf60 "! is_set() || m_can_overwrite_status", file=0x55b76540c8a0 "/data/bld/1x.main/sql/sql_error.cc", line=470, function=0x55b76540cfc0 "void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*)") at ./assert/assert.c:101
|
#10 0x000055b7630454a3 in Diagnostics_area::set_error_status (this=0x62c0000c63f0, sql_errno=4202, message=0x7fd567511130 "1 values were longer than max_sort_length. Sorting used only the first 1024 bytes", sqlstate=0x55b7654fdbc0 "HY000", ucid=..., error_condition=0x0) at /data/bld/1x.main/sql/sql_error.cc:470
|
#11 0x000055b762fce283 in THD::raise_condition (this=0x62c0000c0218, cond=0x7fd567510da0) at /data/bld/1x.main/sql/sql_class.cc:1164
|
#12 0x000055b762d65d6e in THD::raise_condition (this=0x62c0000c0218, sql_errno=4202, sqlstate=0x55b76540d480 "", level=Sql_state_errno_level::WARN_LEVEL_WARN, msg=0x7fd567511130 "1 values were longer than max_sort_length. Sorting used only the first 1024 bytes") at /data/bld/1x.main/sql/sql_class.h:5250
|
#13 0x000055b763046ebe in push_warning (thd=0x62c0000c0218, level=Sql_state_errno_level::WARN_LEVEL_WARN, code=4202, msg=0x7fd567511130 "1 values were longer than max_sort_length. Sorting used only the first 1024 bytes") at /data/bld/1x.main/sql/sql_error.cc:755
|
#14 0x000055b763047284 in push_warning_printf (thd=0x62c0000c0218, level=Sql_state_errno_level::WARN_LEVEL_WARN, code=4202, format=0x55b7659a5a20 "%llu values were longer than max_sort_length. Sorting used only the first %lu bytes") at /data/bld/1x.main/sql/sql_error.cc:790
|
#15 0x000055b76332190e in THD::push_final_warnings (this=0x62c0000c0218) at /data/bld/1x.main/sql/sql_class.h:6072
|
#16 0x000055b763249920 in mysql_select (thd=0x62c0000c0218, tables=0x6290000e7110, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=37385559870208, result=0x6290000e8210, unit=0x62c0000c4728, select_lex=0x6290000e6a88) at /data/bld/1x.main/sql/sql_select.cc:5369
|
#17 0x000055b763217d89 in handle_select (thd=0x62c0000c0218, lex=0x62c0000c4648, result=0x6290000e8210, setup_tables_done_option=35184372088832) at /data/bld/1x.main/sql/sql_select.cc:643
|
#18 0x000055b76312f473 in mysql_execute_command (thd=0x62c0000c0218, is_called_from_prepared_stmt=false) at /data/bld/1x.main/sql/sql_parse.cc:4651
|
#19 0x000055b76314530e in mysql_parse (thd=0x62c0000c0218, rawbuf=0x6290000e6238 "INSERT INTO t2 SELECT c FROM t2", length=31, parser_state=0x7fd5675129d0) at /data/bld/1x.main/sql/sql_parse.cc:7889
|
#20 0x000055b76311c2ba in dispatch_command (command=COM_QUERY, thd=0x62c0000c0218, packet=0x629000253219 "INSERT INTO t2 SELECT c FROM t2", packet_length=31, blocking=true) at /data/bld/1x.main/sql/sql_parse.cc:1892
|
#21 0x000055b763118fc2 in do_command (thd=0x62c0000c0218, blocking=true) at /data/bld/1x.main/sql/sql_parse.cc:1405
|
#22 0x000055b763609d1e in do_handle_one_connection (connect=0x6080000036b8, put_in_cache=true) at /data/bld/1x.main/sql/sql_connect.cc:1448
|
#23 0x000055b7636096da in handle_one_connection (arg=0x608000003638) at /data/bld/1x.main/sql/sql_connect.cc:1350
|
#24 0x000055b7642a1476 in pfs_spawn_thread (arg=0x617000005b98) at /data/bld/1x.main/storage/perfschema/pfs.cc:2198
|
#25 0x00007fd572aa8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
|
#26 0x00007fd572b2861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
|
The failure started happening after this commit in the "main" branch, to be 11.7:
commit fd87e01f389451227e604da7a0989c0afc78ce42 (origin/bb-11.7-MDEV-27277-final)
|
Author: Oleg Smirnov
|
AuthorDate: Mon Sep 4 13:15:06 2023 +0700
|
CommitDate: Tue Oct 22 22:39:36 2024 +0700
|
Attachments
Issue Links
- is caused by
-
MDEV-27277 Please add a warning when max_sort_length is reached.
- Closed
- relates to
-
MDEV-35307 Unexpected error WARN_SORTING_ON_TRUNCATED_LENGTH or assertion failure in diagnostics area #2
- Closed