Commit a7e2cd55 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-19034 ASAN unknown-crash in get_date_time_separator with PAD_CHAR_TO_FULL_LENGTH

parent 457dc9d6
......@@ -1156,5 +1156,16 @@ ExtractValue('foo','bar') i MIN(d)
3 1976-12-14 13:21:07
DROP TABLE t1;
#
# MDEV-19034 ASAN unknown-crash in get_date_time_separator with PAD_CHAR_TO_FULL_LENGTH
#
SET SQL_MODE=DEFAULT;
CREATE OR REPLACE TABLE t1 (a CHAR(11));
CREATE OR REPLACE TABLE t2 (b DATETIME);
INSERT INTO t1 VALUES ('2010-02-19') ;
SET SQL_MODE= 'PAD_CHAR_TO_FULL_LENGTH';
INSERT INTO t2 SELECT * FROM t1;
DROP TABLE t1, t2;
SET SQL_MODE=DEFAULT;
#
# End of 10.1 tests
#
......@@ -710,6 +710,20 @@ INSERT INTO t1 VALUES (3,NULL),(3,'1976-12-14 13:21:07'),(NULL,'1981-09-24 01:04
SELECT ExtractValue('foo','bar'), i, MIN(d) FROM t1 GROUP BY i;
DROP TABLE t1;
--echo #
--echo # MDEV-19034 ASAN unknown-crash in get_date_time_separator with PAD_CHAR_TO_FULL_LENGTH
--echo #
SET SQL_MODE=DEFAULT;
CREATE OR REPLACE TABLE t1 (a CHAR(11));
CREATE OR REPLACE TABLE t2 (b DATETIME);
INSERT INTO t1 VALUES ('2010-02-19') ;
SET SQL_MODE= 'PAD_CHAR_TO_FULL_LENGTH';
INSERT INTO t2 SELECT * FROM t1;
DROP TABLE t1, t2;
SET SQL_MODE=DEFAULT;
--echo #
--echo # End of 10.1 tests
--echo #
......@@ -184,7 +184,7 @@ static int get_date_time_separator(uint *number_of_fields, ulonglong flags,
do
{
s++;
} while (my_isspace(&my_charset_latin1, *s));
} while (s < end && my_isspace(&my_charset_latin1, *s));
*str= s;
return 0;
}
......
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