Note: Fix for MDEV-35275 is already in the tree.
--source include/have_innodb.inc
|
|
CREATE TABLE t (f varchar(1024)) ENGINE=InnoDB;
|
INSERT INTO t VALUES (REPEAT('A',1000)),(REPEAT('B',1000));
|
INSERT INTO t (f) SELECT f FROM t ORDER BY f;
|
|
# Cleanup
|
DROP TABLE t;
|
Now a warning upon INSERT .. SELECT would probably be expected, but instead it produces an error WARN_SORTING_ON_TRUNCATED_LENGTH on a non-debug build:
main bf9662f6fa56cc3c14f4cb8281beb523c941d1e1
|
CREATE TABLE t (f varchar(1024)) ENGINE=InnoDB;
|
INSERT INTO t VALUES (REPEAT('A',1000)),(REPEAT('B',1000));
|
INSERT INTO t (f) SELECT f FROM t ORDER BY f;
|
bug.w2 [ fail ]
|
Test ended at 2024-10-31 22:05:46
|
|
CURRENT_TEST: bug.w2
|
mysqltest: At line 5: query 'INSERT INTO t (f) SELECT f FROM t ORDER BY f' failed: WARN_SORTING_ON_TRUNCATED_LENGTH (4202): 2 values were longer than max_sort_length. Sorting used only the first 1024 bytes
|
and a debug build fails on the assertion
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.
|
241031 22:08:08 [ERROR] mysqld got signal 6 ;
|
|
#9 0x00007fd9b2653e32 in __GI___assert_fail (assertion=0x562f5e9dcf60 "! is_set() || m_can_overwrite_status", file=0x562f5e9dc8a0 "/data/bld/1x.main/sql/sql_error.cc", line=470, function=0x562f5e9dcfc0 "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 0x0000562f5c6124a3 in Diagnostics_area::set_error_status (this=0x62c0001e63f0, sql_errno=4202, message=0x7fd9a2ed7130 "2 values were longer than max_sort_length. Sorting used only the first 1024 bytes", sqlstate=0x562f5eacdbc0 "HY000", ucid=..., error_condition=0x0) at /data/bld/1x.main/sql/sql_error.cc:470
|
#11 0x0000562f5c59b283 in THD::raise_condition (this=0x62c0001e0218, cond=0x7fd9a2ed6da0) at /data/bld/1x.main/sql/sql_class.cc:1164
|
#12 0x0000562f5c332d6e in THD::raise_condition (this=0x62c0001e0218, sql_errno=4202, sqlstate=0x562f5e9dd480 "", level=Sql_state_errno_level::WARN_LEVEL_WARN, msg=0x7fd9a2ed7130 "2 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 0x0000562f5c613ebe in push_warning (thd=0x62c0001e0218, level=Sql_state_errno_level::WARN_LEVEL_WARN, code=4202, msg=0x7fd9a2ed7130 "2 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 0x0000562f5c614284 in push_warning_printf (thd=0x62c0001e0218, level=Sql_state_errno_level::WARN_LEVEL_WARN, code=4202, format=0x562f5ef74760 "%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 0x0000562f5c651360 in THD::push_final_warnings (this=0x62c0001e0218) at /data/bld/1x.main/sql/sql_class.h:6072
|
#16 0x0000562f5c816a2e in mysql_select (thd=0x62c0001e0218, tables=0x6290000fb280, fields=..., conds=0x0, og_num=1, order=0x6290000fc390, group=0x0, having=0x0, proc_param=0x0, select_options=37385559870208, result=0x6290000fc4c0, unit=0x62c0001e4728, select_lex=0x6290000fabf8) at /data/bld/1x.main/sql/sql_select.cc:5369
|
#17 0x0000562f5c7e4e97 in handle_select (thd=0x62c0001e0218, lex=0x62c0001e4648, result=0x6290000fc4c0, setup_tables_done_option=35184372088832) at /data/bld/1x.main/sql/sql_select.cc:643
|
#18 0x0000562f5c6fc581 in mysql_execute_command (thd=0x62c0001e0218, is_called_from_prepared_stmt=false) at /data/bld/1x.main/sql/sql_parse.cc:4651
|
#19 0x0000562f5c71241c in mysql_parse (thd=0x62c0001e0218, rawbuf=0x6290000fa238 "INSERT INTO t (f) SELECT f FROM t ORDER BY f", length=44, parser_state=0x7fd9a2ed89d0) at /data/bld/1x.main/sql/sql_parse.cc:7889
|
#20 0x0000562f5c6e93c8 in dispatch_command (command=COM_QUERY, thd=0x62c0001e0218, packet=0x629000280219 "INSERT INTO t (f) SELECT f FROM t ORDER BY f", packet_length=44, blocking=true) at /data/bld/1x.main/sql/sql_parse.cc:1892
|
#21 0x0000562f5c6e60d0 in do_command (thd=0x62c0001e0218, blocking=true) at /data/bld/1x.main/sql/sql_parse.cc:1405
|
#22 0x0000562f5cbd6d1e in do_handle_one_connection (connect=0x608000004cb8, put_in_cache=true) at /data/bld/1x.main/sql/sql_connect.cc:1448
|
#23 0x0000562f5cbd66da in handle_one_connection (arg=0x608000004c38) at /data/bld/1x.main/sql/sql_connect.cc:1350
|
#24 0x0000562f5d86f578 in pfs_spawn_thread (arg=0x617000008218) at /data/bld/1x.main/storage/perfschema/pfs.cc:2198
|
#25 0x00007fd9b26a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
|
#26 0x00007fd9b272861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
|
{"report":{"fcp":1960.6000003814697,"ttfb":880.8999996185303,"pageVisibility":"visible","entityId":131438,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"5c5e6bb2-4ea3-46f6-9384-e4520883de9e","navigationType":0,"readyForUser":2048.1000003814697,"redirectCount":0,"resourceLoadedEnd":2670.699999809265,"resourceLoadedStart":887,"resourceTiming":[{"duration":541,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":887,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":887,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1428,"responseStart":0,"secureConnectionStart":0},{"duration":541,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":887.3000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":887.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1428.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":595.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":887.3999996185303,"connectEnd":887.3999996185303,"connectStart":887.3999996185303,"domainLookupEnd":887.3999996185303,"domainLookupStart":887.3999996185303,"fetchStart":887.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":887.3999996185303,"responseEnd":1482.5,"responseStart":1482.5,"secureConnectionStart":887.3999996185303},{"duration":654.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":887.5,"connectEnd":887.5,"connectStart":887.5,"domainLookupEnd":887.5,"domainLookupStart":887.5,"fetchStart":887.5,"redirectEnd":0,"redirectStart":0,"requestStart":887.5,"responseEnd":1541.6999998092651,"responseStart":1541.6999998092651,"secureConnectionStart":887.5},{"duration":657.5999994277954,"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":887.8000001907349,"connectEnd":887.8000001907349,"connectStart":887.8000001907349,"domainLookupEnd":887.8000001907349,"domainLookupStart":887.8000001907349,"fetchStart":887.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":887.8000001907349,"responseEnd":1545.3999996185303,"responseStart":1545.3999996185303,"secureConnectionStart":887.8000001907349},{"duration":657.8999996185303,"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":888,"connectEnd":888,"connectStart":888,"domainLookupEnd":888,"domainLookupStart":888,"fetchStart":888,"redirectEnd":0,"redirectStart":0,"requestStart":888,"responseEnd":1545.8999996185303,"responseStart":1545.8999996185303,"secureConnectionStart":888},{"duration":658.1000003814697,"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":888.1999998092651,"connectEnd":888.1999998092651,"connectStart":888.1999998092651,"domainLookupEnd":888.1999998092651,"domainLookupStart":888.1999998092651,"fetchStart":888.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":888.1999998092651,"responseEnd":1546.3000001907349,"responseStart":1546.3000001907349,"secureConnectionStart":888.1999998092651},{"duration":746.4000005722046,"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":888.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":888.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1634.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":658.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":888.5,"connectEnd":888.5,"connectStart":888.5,"domainLookupEnd":888.5,"domainLookupStart":888.5,"fetchStart":888.5,"redirectEnd":0,"redirectStart":0,"requestStart":888.5,"responseEnd":1546.6999998092651,"responseStart":1546.6999998092651,"secureConnectionStart":888.5},{"duration":746.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":888.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":888.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1635.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":658.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":888.8000001907349,"connectEnd":888.8000001907349,"connectStart":888.8000001907349,"domainLookupEnd":888.8000001907349,"domainLookupStart":888.8000001907349,"fetchStart":888.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":888.8000001907349,"responseEnd":1547.3000001907349,"responseStart":1547.3000001907349,"secureConnectionStart":888.8000001907349},{"duration":1491.4000005722046,"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":889.8999996185303,"connectEnd":889.8999996185303,"connectStart":889.8999996185303,"domainLookupEnd":889.8999996185303,"domainLookupStart":889.8999996185303,"fetchStart":889.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":889.8999996185303,"responseEnd":2381.300000190735,"responseStart":2381.300000190735,"secureConnectionStart":889.8999996185303},{"duration":1780.8000001907349,"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":889.8999996185303,"connectEnd":889.8999996185303,"connectStart":889.8999996185303,"domainLookupEnd":889.8999996185303,"domainLookupStart":889.8999996185303,"fetchStart":889.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":889.8999996185303,"responseEnd":2670.699999809265,"responseStart":2670.699999809265,"secureConnectionStart":889.8999996185303},{"duration":740.3999996185303,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1653.8000001907349,"connectEnd":1653.8000001907349,"connectStart":1653.8000001907349,"domainLookupEnd":1653.8000001907349,"domainLookupStart":1653.8000001907349,"fetchStart":1653.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1653.8000001907349,"responseEnd":2394.199999809265,"responseStart":2394.199999809265,"secureConnectionStart":1653.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":710,"responseStart":881,"responseEnd":882,"domLoading":884,"domInteractive":2695,"domContentLoadedEventStart":2695,"domContentLoadedEventEnd":2741,"domComplete":3042,"loadEventStart":3042,"loadEventEnd":3043,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2675.6000003814697},{"name":"bigPipe.sidebar-id.end","time":2676.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":2676.800000190735},{"name":"bigPipe.activity-panel-pipe-id.end","time":2678},{"name":"activityTabFullyLoaded","time":2756.5}],"measures":[],"correlationId":"8c0ff52480e387","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":18,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}