Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-133439: Fix dot commands with trailing spaces are mistaken for multi-line sqlite statements in the sqlite3 command-line interface#133440
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
080d0c8cd277f3e2703b4a4498ab9b3ed394023fb1b473fe9bb0c7d95ec7198caf47bce1ea159File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -48,17 +48,25 @@ def runsource(self, source, filename="<input>", symbol="single"): | ||
| Return True if more input is needed; buffering is done automatically. | ||
| Return False if input is a complete statement ready for execution. | ||
| """ | ||
| match source: | ||
| case ".version": | ||
| print(f"{sqlite3.sqlite_version}") | ||
| case ".help": | ||
| print("Enter SQL code and press enter.") | ||
| case ".quit": | ||
| sys.exit(0) | ||
| case _: | ||
| if not sqlite3.complete_statement(source): | ||
| return True | ||
| execute(self._cur, source) | ||
| if not source or source.isspace(): | ||
| return False | ||
| if source[0] == ".": | ||
| match source[1:].strip(): | ||
serhiy-storchaka marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| case "version": | ||
| print(f"{sqlite3.sqlite_version}") | ||
| case "help": | ||
| print("Enter SQL code and press enter.") | ||
| case "quit": | ||
| sys.exit(0) | ||
| case "": | ||
| pass | ||
| case _ as unknown: | ||
| self.write("Error: unknown command or invalid arguments:" | ||
erlend-aasland marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| f' "{unknown}".\n') | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error messages do not end with a '.' e.g.: | ||
| else: | ||
| if not sqlite3.complete_statement(source): | ||
| return True | ||
| execute(self._cur, source) | ||
| return False | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Fix dot commands with trailing spaces are mistaken for multi-line SQL | ||
| statements in the sqlite3 command-line interface. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.