We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea185ba commit 54d44faCopy full SHA for 54d44fa
google/cloud/spanner_dbapi/parse_utils.py
@@ -233,6 +233,11 @@ def classify_statement(query, args=None):
233
:rtype: ParsedStatement
234
:returns: parsed statement attributes.
235
"""
236
+ # Check for RUN PARTITION command to avoid sqlparse processing it.
237
+ # sqlparse fails with "Maximum grouping depth exceeded" on long partition IDs.
238
+ if re.match(r"^\s*RUN\s+PARTITION\b", query, re.IGNORECASE | re.DOTALL):
239
+ return client_side_statement_parser.parse_stmt(query.strip())
240
+
241
# sqlparse will strip Cloud Spanner comments,
242
# still, special commenting styles, like
243
# PostgreSQL dollar quoted comments are not
0 commit comments