@@ -12796,11 +12796,79 @@ func (p *Parser) parseCreateFulltextStatement() (ast.Statement, error) {
1279612796 OnName : onName ,
1279712797 }
1279812798
12799- // Parse optional (column_list) - skip for now
12799+ // Parse optional (column_list)
1280012800 if p .curTok .Type == TokenLParen {
1280112801 p .nextToken () // consume (
1280212802 for p .curTok .Type != TokenRParen && p .curTok .Type != TokenEOF {
12803- p .nextToken ()
12803+ col := & ast.FullTextIndexColumn {}
12804+ col .Name = p .parseIdentifier ()
12805+
12806+ // Parse optional TYPE COLUMN type_column_name
12807+ if strings .ToUpper (p .curTok .Literal ) == "TYPE" {
12808+ p .nextToken () // consume TYPE
12809+ if strings .ToUpper (p .curTok .Literal ) == "COLUMN" {
12810+ p .nextToken () // consume COLUMN
12811+ }
12812+ col .TypeColumn = p .parseIdentifier ()
12813+ }
12814+
12815+ // Parse optional LANGUAGE language_term
12816+ if p .curTok .Type == TokenLanguage {
12817+ p .nextToken () // consume LANGUAGE
12818+ col .LanguageTerm = & ast.IdentifierOrValueExpression {}
12819+ if p .curTok .Type == TokenString {
12820+ strLit , _ := p .parseStringLiteral ()
12821+ col .LanguageTerm .Value = strLit .Value
12822+ col .LanguageTerm .ValueExpression = strLit
12823+ } else if p .curTok .Type == TokenNumber {
12824+ // Check for hex literal (0x...)
12825+ if strings .HasPrefix (strings .ToLower (p .curTok .Literal ), "0x" ) {
12826+ lit := & ast.BinaryLiteral {
12827+ LiteralType : "Binary" ,
12828+ IsLargeObject : false ,
12829+ Value : p .curTok .Literal ,
12830+ }
12831+ col .LanguageTerm .Value = p .curTok .Literal
12832+ col .LanguageTerm .ValueExpression = lit
12833+ } else {
12834+ // Parse integer literal directly
12835+ lit := & ast.IntegerLiteral {
12836+ LiteralType : "Integer" ,
12837+ Value : p .curTok .Literal ,
12838+ }
12839+ col .LanguageTerm .Value = p .curTok .Literal
12840+ col .LanguageTerm .ValueExpression = lit
12841+ }
12842+ p .nextToken ()
12843+ } else if p .curTok .Type == TokenBinary {
12844+ // Handle binary/hex literal
12845+ lit := & ast.BinaryLiteral {
12846+ LiteralType : "Binary" ,
12847+ IsLargeObject : false ,
12848+ Value : p .curTok .Literal ,
12849+ }
12850+ col .LanguageTerm .Value = p .curTok .Literal
12851+ col .LanguageTerm .ValueExpression = lit
12852+ p .nextToken ()
12853+ } else {
12854+ col .LanguageTerm .Identifier = p .parseIdentifier ()
12855+ col .LanguageTerm .Value = col .LanguageTerm .Identifier .Value
12856+ }
12857+ }
12858+
12859+ // Parse optional STATISTICAL_SEMANTICS
12860+ if strings .ToUpper (p .curTok .Literal ) == "STATISTICAL_SEMANTICS" {
12861+ col .StatisticalSemantics = true
12862+ p .nextToken ()
12863+ }
12864+
12865+ stmt .FullTextIndexColumns = append (stmt .FullTextIndexColumns , col )
12866+
12867+ if p .curTok .Type == TokenComma {
12868+ p .nextToken () // consume comma
12869+ } else {
12870+ break
12871+ }
1280412872 }
1280512873 if p .curTok .Type == TokenRParen {
1280612874 p .nextToken () // consume )
0 commit comments