Uh oh!
There was an error while loading. Please reload this page.
gh-133439: Fix dot commands with trailing spaces are mistaken for multi-line sqlite statements in the sqlite3 command-line interface - #133440
Conversation
d756211 to
0d89da8Compare
serhiy-storchaka
left a comment
There was a problem hiding this comment.
The sqlite3 CLI supports also space after dot:
sqlite> . version
SQLite 3.45.1 2024-01-30 16:01:20 e876e51a0ed5c5b3126f52e532044363a014bc594cfefa87ffb5b82257ccalt1
zlib version 1.3
gcc-13.3.0 (64-bit)
But not before dot:
sqlite> .version
...> To be conforming with it, we should check if the first character is a dot, and if it is, use source[1:].strip() as the command. No stripping is needed for the SQL statement.
0d89da8 to
3543c33Comparetanloong
commented
May 9, 2025
Thank you for your review! I have modified the code to use |
3543c33 to
a4498abCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cbea2b1 to
487aafcCompare487aafc to
b473fe9Comparetanloong
commented
May 9, 2025
Sorry for the overlook, now the empty source and unknown dot commands are handled. I have improved the news entry. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
36b4a16 to
caf47bcCompareHead branch was pushed to by a user without write access
Thanks @tanloong for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440) (cherry picked from commit ebd4881) Co-authored-by: Tan Long <tanloong@foxmail.com>
GH-133738 is a backport of this pull request to the 3.14 branch. |
picnixz
commented
May 9, 2025
@serhiy-storchaka no 3.13 backports? |
serhiy-storchaka
commented
May 9, 2025
This is borderline between minor bug fix and minor feature. It improves the quality of life a little, but most people won't notice anything. If anyone wants to backport to 3.13, please do. If not, no problem either. |
tanloong
commented
May 9, 2025
I will do that. |
GH-133765 is a backport of this pull request to the 3.13 branch. |
serhiy-storchaka
commented
May 9, 2025
@tanloong, I meant any of the core developers. It's as simple as adding a label. Someone just has to want to do it. |
tanloong
commented
May 9, 2025
Ah, sorry, I misunderstood. |
…or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440) (cherry picked from commit ebd4881)
Uh oh!
There was an error while loading. Please reload this page.
| pass | ||
| case _ as unknown: | ||
| self.write("Error: unknown command or invalid arguments:" | ||
| f' "{unknown}".\n') |
There was a problem hiding this comment.
Error messages do not end with a '.' e.g.:
Python 3.15.0a0 (heads/main:c81fa2b9cd1, May 8 2025, 16:38:25) [GCC 15.1.1 20250425 (Red Hat 15.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> test
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
test
NameError: name 'test' is not defined
…or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440)
…or multi-line sqlite statements in the sqlite3 command-line interface (pythonGH-133440)
Issue: sqlite3 CLI does not recognize dot commands with trailing spaces #133439