From e575ae2c37359ab51b23ce44ccda4bb9bbfd3a5f Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Mon, 19 Oct 2020 08:41:26 +0200 Subject: Fix parsing of backticks (fixes #588). The backticks in this operator regex was introduced in c794c97531c09e66b6a7ffac76626a727ad02f5e. Pretty sure it was by mistake. --- tests/test_regressions.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/test_regressions.py b/tests/test_regressions.py index b247ce2..38d1840 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -411,3 +411,10 @@ def test_format_invalid_where_clause(): # did raise ValueError formatted = sqlparse.format('where, foo', reindent=True) assert formatted == 'where, foo' + + +def test_splitting_at_and_backticks_issue588(): + splitted = sqlparse.split( + 'grant foo to user1@`myhost`; grant bar to user1@`myhost`;') + assert len(splitted) == 2 + assert splitted[-1] == 'grant bar to user1@`myhost`;' -- cgit v1.2.1