[Commits] 129c82b: MDEV-7334 valgrind warning "unitialized bytes" in 10.1.

holyfoot at askmonty.org holyfoot at askmonty.org
Thu Mar 12 15:52:16 EET 2015


revision-id: 129c82bb5916d05ece4efad55e8dede3005559b4
parent(s): 8249dcaaebf8cd1944bd4ab7ccaa8b199e76d6f9
committer: Alexey Botchkov
branch nick: 10.1
timestamp: 2015-03-12 17:50:23 +0400
message:

MDEV-7334 valgrind warning "unitialized bytes" in 10.1.
The 'srid' field's copying was missing in the copying Create_field::Create_field() constructor.

---
 mysql-test/r/gis.result | 27 ++++++++++++++++++++++++++-
 mysql-test/t/gis.test   | 21 ++++++++++++++++++++-
 sql/field.cc            |  1 +
 3 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 40e6c4e..4f65aa2e 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -1,4 +1,4 @@
-DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+DROP TABLE IF EXISTS t1, t2, t3, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
 CREATE TABLE gis_point  (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
 CREATE TABLE gis_line  (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
 CREATE TABLE gis_polygon   (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
@@ -1740,3 +1740,28 @@ t1	CREATE TABLE `t1` (
   `CONTAINS(NULL, NULL)` int(1) DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 DROP TABLE t1;
+#
+# MDEV-7334 valgrind warning "unitialized bytes" in 10.1.
+#
+CREATE TABLE t1 (
+gp  point,
+ln  linestring,
+pg  polygon,
+mp  multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc  geometrycollection,
+gm  geometry
+);
+ALTER TABLE t1 ADD fid INT NOT NULL;
+select SRID from information_schema.geometry_columns where F_TABLE_NAME='t1';
+SRID
+0
+0
+0
+0
+0
+0
+0
+0
+drop table t1;
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 292ded8..a4e95b7 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -6,7 +6,7 @@
 #
 
 --disable_warnings
-DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+DROP TABLE IF EXISTS t1, t2, t3, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
 --enable_warnings
 
 CREATE TABLE gis_point  (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
@@ -1467,3 +1467,22 @@ drop table t1;
 CREATE TABLE t1 AS SELECT CONTAINS(NULL, NULL);
 SHOW CREATE TABLE t1;
 DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-7334 valgrind warning "unitialized bytes" in 10.1.
+--echo #
+CREATE TABLE t1 (
+  gp  point,
+  ln  linestring,
+  pg  polygon,
+  mp  multipoint,
+  mln multilinestring,
+  mpg multipolygon,
+  gc  geometrycollection,
+  gm  geometry
+);
+ALTER TABLE t1 ADD fid INT NOT NULL;
+select SRID from information_schema.geometry_columns where F_TABLE_NAME='t1';
+drop table t1;
+
diff --git a/sql/field.cc b/sql/field.cc
index 0f062c3..8356000 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -9902,6 +9902,7 @@ Create_field::Create_field(Field *old_field,Field *orig_field)
 #ifdef HAVE_SPATIAL
   case MYSQL_TYPE_GEOMETRY:
     geom_type= ((Field_geom*)old_field)->geom_type;
+    srid= ((Field_geom*)old_field)->srid;
     break;
 #endif
   case MYSQL_TYPE_YEAR:


More information about the commits mailing list