diff --git a/integration_tests/mysql/main.go b/integration_tests/mysql/main.go index 406f3d44..d561161e 100644 --- a/integration_tests/mysql/main.go +++ b/integration_tests/mysql/main.go @@ -107,7 +107,8 @@ CREATE TABLE %s ( c_json JSON, c_point POINT, c_geom GEOMETRY NOT NULL, - c_linestring LINESTRING NOT NULL + c_linestring LINESTRING NOT NULL, + c_polygon POLYGON NOT NULL ) ` @@ -180,7 +181,9 @@ INSERT INTO %s VALUES ( -- c_geom ST_GeomFromText('POINT(1 1)'), -- c_linestring - ST_GeomFromText('LINESTRING(0 0, 1 1, 2 2)') + ST_GeomFromText('LINESTRING(0 0, 1 1, 2 2)'), + -- c_polygon + ST_GeomFromText('POLYGON((0 0, 1 1, 1 0, 0 0))') ) ` @@ -468,6 +471,14 @@ const expectedPayloadTemplate = `{ "field": "c_linestring", "name": "io.debezium.data.geometry.Geometry", "parameters": null + }, + { + "type": "struct", + "optional": false, + "default": null, + "field": "c_polygon", + "name": "io.debezium.data.geometry.Geometry", + "parameters": null } ], "optional": false, @@ -509,6 +520,10 @@ const expectedPayloadTemplate = `{ "x": 12.34, "y": 56.78 }, + "c_polygon": { + "srid": 0, + "wkb": "AQMAAAABAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwPwAAAAAAAPA/AAAAAAAA8D8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + }, "c_set": "one,two", "c_smallint": 2, "c_smallint_unsigned": 3, diff --git a/lib/mysql/schema/schema.go b/lib/mysql/schema/schema.go index 4746144e..1f408d7e 100644 --- a/lib/mysql/schema/schema.go +++ b/lib/mysql/schema/schema.go @@ -221,7 +221,8 @@ func parseColumnDataType(originalS string) (DataType, *Opts, error) { return Point, nil, nil case "geometry", - "linestring": + "linestring", + "polygon": return Geometry, nil, nil default: return -1, nil, fmt.Errorf("unknown data type: %q", originalS)