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

Check sqlite3_version before allowing check_same_thread = False #71377

Closed
DaveSawyer mannequin opened this issue Jun 3, 2016 · 5 comments
Closed

Check sqlite3_version before allowing check_same_thread = False #71377

DaveSawyer mannequin opened this issue Jun 3, 2016 · 5 comments
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@DaveSawyer
Copy link
Mannequin

DaveSawyer mannequin commented Jun 3, 2016

BPO 27190
Nosy @berkerpeksag
Files
  • sqlite_oldver_issue.txt
  • issue27190_patch2.txt
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-06-12.11:11:03.591>
    created_at = <Date 2016-06-03.00:53:39.861>
    labels = ['extension-modules', 'type-feature']
    title = 'Check sqlite3_version before allowing check_same_thread = False'
    updated_at = <Date 2016-06-12.11:11:03.589>
    user = 'https://bugs.python.org/DaveSawyer'

    bugs.python.org fields:

    activity = <Date 2016-06-12.11:11:03.589>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-06-12.11:11:03.591>
    closer = 'berker.peksag'
    components = ['Extension Modules']
    creation = <Date 2016-06-03.00:53:39.861>
    creator = 'Dave Sawyer'
    dependencies = []
    files = ['43135', '43161']
    hgrepos = []
    issue_num = 27190
    keywords = []
    message_count = 5.0
    messages = ['267013', '267022', '267141', '268362', '268363']
    nosy_count = 3.0
    nosy_names = ['python-dev', 'berker.peksag', 'Dave Sawyer']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue27190'
    versions = ['Python 3.5', 'Python 3.6']

    @DaveSawyer
    Copy link
    Mannequin Author

    DaveSawyer mannequin commented Jun 3, 2016

    Starting in sqlite version 3.3.1 (Jan 2006) multiple threads can share the same connection. Python allows you do use this with the check_same_thread parameter of sqlite3.connect() method. It's almost certain users have a late enough version of sqlite that they can use this option. While we could document "check your version before using this feature" (see http://bugs.python.org/issue27113) it would be nicer to check the actual database for support. Code can be written and tested on one machine and deployed to another machine. Using this feature on an very old version of sqlite can crash or possibly corrupt the database.

    @DaveSawyer DaveSawyer mannequin added the type-feature A feature request or enhancement label Jun 3, 2016
    @berkerpeksag
    Copy link
    Member

    Thanks for the patch. I'm not sure we can apply the patch to bugfix branches. You can use SQLITE_VERSION_NUMBER to check sqlite3 version.

    @berkerpeksag berkerpeksag added the extension-modules C modules in the Modules dir label Jun 3, 2016
    @DaveSawyer
    Copy link
    Mannequin Author

    DaveSawyer mannequin commented Jun 3, 2016

    This can go into bugfix branches. In fact, it's most likely to be helpful there because they are more likely to be running with a version of sqlite 10 years old. I use the sqlite3_libversion_number() call because I'm testing against the version of sqlite actually loaded. The SQLITE_VERSION_NUMBER define is set at compile time.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jun 12, 2016

    New changeset 12bf71b9f1cd by Berker Peksag in branch '3.5':
    Issue bpo-27190: Raise NotSupportedError if sqlite3 is older than 3.3.1
    https://hg.python.org/cpython/rev/12bf71b9f1cd

    New changeset 4502cff170c2 by Berker Peksag in branch 'default':
    Issue bpo-27190: Merge from 3.5
    https://hg.python.org/cpython/rev/4502cff170c2

    @berkerpeksag
    Copy link
    Member

    Thanks!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant