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