summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@hfmain.(none)>2007-10-05 16:33:37 +0500
committerunknown <holyfoot/hf@hfmain.(none)>2007-10-05 16:33:37 +0500
commit177d3c3c6aa28a8707988ccdd165c3affb986bf7 (patch)
treea810f6b82bf03fae453bfee844b3e407ae7b14dd
parent581bfa3d9193b1ff1ad4e62593f25e991d23776d (diff)
parent071e55af0db16f3f8d2b703433e8ed8b0edcfa99 (diff)
downloadmariadb-git-177d3c3c6aa28a8707988ccdd165c3affb986bf7.tar.gz
Merge mysql.com:/home/hf/work/30286/my50-30286
into mysql.com:/home/hf/work/30286/my51-30286 mysql-test/r/gis.result: Auto merged mysql-test/t/gis.test: Auto merged
-rw-r--r--mysql-test/r/gis.result6
-rw-r--r--mysql-test/t/gis.test8
-rw-r--r--sql/gstream.cc2
3 files changed, 15 insertions, 1 deletions
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 7b4b02f3ff3..1942124b8bd 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -736,6 +736,12 @@ SELECT * FROM t1;
a
NULL
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
create table t1 (s1 geometry not null,s2 char(100));
create trigger t1_bu before update on t1 for each row set new.s1 = null;
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index d7182e36e3a..bd425e86892 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -432,6 +432,14 @@ INSERT INTO t1 VALUES (NULL);
SELECT * FROM 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
#
diff --git a/sql/gstream.cc b/sql/gstream.cc
index 46e12b6ef3b..0c8011549f3 100644
--- a/sql/gstream.cc
+++ b/sql/gstream.cc
@@ -44,7 +44,7 @@ bool Gis_read_stream::get_next_word(LEX_STRING *res)
skip_space();
res->str= (char*) m_cur;
/* 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;
/*