[fix](type compatibility) fix unsigned int type compatibility problem (#17427)

Fix unsigned int type compatibility value scope problem.

When defining columns, map UNSIGNED INT to BIGINT for compatibility.
The problems are as follows:
It is not consistent with this doc
image

We support the unsigned int type to be compatible with mysql types, but the unsigned int type is created as the int at the time of definition. This will cause numerical overflow.
This commit is contained in:
ZhangYu0123
2023-03-07 08:55:38 +08:00
committed by GitHub
parent 6f3801d9da
commit 440cf526c8
3 changed files with 76 additions and 2 deletions

View File

@ -5744,6 +5744,9 @@ type ::=
{: RESULT = Type.SMALLINT; :}
| opt_signed_unsigned KW_INT opt_field_length
{: RESULT = Type.INT; :}
// This is just for MySQL compatibility now.
| KW_UNSIGNED KW_INT opt_field_length
{: RESULT = Type.BIGINT; :}
| KW_BIGINT opt_field_length
{: RESULT = Type.BIGINT; :}
| KW_LARGEINT opt_field_length
@ -5848,8 +5851,6 @@ opt_signed_unsigned ::=
{: RESULT = true; :}
| KW_SIGNED
{: RESULT = true; :}
| KW_UNSIGNED
{: RESULT = false; :}
;
type_def ::=