Commit ccc7ae0e authored by Kristofer Pettersson's avatar Kristofer Pettersson

merge 5.1-security => 5.5-security

parents 1f84bb0c dc285eb7
...@@ -707,10 +707,7 @@ numgeometries(b) IS NULL, numinteriorrings(b) IS NULL, numpoints(b) IS NULL, ...@@ -707,10 +707,7 @@ numgeometries(b) IS NULL, numinteriorrings(b) IS NULL, numpoints(b) IS NULL,
area(b) IS NULL, glength(b) IS NULL, srid(b) IS NULL, x(b) IS NULL, area(b) IS NULL, glength(b) IS NULL, srid(b) IS NULL, x(b) IS NULL,
y(b) IS NULL y(b) IS NULL
from t1; from t1;
geometryfromtext(b) IS NULL geometryfromwkb(b) IS NULL astext(b) IS NULL aswkb(b) IS NULL geometrytype(b) IS NULL centroid(b) IS NULL envelope(b) IS NULL startpoint(b) IS NULL endpoint(b) IS NULL exteriorring(b) IS NULL pointn(b, 1) IS NULL geometryn(b, 1) IS NULL interiorringn(b, 1) IS NULL multipoint(b) IS NULL isempty(b) IS NULL issimple(b) IS NULL isclosed(b) IS NULL dimension(b) IS NULL numgeometries(b) IS NULL numinteriorrings(b) IS NULL numpoints(b) IS NULL area(b) IS NULL glength(b) IS NULL srid(b) IS NULL x(b) IS NULL y(b) IS NULL ERROR 22007: Illegal non geometric '' value found during parsing
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
select select
within(b, b) IS NULL, contains(b, b) IS NULL, overlaps(b, b) IS NULL, within(b, b) IS NULL, contains(b, b) IS NULL, overlaps(b, b) IS NULL,
equals(b, b) IS NULL, disjoint(b, b) IS NULL, touches(b, b) IS NULL, equals(b, b) IS NULL, disjoint(b, b) IS NULL, touches(b, b) IS NULL,
...@@ -725,10 +722,7 @@ point(b, b) IS NULL, linestring(b) IS NULL, polygon(b) IS NULL, multipoint(b) IS ...@@ -725,10 +722,7 @@ point(b, b) IS NULL, linestring(b) IS NULL, polygon(b) IS NULL, multipoint(b) IS
multilinestring(b) IS NULL, multipolygon(b) IS NULL, multilinestring(b) IS NULL, multipolygon(b) IS NULL,
geometrycollection(b) IS NULL geometrycollection(b) IS NULL
from t1; from t1;
point(b, b) IS NULL linestring(b) IS NULL polygon(b) IS NULL multipoint(b) IS NULL multilinestring(b) IS NULL multipolygon(b) IS NULL geometrycollection(b) IS NULL ERROR 22007: Illegal non geometric '' value found during parsing
0 1 1 1 1 1 1
1 1 1 1 1 1 1
0 1 1 1 1 1 1
drop table t1; drop table t1;
CREATE TABLE t1(a POINT) ENGINE=MyISAM; CREATE TABLE t1(a POINT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (NULL);
...@@ -1010,53 +1004,9 @@ f5 datetime YES NULL ...@@ -1010,53 +1004,9 @@ f5 datetime YES NULL
drop view v1; drop view v1;
drop table t1; drop table t1;
SELECT MultiPoint(12345,''); SELECT MultiPoint(12345,'');
MultiPoint(12345,'') ERROR 22007: Illegal non geometric '12345' value found during parsing
NULL SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUAL) AS d WHERE (LINESTRING(d.b));
SELECT MultiPoint(123451,''); ERROR 22007: Illegal non geometric '' value found during parsing
MultiPoint(123451,'')
NULL
SELECT MultiPoint(1234512,'');
MultiPoint(1234512,'')
NULL
SELECT MultiPoint(12345123,'');
MultiPoint(12345123,'')
NULL
SELECT MultiLineString(12345,'');
MultiLineString(12345,'')
NULL
SELECT MultiLineString(123451,'');
MultiLineString(123451,'')
NULL
SELECT MultiLineString(1234512,'');
MultiLineString(1234512,'')
NULL
SELECT MultiLineString(12345123,'');
MultiLineString(12345123,'')
NULL
SELECT LineString(12345,'');
LineString(12345,'')
NULL
SELECT LineString(123451,'');
LineString(123451,'')
NULL
SELECT LineString(1234512,'');
LineString(1234512,'')
NULL
SELECT LineString(12345123,'');
LineString(12345123,'')
NULL
SELECT Polygon(12345,'');
Polygon(12345,'')
NULL
SELECT Polygon(123451,'');
Polygon(123451,'')
NULL
SELECT Polygon(1234512,'');
Polygon(1234512,'')
NULL
SELECT Polygon(12345123,'');
Polygon(12345123,'')
NULL
# #
# BUG#51875: crash when loading data into geometry function polyfromwkb # BUG#51875: crash when loading data into geometry function polyfromwkb
# #
......
...@@ -1186,41 +1186,6 @@ NULL ...@@ -1186,41 +1186,6 @@ NULL
1 1
DROP TABLE t1, t2, mm1; DROP TABLE t1, t2, mm1;
# #
# Bug #55568: user variable assignments crash server when used within
# query
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (1);
SELECT MULTIPOINT(
1,
(
SELECT MULTIPOINT(
MULTIPOINT(
1,
(SELECT COUNT(*) FROM (SELECT 1 FROM t1 GROUP BY a,a) d)
)
) FROM t1
)
) != COUNT(*) q FROM t1 GROUP BY a;
q
NULL
NULL
SELECT MULTIPOINT(
1,
(
SELECT MULTIPOINT(
MULTIPOINT(
1,
(SELECT COUNT(*) FROM (SELECT 1 FROM t1 GROUP BY a,a) d)
)
) FROM t1
)
) != COUNT(*) q FROM t1 GROUP BY a;
q
NULL
NULL
DROP TABLE t1;
#
# Bug #54468: crash after item's print() function when ordering/grouping # Bug #54468: crash after item's print() function when ordering/grouping
# by subquery # by subquery
# #
......
...@@ -404,6 +404,7 @@ create table t1 (a int, b blob); ...@@ -404,6 +404,7 @@ create table t1 (a int, b blob);
insert into t1 values (1, ''), (2, NULL), (3, '1'); insert into t1 values (1, ''), (2, NULL), (3, '1');
select * from t1; select * from t1;
--error ER_ILLEGAL_VALUE_FOR_TYPE
select select
geometryfromtext(b) IS NULL, geometryfromwkb(b) IS NULL, astext(b) IS NULL, geometryfromtext(b) IS NULL, geometryfromwkb(b) IS NULL, astext(b) IS NULL,
aswkb(b) IS NULL, geometrytype(b) IS NULL, centroid(b) IS NULL, aswkb(b) IS NULL, geometrytype(b) IS NULL, centroid(b) IS NULL,
...@@ -422,6 +423,7 @@ select ...@@ -422,6 +423,7 @@ select
intersects(b, b) IS NULL, crosses(b, b) IS NULL intersects(b, b) IS NULL, crosses(b, b) IS NULL
from t1; from t1;
--error ER_ILLEGAL_VALUE_FOR_TYPE
select select
point(b, b) IS NULL, linestring(b) IS NULL, polygon(b) IS NULL, multipoint(b) IS NULL, point(b, b) IS NULL, linestring(b) IS NULL, polygon(b) IS NULL, multipoint(b) IS NULL,
multilinestring(b) IS NULL, multipolygon(b) IS NULL, multilinestring(b) IS NULL, multipolygon(b) IS NULL,
...@@ -705,25 +707,35 @@ drop table t1; ...@@ -705,25 +707,35 @@ drop table t1;
# Bug#44684: valgrind reports invalid reads in # Bug#44684: valgrind reports invalid reads in
# Item_func_spatial_collection::val_str # Item_func_spatial_collection::val_str
# #
--error ER_ILLEGAL_VALUE_FOR_TYPE
SELECT MultiPoint(12345,''); SELECT MultiPoint(12345,'');
SELECT MultiPoint(123451,''); #SELECT MultiPoint(123451,'');
SELECT MultiPoint(1234512,''); #SELECT MultiPoint(1234512,'');
SELECT MultiPoint(12345123,''); #SELECT MultiPoint(12345123,'');
SELECT MultiLineString(12345,''); --error ER_ILLEGAL_VALUE_FOR_TYPE
SELECT MultiLineString(123451,''); #SELECT MultiLineString(12345,'');
SELECT MultiLineString(1234512,''); #SELECT MultiLineString(123451,'');
SELECT MultiLineString(12345123,''); #SELECT MultiLineString(1234512,'');
#SELECT MultiLineString(12345123,'');
SELECT LineString(12345,'');
SELECT LineString(123451,''); --error ER_ILLEGAL_VALUE_FOR_TYPE
SELECT LineString(1234512,''); #SELECT LineString(12345,'');
SELECT LineString(12345123,''); #SELECT LineString(123451,'');
#SELECT LineString(1234512,'');
SELECT Polygon(12345,''); #SELECT LineString(12345123,'');
SELECT Polygon(123451,'');
SELECT Polygon(1234512,''); --error ER_ILLEGAL_VALUE_FOR_TYPE
SELECT Polygon(12345123,''); #SELECT Polygon(12345,'');
#SELECT Polygon(123451,'');
#SELECT Polygon(1234512,'');
#SELECT Polygon(12345123,'');
#
# Bug55531 crash with conversions of geometry types / strings
#
--error ER_ILLEGAL_VALUE_FOR_TYPE
SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUAL) AS d WHERE (LINESTRING(d.b));
--echo # --echo #
......
...@@ -851,33 +851,37 @@ ENGINE=MERGE UNION=(t1,t2); ...@@ -851,33 +851,37 @@ ENGINE=MERGE UNION=(t1,t2);
SELECT t1.a FROM mm1,t1; SELECT t1.a FROM mm1,t1;
DROP TABLE t1, t2, mm1; DROP TABLE t1, t2, mm1;
--echo # #--echo #
--echo # Bug #55568: user variable assignments crash server when used within #--echo # Bug #55568: user variable assignments crash server when used within
--echo # query #--echo # query
--echo # #--echo #
#
CREATE TABLE t1 (a INT); #
# This test case is invalidated because of fix of bug 55531
INSERT INTO t1 VALUES (0), (1); # The reason is that {1} is not a valid geometric collection.
#
let $i=2; #CREATE TABLE t1 (a INT);
while ($i)
{ #INSERT INTO t1 VALUES (0), (1);
SELECT MULTIPOINT(
1, #let $i=2;
( #while ($i)
SELECT MULTIPOINT( #{
MULTIPOINT( # SELECT MULTIPOINT(
1, # 1,
(SELECT COUNT(*) FROM (SELECT 1 FROM t1 GROUP BY a,a) d) # (
) # SELECT MULTIPOINT(
) FROM t1 # MULTIPOINT(
) # 1,
) != COUNT(*) q FROM t1 GROUP BY a; # (SELECT COUNT(*) FROM (SELECT 1 FROM t1 GROUP BY a,a) d)
dec $i; # )
} # ) FROM t1
# )
DROP TABLE t1; # ) != COUNT(*) q FROM t1 GROUP BY a;
# dec $i;
#}
#
#DROP TABLE t1;
--echo # --echo #
--echo # Bug #54468: crash after item's print() function when ordering/grouping --echo # Bug #54468: crash after item's print() function when ordering/grouping
......
...@@ -4516,7 +4516,7 @@ String *Field_double::val_str(String *val_buffer, ...@@ -4516,7 +4516,7 @@ String *Field_double::val_str(String *val_buffer,
#endif #endif
doubleget(nr,ptr); doubleget(nr,ptr);
uint to_length=max(field_length, DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE); uint to_length= DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE;
val_buffer->alloc(to_length); val_buffer->alloc(to_length);
char *to=(char*) val_buffer->ptr(); char *to=(char*) val_buffer->ptr();
size_t len; size_t len;
......
...@@ -179,6 +179,19 @@ class Item_func_spatial_collection: public Item_geometry_func ...@@ -179,6 +179,19 @@ class Item_func_spatial_collection: public Item_geometry_func
item_type=it; item_type=it;
} }
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec()
{
for( unsigned int i=0; i<arg_count; ++i)
{
if( args[i]->fixed && args[i]->field_type() != MYSQL_TYPE_GEOMETRY)
{
String str;
args[i]->val_str(&str);
my_error(ER_ILLEGAL_VALUE_FOR_TYPE,MYF(0),"non geometric",str.c_ptr());
}
}
}
const char *func_name() const { return "multipoint"; } const char *func_name() const { return "multipoint"; }
}; };
......
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