Commit 9ce3f47b authored by Oleg Smirnov's avatar Oleg Smirnov

MDEV-27277 Fix code review comments

parent d225b8d1
......@@ -146,6 +146,11 @@ while ($_dt_tables)
--echo # increasing group_concat_max_len from $_dt_old_group_concat_max_len to $_dt_order_by_length
}
}
# Increase sorting buffers.
--let $_dt_old_max_sort_length= `SELECT @@SESSION.max_sort_length`
--let $_dt_old_sort_buffer_size= `SELECT @@SESSION.sort_buffer_size`
--eval SET SESSION max_sort_length = 8388608;
--eval SET SESSION sort_buffer_size = 1000000000;
# Generate ORDER BY clause.
# It would be better to do GROUP_CONCAT(CONCAT('`', column_name, '`')) but
# BUG#58087 prevents us from returning strings that begin with backticks.
......@@ -170,6 +175,9 @@ while ($_dt_tables)
--let $_dt_outfile= $_dt_outfile/diff_table-$_dt_connection-$_dt_database-$_dt_table
eval SELECT * INTO OUTFILE '$_dt_outfile' FROM $_dt_database.$_dt_table ORDER BY `$_dt_column_list`;
--enable_ps2_protocol
# Restore sorting buffers.
--eval SET SESSION max_sort_length = $_dt_old_max_sort_length;
--eval SET SESSION sort_buffer_size = $_dt_old_sort_buffer_size;
# Compare files.
if ($_dt_prev_outfile)
......
......@@ -681,10 +681,10 @@ INSERT INTO t1 VALUES
(REPEAT(0x1125,200000), REPEAT(0x1125,200000)), ('', ''), ('', '');
SELECT a FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
Warnings:
Warning 4201 1 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 1 values were longer than max_sort_length. Sorting used only the first 1024 bytes
SELECT b FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
Warnings:
Warning 4201 1 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 1 values were longer than max_sort_length. Sorting used only the first 1024 bytes
DROP TABLES t1;
End of 5.0 tests
#
......
......@@ -1919,7 +1919,7 @@ SELECT SUBSTRING(a,1,10), LENGTH(a), GROUP_CONCAT(b) FROM t1 GROUP BY a;
SUBSTRING(a,1,10) LENGTH(a) GROUP_CONCAT(b)
1111111111 1300 one,two
Warnings:
Warning 4201 2 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 2 values were longer than max_sort_length. Sorting used only the first 1024 bytes
EXPLAIN
SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
id 1
......@@ -1936,7 +1936,7 @@ SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
SUBSTRING(a,1,10) LENGTH(a)
1111111111 1300
Warnings:
Warning 4201 1 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 1 values were longer than max_sort_length. Sorting used only the first 1024 bytes
DROP TABLE t1;
#
# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
......@@ -2733,7 +2733,7 @@ f1 f2
NULL
NULL NULL
Warnings:
Warning 4201 116 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 116 values were longer than max_sort_length. Sorting used only the first 1024 bytes
SET @@sort_buffer_size = @old_sort_buff_size;
DROP TABLE t1;
#
......
......@@ -860,7 +860,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxab
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaa
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz
Warnings:
Warning 4201 2 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 2 values were longer than max_sort_length. Sorting used only the first 64 bytes
drop table t1;
create table t1 (
`sid` decimal(8,0) default null,
......@@ -4125,7 +4125,7 @@ a substr(b, @save_max_sort_length+1)
2 AB
1 A
Warnings:
Warning 4201 5 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 5 values were longer than max_sort_length. Sorting used only the first 1024 bytes
analyze format=json
select a, substr(b, @save_max_sort_length+1) from t1 order by b desc;
ANALYZE
......@@ -4172,7 +4172,7 @@ ANALYZE
}
}
Warnings:
Warning 4201 5 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 5 values were longer than max_sort_length. Sorting used only the first 1024 bytes
drop table t1;
#
# Packing sort keys with complex collations
......
......@@ -827,7 +827,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy
Warnings:
Warning 4201 4 strings were longer than max_sort_length. Sorting used only the first 200 bytes
Warning 4201 4 values were longer than max_sort_length. Sorting used only the first 200 bytes
reset query cache;
set max_sort_length=64;
select c from t1 order by c, id;
......@@ -837,7 +837,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy
Warnings:
Warning 4201 4 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 4 values were longer than max_sort_length. Sorting used only the first 64 bytes
set max_sort_length=200;
select c from t1 order by c, id;
c
......@@ -846,7 +846,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy
Warnings:
Warning 4201 4 strings were longer than max_sort_length. Sorting used only the first 200 bytes
Warning 4201 4 values were longer than max_sort_length. Sorting used only the first 200 bytes
set max_sort_length=default;
select '1' || '3' from t1;
'1' || '3'
......
......@@ -899,7 +899,7 @@ Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
Warning 1260 Row 3 was cut by group_concat()
Warning 4201 3 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 1024 bytes
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1024
......@@ -917,7 +917,7 @@ Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
Warning 1260 Row 3 was cut by group_concat()
Warning 4201 3 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 1024 bytes
drop table t1_1024, t2_1024, t3_1024;
set @blob_len = 1025;
set @suffix_len = @blob_len - @prefix_len;
......@@ -1002,7 +1002,7 @@ Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
Warning 1260 Row 3 was cut by group_concat()
Warning 4201 3 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 1024 bytes
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1025
......@@ -1020,7 +1020,7 @@ Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
Warning 1260 Row 3 was cut by group_concat()
Warning 4201 3 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 1024 bytes
drop table t1_1025, t2_1025, t3_1025;
create table t1bit (a1 bit(3), a2 bit(3));
create table t2bit (b1 bit(3), b2 bit(3));
......
......@@ -919,7 +919,7 @@ Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
Warning 1260 Row 3 was cut by group_concat()
Warning 4201 3 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 1024 bytes
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1024
......@@ -938,7 +938,7 @@ Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
Warning 1260 Row 3 was cut by group_concat()
Warning 4201 3 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 1024 bytes
drop table t1_1024, t2_1024, t3_1024;
set @blob_len = 1025;
set @suffix_len = @blob_len - @prefix_len;
......@@ -1024,7 +1024,7 @@ Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
Warning 1260 Row 3 was cut by group_concat()
Warning 4201 3 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 1024 bytes
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1025
......@@ -1043,7 +1043,7 @@ Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
Warning 1260 Row 3 was cut by group_concat()
Warning 4201 3 strings were longer than max_sort_length. Sorting used only the first 1024 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 1024 bytes
drop table t1_1025, t2_1025, t3_1025;
create table t1bit (a1 bit(3), a2 bit(3));
create table t2bit (b1 bit(3), b2 bit(3));
......
......@@ -97,9 +97,7 @@ eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data),
--source include/wait_for_slave_sql_error_and_skip.inc
--let $diff_tables= master:t1,slave:t1
--disable_warnings # To hide warning 4201 "strings were longer than max_sort_length"
--source include/diff_tables.inc
--enable_warnings
--echo ########################################################################################
--echo # 2 - BEGIN - IMPLICIT COMMIT by DDL
......@@ -182,9 +180,7 @@ CREATE TABLE t5 (a int);
--sync_slave_with_master
--let $diff_tables= master:t1,slave:t1
--disable_warnings # To hide warning 4201 "strings were longer than max_sort_length"
--source include/diff_tables.inc
--enable_warnings
--echo ########################################################################################
--echo # 3 - BEGIN - COMMIT
......@@ -214,9 +210,7 @@ COMMIT;
--sync_slave_with_master
--let $diff_tables= master:t1,slave:t1
--disable_warnings # To hide warning 4201 "strings were longer than max_sort_length"
--source include/diff_tables.inc
--enable_warnings
--echo ########################################################################################
--echo # 4 - BEGIN - ROLLBACK
......@@ -246,9 +240,7 @@ ROLLBACK;
--sync_slave_with_master
--let $diff_tables= master:t1,slave:t1
--disable_warnings # To hide warning 4201 "strings were longer than max_sort_length"
--source include/diff_tables.inc
--enable_warnings
--echo ########################################################################################
--echo # 5 - PROCEDURE
......@@ -298,9 +290,7 @@ ROLLBACK;
--sync_slave_with_master
--let $diff_tables= master:t1,slave:t1
--disable_warnings # To hide warning 4201 "strings were longer than max_sort_length"
--source include/diff_tables.inc
--enable_warnings
--echo ########################################################################################
--echo # 6 - XID
......@@ -332,9 +322,7 @@ COMMIT;
--sync_slave_with_master
--let $diff_tables= master:t1,slave:t1
--disable_warnings # To hide warning 4201 "strings were longer than max_sort_length"
--source include/diff_tables.inc
--enable_warnings
--echo ########################################################################################
--echo # 7 - NON-TRANS TABLE
......@@ -378,9 +366,7 @@ COMMIT;
--sync_slave_with_master
--let $diff_tables= master:t1,slave:t1
--disable_warnings # To hide warning 4201 "strings were longer than max_sort_length"
--source include/diff_tables.inc
--enable_warnings
--echo ########################################################################
--echo # 8 - Bug#55375(Regression Bug) Transaction bigger than
......
......@@ -132,10 +132,8 @@ show status like "binlog_cache_disk_use";
sync_slave_with_master;
--disable_warnings # To hide warning 4197 "Comparison limited during sorting/grouping"
let $diff_tables=master:test.t2, slave:test.t2;
source include/diff_tables.inc;
--enable_warnings
# undoing changes with verifying the above once again
connection master;
......@@ -177,9 +175,7 @@ show status like "binlog_cache_disk_use";
sync_slave_with_master;
let $diff_tables=master:test.t3, slave:test.t3;
--disable_warnings # To hide warning 4197 "Comparison limited during sorting/grouping"
source include/diff_tables.inc;
--enable_warnings
# undoing changes with verifying the above once again
connection master;
......@@ -237,7 +233,6 @@ show status like "binlog_cache_disk_use";
sync_slave_with_master;
--disable_warnings # To hide warning 4197 "Comparison limited during sorting/grouping"
let $diff_tables=master:test.t1, slave:test.t1;
source include/diff_tables.inc;
......@@ -246,7 +241,6 @@ source include/diff_tables.inc;
let $diff_tables=master:test.t3, slave:test.t3;
source include/diff_tables.inc;
--enable_warnings
--echo *** Test switching checksum algorithm while ongoing transactions have pre-computed checksum in their binlog cache ***
......@@ -343,7 +337,6 @@ set @@global.binlog_legacy_event_pos= 0;
sync_slave_with_master;
connection master;
begin;
......
......@@ -124,9 +124,7 @@ if(`SELECT COUNT(*)!=1 FROM t2`)
--source include/sync_with_master_gtid.inc
--echo # Validating the first insert into t2 replicated to slave..
--let $diff_tables= master:test.t2,slave:test.t2
--disable_warnings # To hide warning 4197 "Comparison limited during sorting/grouping"
--source include/diff_tables.inc
--enable_warnings
--echo # ..success
# Testing mixed engine UPDATE statement scenario. In the following multi
......
......@@ -141,9 +141,7 @@ SHOW VARIABLES LIKE 'gtid_binlog_pos';
SHOW VARIABLES LIKE 'gtid_binlog_state';
--let $diff_tables=server_1:t1, server_2:t1
--disable_warnings # To hide warning 4197 "Comparison limited during sorting/grouping"
--source include/diff_tables.inc
--enable_warnings
--connection server_1
--let $case = 3
......
......@@ -40,7 +40,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Warnings:
Warning 4197 6 strings were longer than max_sort_length. Sorting used only the first 69 bytes
Warning 4201 6 values were longer than max_sort_length. Sorting used only the first 69 bytes
** Results should be sorted **
'#--------------------FN_DYNVARS_098_02-------------------------#'
connect test_con2,localhost,root,,;
......@@ -94,7 +94,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
Warnings:
Warning 4197 16 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 16 values were longer than max_sort_length. Sorting used only the first 64 bytes
** Results should not be sorted **
'#--------------------FN_DYNVARS_098_03-------------------------#'
SET max_sort_length=64;
......@@ -125,7 +125,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
Warnings:
Warning 4197 20 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 20 values were longer than max_sort_length. Sorting used only the first 64 bytes
** Results should not be sorted **
RESET QUERY CACHE;
'#--------------------FN_DYNVARS_098_04-------------------------#'
......@@ -153,7 +153,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Warnings:
Warning 4197 15 strings were longer than max_sort_length. Sorting used only the first 69 bytes
Warning 4201 15 values were longer than max_sort_length. Sorting used only the first 69 bytes
** Results should be sorted **
'#--------------------FN_DYNVARS_098_05-------------------------#'
SET max_sort_length=70;
......@@ -244,7 +244,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
Warnings:
Warning 4197 8 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 8 values were longer than max_sort_length. Sorting used only the first 64 bytes
** Results should not be sorted **
'#--------------------FN_DYNVARS_098_08-------------------------#'
Testing type CHAR
......@@ -263,7 +263,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
Warnings:
Warning 4197 4 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 4 values were longer than max_sort_length. Sorting used only the first 64 bytes
** Results should not be sorted **
SET @@session.max_sort_length = 64;
SELECT @@session.max_sort_length;
......@@ -284,7 +284,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
Warnings:
Warning 4197 8 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 8 values were longer than max_sort_length. Sorting used only the first 64 bytes
** Results should not be sorted **
DROP TABLE t, t1, t2;
#
......@@ -295,19 +295,15 @@ set max_sort_length = 70;
create table t1(a char(100));
insert into t1 values
(concat(repeat('Str', 25), 'zzz')), (concat(repeat('Str', 25), 'yyy')),
(concat(repeat('Str', 25), 'xxx')),
('shortString89'), ('shortString51');
(concat(repeat('Str', 25), 'xxx'));
# Strings are not sorted properly due to max_sort_length limitation
select a from t1 order by a;
a
shortString51
shortString89
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrzzz
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStryyy
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 70 bytes
# Long strings are not sorted properly due to truncation to max_sort_length.
# Warning shows 3 strings out of 5 since the short strings are not truncated.
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 70 bytes
# Table having a variable-length string field and UTF16 encoding (2 bytes per char):
create table t2(a varchar(100)) character set 'utf16';
insert into t2 values
......@@ -324,7 +320,7 @@ StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrzzz
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStryyy
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 64 bytes
# Table having text blobs
create table t3(a text, b mediumtext, c longtext) character set 'utf16';
insert into t3 values
......@@ -341,7 +337,7 @@ TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText888 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium88 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong88
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText777 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium77 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong77
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 64 bytes
select * from t3 order by b desc;
a b c
shortString51 short777 short897
......@@ -350,7 +346,7 @@ TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText888 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium88 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong88
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText777 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium77 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong77
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 64 bytes
select * from t3 order by c;
a b c
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText999 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium99 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong99
......@@ -359,7 +355,7 @@ TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText
shortString89 short123 short456
shortString51 short777 short897
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 64 bytes
select * from t3 order by c, a desc;
a b c
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText999 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium99 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong99
......@@ -368,7 +364,7 @@ TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText
shortString89 short123 short456
shortString51 short777 short897
Warnings:
Warning 4197 6 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 6 values were longer than max_sort_length. Sorting used only the first 64 bytes
# Packing of sort keys will be applied here:
select * from t3 order by a, c, b;
a b c
......@@ -378,7 +374,7 @@ TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText888 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium88 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong88
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText777 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium77 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong77
Warnings:
Warning 4197 9 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 9 values were longer than max_sort_length. Sorting used only the first 64 bytes
select * from t3 order by a;
a b c
shortString51 short777 short897
......@@ -387,7 +383,7 @@ TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText888 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium88 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong88
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText777 MediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMediumMedium77 LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLong77
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 64 bytes
# Test a prepared statement re-execution (expecting warnings at both executions)
prepare stmt from "select * from t2 order by a";
execute stmt;
......@@ -398,7 +394,7 @@ StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrzzz
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStryyy
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 64 bytes
execute stmt;
a
shortString51
......@@ -407,7 +403,7 @@ StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrzzz
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStryyy
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 64 bytes
# Test a stored procedure
create procedure p1() select * from t2 order by a;
call p1();
......@@ -418,7 +414,7 @@ StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrzzz
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStryyy
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 64 bytes
call p1();
a
shortString51
......@@ -427,30 +423,26 @@ StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrzzz
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStryyy
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
Warnings:
Warning 4197 3 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 3 values were longer than max_sort_length. Sorting used only the first 64 bytes
drop procedure p1;
# Test a stored function
create function f1 () returns char(100) return (select a from t1 order by a limit 1);
select f1() as f1_res from t1 order by f1_res;
f1_res
shortString51
shortString51
shortString51
shortString51
shortString51
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
Warnings:
Warning 4197 15 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 12 values were longer than max_sort_length. Sorting used only the first 64 bytes
# Test a view
create view v1 as select f1() as f1_res from t1 order by f1_res;
select * from v1;
f1_res
shortString51
shortString51
shortString51
shortString51
shortString51
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
StrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrStrxxx
Warnings:
Warning 4197 30 strings were longer than max_sort_length. Sorting used only the first 64 bytes
Warning 4201 21 values were longer than max_sort_length. Sorting used only the first 64 bytes
drop function f1;
drop view v1;
drop table t1, t2, t3;
......
......@@ -207,12 +207,10 @@ create table t1(a char(100));
insert into t1 values
(concat(repeat('Str', 25), 'zzz')), (concat(repeat('Str', 25), 'yyy')),
(concat(repeat('Str', 25), 'xxx')),
('shortString89'), ('shortString51');
(concat(repeat('Str', 25), 'xxx'));
--echo # Strings are not sorted properly due to max_sort_length limitation
select a from t1 order by a;
--echo # Long strings are not sorted properly due to truncation to max_sort_length.
--echo # Warning shows 3 strings out of 5 since the short strings are not truncated.
--echo # Table having a variable-length string field and UTF16 encoding (2 bytes per char):
create table t2(a varchar(100)) character set 'utf16';
......
......@@ -12281,7 +12281,7 @@ ER_SEQUENCE_TABLE_ORDER_BY
ER_VARIABLE_IGNORED
eng "The variable '%s' is ignored. It only exists for compatibility with old installations and will be removed in a future release"
WARN_SORTING_ON_TRUNCATED_LENGTH
eng "%llu strings were longer than max_sort_length. Sorting used only the first %lu bytes"
ger "%llu Zeichenketten waren länger als max_sort_length. Sie wurden anhand der ersten %lu Bytes verglichen"
rus "%llu строк были длиннее, чем max_sort_length. Их сортировка проведена по первым %lu байтам"
swe "%llu sträng var längre än max_sort_length=%lu"
eng "%llu values were longer than max_sort_length. Sorting used only the first %lu bytes"
ger "%llu Werte waren länger als max_sort_length. Sie wurden anhand der ersten %lu Bytes verglichen"
rus "%llu значений были длиннее, чем max_sort_length. Их сортировка проведена по первым %lu байтам"
swe "%llu värden var längre än max_sort_length=%lu"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment