Bug #85298 item_geofunc.cc:1887:49: warning: enum constant in boolean context
Submitted: 3 Mar 2017 17:27 Modified: 24 May 2017 10:55
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:5.7+ OS:Any
Assigned to: CPU Architecture:Any

[3 Mar 2017 17:27] Shane Bester
Description:
look here:

https://github.com/mysql/mysql-server/blob/5.7/sql/item_geofunc.cc#L1869

if (header.wkb_type == Geometry::wkb_multipoint)
...
 else if (header.wkb_type == Geometry::wkb_multipolygon)
...
else if (Geometry::wkb_multilinestring)
...
else
....

Looks like a typo in the last 'else if' - it'll always be true since it's defined as 5.

./sql/item_geofunc.cc: In function ‘bool append_geometry(Geometry::wkb_parser*, Json_object*, bool, MBR*, const char*, int, bool, bool, bool, uint32)’:
./sql/item_geofunc.cc:1887:49: warning: enum constant in boolean context [-Wint-in-bool-context]
           else if (Geometry::wkb_multilinestring)
 

How to repeat:
read compiler warnings.

Suggested fix:
else if (header.wkb_type == Geometry::wkb_multilinestring)  ????
[24 May 2017 10:55] Erlend Dahl
Duplicate of

Bug#85235 MySQL does not compile with GCC 7
[29 Nov 2017 7:40] MySQL Verification Team
This issue was also reported independently in this blog post:
https://www.viva64.com/en/b/0542/