Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split() return the wrong sql-command count #789

Open
popolong opened this issue Sep 10, 2024 · 0 comments
Open

split() return the wrong sql-command count #789

popolong opened this issue Sep 10, 2024 · 0 comments

Comments

@popolong
Copy link

popolong commented Sep 10, 2024

Describe the bug
split() return the wrong sql-command count.

To Reproduce
content = """
INSERT INTO table VALUES (1, '1', '');
INSERT INTO table VALUES (2, '2', ':/\');
INSERT INTO table VALUES (3, '3', 'abc');"""
stmts = sqlparse.split(content)
print(f"total {len(stmts)} stmt(s)") # got 2 , but should be 3

image

Expected behavior
there are 3 INSERT cmds, but split got just 2.

Versions (please complete the following information):

  • Python: 3.12.3
  • sqlparse: 0.5.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant