1
0
Fork 0

Merging upstream version 11.3.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 15:43:32 +01:00
parent f767789b5e
commit 4a70b88890
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
62 changed files with 28339 additions and 27272 deletions

View file

@ -4,6 +4,7 @@ from sqlglot import exp, generator, parser, tokens
from sqlglot.dialects.dialect import (
Dialect,
locate_to_strposition,
min_or_least,
no_ilike_sql,
no_paren_current_date_sql,
no_tablesample_sql,
@ -179,7 +180,7 @@ class MySQL(Dialect):
COMMANDS = tokens.Tokenizer.COMMANDS - {TokenType.SET, TokenType.SHOW}
class Parser(parser.Parser):
FUNC_TOKENS = {*parser.Parser.FUNC_TOKENS, TokenType.SCHEMA} # type: ignore
FUNC_TOKENS = {*parser.Parser.FUNC_TOKENS, TokenType.SCHEMA, TokenType.DATABASE} # type: ignore
FUNCTIONS = {
**parser.Parser.FUNCTIONS, # type: ignore
@ -441,6 +442,7 @@ class MySQL(Dialect):
exp.CurrentDate: no_paren_current_date_sql,
exp.CurrentTimestamp: lambda *_: "CURRENT_TIMESTAMP",
exp.ILike: no_ilike_sql,
exp.Min: min_or_least,
exp.TableSample: no_tablesample_sql,
exp.TryCast: no_trycast_sql,
exp.DateAdd: _date_add_sql("ADD"),