Skip to content

Commit 9111ab7

Browse files
author
Alexey Botchkov
committed
GIS-related tests started to fail as some related functions
don't return NULL-s anymore, and actually they're not BOOLEAN. Fixed.
1 parent 42bc08b commit 9111ab7

File tree

8 files changed

+24
-20
lines changed

8 files changed

+24
-20
lines changed

mysql-test/r/ctype_binary.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
11891189
show create table t1;
11901190
Table Create Table
11911191
t1 CREATE TABLE `t1` (
1192-
`c1` varbinary(21) DEFAULT NULL
1192+
`c1` varbinary(2) DEFAULT NULL
11931193
) ENGINE=MyISAM DEFAULT CHARSET=latin1
11941194
drop table t1;
11951195
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -1199,7 +1199,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
11991199
show create table t1;
12001200
Table Create Table
12011201
t1 CREATE TABLE `t1` (
1202-
`c1` varbinary(21) DEFAULT NULL
1202+
`c1` varbinary(2) DEFAULT NULL
12031203
) ENGINE=MyISAM DEFAULT CHARSET=latin1
12041204
drop table t1;
12051205
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));

mysql-test/r/ctype_cp1251.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
15831583
show create table t1;
15841584
Table Create Table
15851585
t1 CREATE TABLE `t1` (
1586-
`c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
1586+
`c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
15871587
) ENGINE=MyISAM DEFAULT CHARSET=latin1
15881588
drop table t1;
15891589
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -1593,7 +1593,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
15931593
show create table t1;
15941594
Table Create Table
15951595
t1 CREATE TABLE `t1` (
1596-
`c1` varchar(21) CHARACTER SET cp1251 DEFAULT NULL
1596+
`c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
15971597
) ENGINE=MyISAM DEFAULT CHARSET=latin1
15981598
drop table t1;
15991599
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));

mysql-test/r/ctype_latin1.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
18651865
show create table t1;
18661866
Table Create Table
18671867
t1 CREATE TABLE `t1` (
1868-
`c1` varchar(21) DEFAULT NULL
1868+
`c1` varchar(2) DEFAULT NULL
18691869
) ENGINE=MyISAM DEFAULT CHARSET=latin1
18701870
drop table t1;
18711871
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -1875,7 +1875,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
18751875
show create table t1;
18761876
Table Create Table
18771877
t1 CREATE TABLE `t1` (
1878-
`c1` varchar(21) DEFAULT NULL
1878+
`c1` varchar(2) DEFAULT NULL
18791879
) ENGINE=MyISAM DEFAULT CHARSET=latin1
18801880
drop table t1;
18811881
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));

mysql-test/r/ctype_ucs.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2772,7 +2772,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
27722772
show create table t1;
27732773
Table Create Table
27742774
t1 CREATE TABLE `t1` (
2775-
`c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
2775+
`c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
27762776
) ENGINE=MyISAM DEFAULT CHARSET=latin1
27772777
drop table t1;
27782778
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -2782,7 +2782,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
27822782
show create table t1;
27832783
Table Create Table
27842784
t1 CREATE TABLE `t1` (
2785-
`c1` varchar(21) CHARACTER SET ucs2 DEFAULT NULL
2785+
`c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
27862786
) ENGINE=MyISAM DEFAULT CHARSET=latin1
27872787
drop table t1;
27882788
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));

mysql-test/r/ctype_utf8.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3640,7 +3640,7 @@ create table t1 as select concat(IsSimple(GeomFromText('Point(1 1)'))) as c1;
36403640
show create table t1;
36413641
Table Create Table
36423642
t1 CREATE TABLE `t1` (
3643-
`c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL
3643+
`c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL
36443644
) ENGINE=MyISAM DEFAULT CHARSET=latin1
36453645
drop table t1;
36463646
select hex(concat(IsClosed(GeomFromText('LineString(1 1,2 2)'))));
@@ -3650,7 +3650,7 @@ create table t1 as select concat(IsClosed(GeomFromText('LineString(1 1,2 2)')))
36503650
show create table t1;
36513651
Table Create Table
36523652
t1 CREATE TABLE `t1` (
3653-
`c1` varchar(21) CHARACTER SET utf8 DEFAULT NULL
3653+
`c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL
36543654
) ENGINE=MyISAM DEFAULT CHARSET=latin1
36553655
drop table t1;
36563656
select hex(concat(Equals(GeomFromText('Point(1 1)'),GeomFromText('Point(1 1)'))));

mysql-test/suite/archive/archive_gis.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ first second w c o e d t i r
395395
120 120 1 1 0 1 0 0 1 0
396396
120 121 0 0 1 0 0 0 1 0
397397
121 120 0 0 1 0 0 0 1 0
398-
121 121 1 1 0 1 0 1 1 0
398+
121 121 1 1 0 1 0 0 1 0
399399
explain extended SELECT g1.fid as first, g2.fid as second,
400400
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
401401
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
@@ -494,7 +494,7 @@ mbroverlaps
494494
down,left,right,up
495495
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
496496
mbrtouches
497-
big,center,down,down2,left,left2,right,right2,small,up,up2
497+
down2,left2,right2,up2
498498
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
499499
mbrwithin
500500
big,center
@@ -515,7 +515,7 @@ overlaps
515515
down,left,right,up
516516
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
517517
touches
518-
big,center,down,down2,left,left2,right,right2,small,up,up2
518+
down2,left2,right2,up2
519519
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
520520
within
521521
big,center

mysql-test/suite/innodb/r/innodb_gis.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ first second w c o e d t i r
395395
120 120 1 1 0 1 0 0 1 0
396396
120 121 0 0 1 0 0 0 1 0
397397
121 120 0 0 1 0 0 0 1 0
398-
121 121 1 1 0 1 0 1 1 0
398+
121 121 1 1 0 1 0 0 1 0
399399
explain extended SELECT g1.fid as first, g2.fid as second,
400400
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
401401
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
@@ -494,7 +494,7 @@ mbroverlaps
494494
down,left,right,up
495495
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
496496
mbrtouches
497-
big,center,down,down2,left,left2,right,right2,small,up,up2
497+
down2,left2,right2,up2
498498
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
499499
mbrwithin
500500
big,center
@@ -515,7 +515,7 @@ overlaps
515515
down,left,right,up
516516
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
517517
touches
518-
big,center,down,down2,left,left2,right,right2,small,up,up2
518+
down2,left2,right2,up2
519519
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
520520
within
521521
big,center

sql/item_geofunc.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,24 +415,28 @@ class Item_func_isempty: public Item_bool_func
415415
void fix_length_and_dec() { maybe_null= 1; }
416416
};
417417

418-
class Item_func_issimple: public Item_bool_func
418+
class Item_func_issimple: public Item_int_func
419419
{
420420
Gcalc_heap collector;
421421
Gcalc_function func;
422422
Gcalc_scan_iterator scan_it;
423423
String tmp;
424424
public:
425-
Item_func_issimple(Item *a): Item_bool_func(a) {}
425+
Item_func_issimple(Item *a): Item_int_func(a) {}
426426
longlong val_int();
427427
const char *func_name() const { return "st_issimple"; }
428+
void fix_length_and_dec() { decimals=0; max_length=2; }
429+
uint decimal_precision() const { return 1; }
428430
};
429431

430-
class Item_func_isclosed: public Item_bool_func
432+
class Item_func_isclosed: public Item_int_func
431433
{
432434
public:
433-
Item_func_isclosed(Item *a): Item_bool_func(a) {}
435+
Item_func_isclosed(Item *a): Item_int_func(a) {}
434436
longlong val_int();
435437
const char *func_name() const { return "st_isclosed"; }
438+
void fix_length_and_dec() { decimals=0; max_length=2; }
439+
uint decimal_precision() const { return 1; }
436440
};
437441

438442
class Item_func_isring: public Item_func_issimple

0 commit comments

Comments
 (0)