Bug #30955 geomfromtext() crasher.
end-of-line check missed in Gis_read_stream::get_next_word, what can lead to crashes (expecially with NULL strings). End-of-line check added sql/gstream.cc: Bug #30955 geomfromtext() crasher mysql-test/r/gis.result: Bug #30955 geomfromtext() crasher. test result mysql-test/t/gis.test: Bug #30955 geomfromtext() crasher. test case
This commit is contained in:
parent
732f05a642
commit
ae3d4bfc0e
@ -724,4 +724,10 @@ SELECT * FROM t1;
|
|||||||
a
|
a
|
||||||
NULL
|
NULL
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE `t1` ( `col9` set('a'), `col89` date);
|
||||||
|
INSERT INTO `t1` VALUES ('','0000-00-00');
|
||||||
|
select geomfromtext(col9,col89) as a from t1;
|
||||||
|
a
|
||||||
|
NULL
|
||||||
|
DROP TABLE t1;
|
||||||
End of 4.1 tests
|
End of 4.1 tests
|
||||||
|
@ -419,4 +419,12 @@ INSERT INTO t1 VALUES (NULL);
|
|||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #30955 geomfromtext() crasher
|
||||||
|
#
|
||||||
|
CREATE TABLE `t1` ( `col9` set('a'), `col89` date);
|
||||||
|
INSERT INTO `t1` VALUES ('','0000-00-00');
|
||||||
|
select geomfromtext(col9,col89) as a from t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo End of 4.1 tests
|
--echo End of 4.1 tests
|
||||||
|
@ -45,7 +45,7 @@ bool Gis_read_stream::get_next_word(LEX_STRING *res)
|
|||||||
skip_space();
|
skip_space();
|
||||||
res->str= (char*) m_cur;
|
res->str= (char*) m_cur;
|
||||||
/* The following will also test for \0 */
|
/* The following will also test for \0 */
|
||||||
if (!my_isvar_start(&my_charset_bin, *m_cur))
|
if ((m_cur >= m_limit) || !my_isvar_start(&my_charset_bin, *m_cur))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user