diff options
Diffstat (limited to 'sqlglot/dialects/mysql.py')
-rw-r--r-- | sqlglot/dialects/mysql.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sqlglot/dialects/mysql.py b/sqlglot/dialects/mysql.py index 59a0a2a..2185a85 100644 --- a/sqlglot/dialects/mysql.py +++ b/sqlglot/dialects/mysql.py @@ -21,7 +21,6 @@ from sqlglot.dialects.dialect import ( no_trycast_sql, parse_date_delta_with_interval, rename_func, - simplify_literal, strposition_to_locate_sql, ) from sqlglot.helper import seq_get @@ -689,6 +688,8 @@ class MySQL(Dialect): LIMIT_FETCH = "LIMIT" + LIMIT_ONLY_LITERALS = True + # MySQL doesn't support many datatypes in cast. # https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html#function_cast CAST_MAPPING = { @@ -712,16 +713,6 @@ class MySQL(Dialect): result = f"{result} UNSIGNED" return result - def limit_sql(self, expression: exp.Limit, top: bool = False) -> str: - # MySQL requires simple literal values for its LIMIT clause. - expression = simplify_literal(expression.copy()) - return super().limit_sql(expression, top=top) - - def offset_sql(self, expression: exp.Offset) -> str: - # MySQL requires simple literal values for its OFFSET clause. - expression = simplify_literal(expression.copy()) - return super().offset_sql(expression) - def xor_sql(self, expression: exp.Xor) -> str: if expression.expressions: return self.expressions(expression, sep=" XOR ") |