Skip to content

Commit

Permalink
Last one
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jun 25, 2024
1 parent 473b743 commit ead905f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
19 changes: 17 additions & 2 deletions integration_tests/mysql/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ CREATE TABLE %s (
c_polygon POLYGON NOT NULL,
c_multipoint MULTIPOINT NOT NULL,
c_multilinestring MULTILINESTRING NOT NULL,
c_multipolygon MULTIPOLYGON NOT NULL
c_multipolygon MULTIPOLYGON NOT NULL,
c_geomcollection GEOMETRYCOLLECTION NOT NULL
)
`

Expand Down Expand Up @@ -192,7 +193,9 @@ INSERT INTO %s VALUES (
-- c_multilinestring
ST_GeomFromText('MULTILINESTRING((4 4, 5 5), (6 6, 7 7))'),
-- c_multipolygon
ST_GeomFromText('MULTIPOLYGON(((4 4, 5 5, 5 4, 4 4)), ((6 6, 7 7, 7 6, 6 6)))')
ST_GeomFromText('MULTIPOLYGON(((4 4, 5 5, 5 4, 4 4)), ((6 6, 7 7, 7 6, 6 6)))'),
-- c_geomcollection
ST_GeomFromText('GEOMETRYCOLLECTION(POINT(6 6), LINESTRING(7 7, 8 8), POLYGON((9 9, 10 10, 11 11, 9 9)))')
)
`

Expand Down Expand Up @@ -512,6 +515,14 @@ const expectedPayloadTemplate = `{
"field": "c_multipolygon",
"name": "io.debezium.data.geometry.Geometry",
"parameters": null
},
{
"type": "struct",
"optional": false,
"default": null,
"field": "c_geomcollection",
"name": "io.debezium.data.geometry.Geometry",
"parameters": null
}
],
"optional": false,
Expand Down Expand Up @@ -539,6 +550,10 @@ const expectedPayloadTemplate = `{
"srid": 0,
"wkb": "AQEAAAAAAAAAAADwPwAAAAAAAPA/"
},
"c_geomcollection": {
"srid": 0,
"wkb": "AQcAAAADAAAAAQEAAAAAAAAAAAAYQAAAAAAAABhAAQIAAAACAAAAAAAAAAAAHEAAAAAAAAAcQAAAAAAAACBAAAAAAAAAIEABAwAAAAEAAAAEAAAAAAAAAAAAIkAAAAAAAAAiQAAAAAAAACRAAAAAAAAAJEAAAAAAAAAmQAAAAAAAACZAAAAAAAAAIkAAAAAAAAAiQA=="
},
"c_int": 4,
"c_int_unsigned": 55,
"c_json": "{\"key1\": \"value1\", \"key2\": \"value2\"}",
Expand Down
3 changes: 2 additions & 1 deletion lib/mysql/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,12 @@ func parseColumnDataType(originalS string) (DataType, *Opts, error) {
case "point":
return Point, nil, nil
case
"geomcollection",
"geometry",
"linestring",
"multilinestring",
"multipoint",
"multipolygon",
"multilinestring",
"polygon":
return Geometry, nil, nil
default:
Expand Down

0 comments on commit ead905f

Please sign in to comment.