@@ -82,6 +82,7 @@ class Tokenizer(MySQL.Tokenizer):
8282 "::$" : TokenType .DCOLONDOLLAR ,
8383 "::%" : TokenType .DCOLONPERCENT ,
8484 "::?" : TokenType .DCOLONQMARK ,
85+ "RECORD" : TokenType .STRUCT ,
8586 }
8687
8788 class Parser (MySQL .Parser ):
@@ -328,6 +329,7 @@ class Generator(MySQL.Generator):
328329 SUPPORTS_UESCAPE = False
329330 NULL_ORDERING_SUPPORTED = True
330331 MATCH_AGAINST_TABLE_PREFIX = "TABLE "
332+ STRUCT_DELIMITER = ("(" , ")" )
331333
332334 @staticmethod
333335 def _unicode_substitute (m : re .Match [str ]) -> str :
@@ -613,7 +615,6 @@ def _unicode_substitute(m: re.Match[str]) -> str:
613615 exp .DataType .Type .SERIAL ,
614616 exp .DataType .Type .SMALLSERIAL ,
615617 exp .DataType .Type .SMALLMONEY ,
616- exp .DataType .Type .STRUCT ,
617618 exp .DataType .Type .SUPER ,
618619 exp .DataType .Type .TIMETZ ,
619620 exp .DataType .Type .TIMESTAMPNTZ ,
@@ -654,6 +655,7 @@ def _unicode_substitute(m: re.Match[str]) -> str:
654655 exp .DataType .Type .LINESTRING : "GEOGRAPHY" ,
655656 exp .DataType .Type .POLYGON : "GEOGRAPHY" ,
656657 exp .DataType .Type .MULTIPOLYGON : "GEOGRAPHY" ,
658+ exp .DataType .Type .STRUCT : "RECORD" ,
657659 exp .DataType .Type .JSONB : "BSON" ,
658660 exp .DataType .Type .TIMESTAMP : "TIMESTAMP" ,
659661 exp .DataType .Type .TIMESTAMP_S : "TIMESTAMP" ,
0 commit comments