Bug #94382 MySQL workbench 8.0 shows inverted geospatial coordinates
Submitted: 18 Feb 15:21 Modified: 19 Feb 6:58
Reporter: Jan Waldner Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:8.0, 8.0.15 OS:Microsoft Windows
Assigned to: CPU Architecture:x86

[18 Feb 15:21] Jan Waldner
Description:
I have a table `areas` defined as follows:

CREATE TABLE `areas` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `boundary` polygon NOT NULL,
  `description` varchar(45) DEFAULT NULL,
  `name` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

I perform the following statement:

INSERT INTO areas (name, description, boundary) VALUES ('234', '234', ST_GeomFromText('POLYGON ((0 0,0 1,1 1,1 0,2 0,0 0))', 4326));

Looking at the resulting column with the data editor in WKT, it shows

POLYGON ((0 0,1 0,1 1,0 1,0 2,0 0))

all coordinates are inverted.

Using

SELECT ST_astext(boundary) FROM areas WHERE id = 1;

correctly returns

POLYGON((0 0,0 1,1 1,1 0,2 0,0 0))

Not sure how to interpret these results.

How to repeat:
CREATE TABLE `areas` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `boundary` polygon NOT NULL,
  `description` varchar(45) DEFAULT NULL,
  `name` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

INSERT INTO areas (name, description, boundary) VALUES ('234', '234', ST_GeomFromText('POLYGON ((0 0,0 1,1 1,1 0,2 0,0 0))', 4326));

Look at the resulting column with the data editor in WKT, it shows inverted coordinates for each point.
[19 Feb 6:58] Umesh Shastry
Hello Jan Waldner,

Thank you for the report.

regards,
Umesh