FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-16379: Expose sqlite error code by palaviv · Pull Request #1108 · python/cpython · GitHub

/ cpython Public

bpo-16379: Expose sqlite error code - #1108

Closed
palaviv wants to merge 5 commits into
python:mainfrom
palaviv:bpo-16379-expose-sqlite-error-code
Closed

bpo-16379: Expose sqlite error code #1108
palaviv wants to merge 5 commits into
python:mainfrom
palaviv:bpo-16379-expose-sqlite-error-code

Conversation

palaviv commented Apr 13, 2017
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

This PR adds the sqlite error code and name to the exceptions raised by the sqlite3 module. Once this is merged my hope is to expose the sqlite extended error code as discussed in bpo-24139

https://bugs.python.org/issue16379

auvipy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

plz rebase!

matrixise changed the title bpo-16379: Expose sqlite error code bpo-16379: Expose sqlite error code May 7, 2019

Copy link
Copy Markdown
Member

Hi @palaviv

Would you be interested to upgrade your PR to the last master?

Thank you

matrixise requested a review from berkerpeksag May 7, 2019 20:48
palaviv force-pushed the bpo-16379-expose-sqlite-error-code branch from 365ad2a to c236045 Compare May 8, 2019 12:22

palaviv commented May 8, 2019

Copy link
Copy Markdown
Contributor Author

Sure @matrixise. Do you think there is a chance for this to be merged?

palaviv force-pushed the bpo-16379-expose-sqlite-error-code branch from b9dc556 to 31467e3 Compare May 9, 2019 09:55

dimaqq commented Jun 7, 2019

Copy link
Copy Markdown
Contributor

If I remember https://bugs.python.org/issue24139 correctly, the issue was rather about exposing the extended error codes http://www.sqlite.org/c3ref/c_abort_rollback.html

palaviv commented Jun 11, 2019

Copy link
Copy Markdown
Contributor Author

@dimaqq you are correct. This is a patch for https://bugs.python.org/issue16379. There is a different patch that depends on this change to solve https://bugs.python.org/issue24139.

Copy link
Copy Markdown

I'd really really like to have this feature...

Comment thread Modules/_sqlite/module.c
{"PARSE_COLNAMES", PARSE_COLNAMES},

{"SQLITE_OK", SQLITE_OK},
/* enumerated return values for sqlite3_set_authorizer() callback */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It looks like SQLITE_OK is used in the wild (https://github.com/search?l=Python&p=4&q=SQLITE_OK&type=Code) thus it cannot be removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

SQLITE_OK is definitely in use. For example, it is used one of the valid return values in authoriser callbacks.

Comment thread Modules/_sqlite/module.c
#ifdef SQLITE_NOTADB
{"SQLITE_NOTADB", SQLITE_NOTADB},
#endif
{"SQLITE_DONE", SQLITE_DONE},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hi @palaviv, thanks for picking this up. Should SQLITE_NOTICE and SQLITE_WARNING be added to this list?

Copy link
Copy Markdown
Contributor

@palaviv: Can you rebase onto master and update your code to PEP 7 standards? Also, the #ifdefs are not needed as SQLite 3.7.15 is now a hard requirement.

Copy link
Copy Markdown
Contributor

@palaviv, are you planning on landing this PR? If not, would you mind if I reopened a PR with your changes cherry-picked onto it?

Copy link
Copy Markdown
Contributor

Closing this, as #27786 (based off of this PR) has now been merged. Thank you for your work, @palaviv!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.


Back | FazBrowse Home | New Git URL