summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/mysql.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-08 07:22:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-08 07:22:15 +0000
commit5b1ac5070c43c40a2b5bbc991198b0dddf45dc75 (patch)
treeed329138d5e8e5c9d5164b5c853d6f40a116f4d6 /sqlglot/dialects/mysql.py
parentReleasing debian version 11.3.0-1. (diff)
downloadsqlglot-5b1ac5070c43c40a2b5bbc991198b0dddf45dc75.tar.xz
sqlglot-5b1ac5070c43c40a2b5bbc991198b0dddf45dc75.zip
Merging upstream version 11.3.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/mysql.py')
-rw-r--r--sqlglot/dialects/mysql.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sqlglot/dialects/mysql.py b/sqlglot/dialects/mysql.py
index b1e20bd..3531f59 100644
--- a/sqlglot/dialects/mysql.py
+++ b/sqlglot/dialects/mysql.py
@@ -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"),