summaryrefslogtreecommitdiff
path: root/mysql-test/t/stat_tables.test
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2019-09-18 01:59:29 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2019-09-18 15:06:02 +0530
commit273d8eb12c40a6dcd05a8148bdfba3f1fd96e764 (patch)
tree4d67cbf15ce5cc7fac333cac019f70eb4afb3916 /mysql-test/t/stat_tables.test
parentc471bfb34e970075d8649247ab088b19a097eaf4 (diff)
downloadmariadb-git-273d8eb12c40a6dcd05a8148bdfba3f1fd96e764.tar.gz
MDEV-20589: Server still crashes in Field::set_warning_truncated_wrong_value
The flag is_stat_field is not set for the min_value and max_value of field items inside table share. This is a must requirement as we don't want to throw warnings of truncation when we read values from the statistics table to the column statistics of table share fields.
Diffstat (limited to 'mysql-test/t/stat_tables.test')
-rw-r--r--mysql-test/t/stat_tables.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/stat_tables.test b/mysql-test/t/stat_tables.test
index 880e6378ca5..4c21e21ea70 100644
--- a/mysql-test/t/stat_tables.test
+++ b/mysql-test/t/stat_tables.test
@@ -546,5 +546,27 @@ set @@histogram_size= @save_histogram_size;
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
drop table t1;
+--echo #
+--echo # MDEV-20589: Server still crashes in Field::set_warning_truncated_wrong_value
+--echo #
+
+set names utf8;
+create table t1 ( a varchar(255) character set utf8);
+insert into t1 values (REPEAT('ӥ',255)), (REPEAT('ç',255));
+
+set use_stat_tables='preferably';
+analyze table t1 persistent for all;
+
+set @save_sql_mode= @@sql_mode;
+set sql_mode='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
+update mysql.column_stats set min_value= REPEAT('ӥ',256) where db_name='test' and table_name='t1';
+set @@sql_mode= @save_sql_mode;
+
+select length(a) from t1 where a=REPEAT('ӥ',255);
+
+set names latin1;
+set @@use_stat_tables=@save_use_stat_tables;
+drop table t1;
+
--echo # please keep this at the last
set @@global.histogram_size=@save_histogram_size;