Commit 129c82bb authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-7334 valgrind warning "unitialized bytes" in 10.1.

The 'srid' field's copying was missing in the copying Create_field::Create_field() constructor.
parent 8249dcaa
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;
......@@ -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;
......@@ -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:
......
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