antlr / grammars-v4

Grammars written for ANTLR v4; expectation that the grammars are free of actions.
MIT License
10.22k stars 3.71k forks source link

nchar here seem not working #4221

Closed huiyuanai709 closed 2 months ago

huiyuanai709 commented 2 months ago

Hello nchar here is an exception?

| type = (BOOL_SYMBOL | BOOLEAN_SYMBOL)
    | type = CHAR_SYMBOL fieldLength? charsetWithOptBinary?
    | nchar fieldLength? BINARY_SYMBOL?
    | type = BINARY_SYMBOL fieldLength?
    | (type = CHAR_SYMBOL VARYING_SYMBOL | type = VARCHAR_SYMBOL) fieldLength charsetWithOptBinary?
    | (
        type = NATIONAL_SYMBOL VARCHAR_SYMBOL
        | type = NVARCHAR_SYMBOL
        | type = NCHAR_SYMBOL VARCHAR_SYMBOL
        | type = NATIONAL_SYMBOL CHAR_SYMBOL VARYING_SYMBOL
        | type = NCHAR_SYMBOL VARYING_SYMBOL
    ) fieldLength BINARY_SYMBOL?

https://github.com/antlr/grammars-v4/blob/e07dbbf3445d31da61af5f54f04df78ea40ab9f8/sql/mysql/Oracle/MySQLParser.g4#L3748C1-L3759C33

kaby76 commented 2 months ago

You don't provide:

There is nothing to go on here.

huiyuanai709 commented 2 months ago

You don't provide:

  • any explanation of the problem;

  • any example that fails to parse or results in a bad parse tree.

There is nothing to go on here.

it's clearly to see the nchar is not consistent with others type

I think nchar should be consistent with other types

kaby76 commented 2 months ago

I still don't understand what the inconsistency is here. You don't propose a change for the dataType parser rule.

But, more importantly, this grammar is maintained by @mike-lischke who works at Oracle on MySQL. Changes should go through him at Oracle on an official MySQL github repo.

I think we're going to need a change to the readme to note how to propose changes.

huiyuanai709 commented 2 months ago

I still don't understand what the inconsistency is here. You don't propose a change for the dataType parser rule.

But, more importantly, this grammar is maintained by @mike-lischke who works at Oracle on MySQL. Changes should go through him at Oracle on an official MySQL github repo.

I think we're going to need a change to the readme to note how to propose changes.

Sorry, My mistake nchar has National Char and nchar two express, Try to Translate MYSQL DDL dataType to object relation model commonly get type but nchar flash image