Skip to content

[sqlite3] Improve sqlite3_value_text() error handling #88019

Closed

Description

@erlend-aasland
BPO 43853
Nosy @gvanrossum, @berkerpeksag, @serhiy-storchaka, @JelleZijlstra, @pablogsal, @miss-islington, @erlend-aasland
PRs
  • bpo-43853: Handle sqlite3_value_text() errors #25422
  • [3.10] bpo-43853: Handle sqlite3_value_text() errors (GH-25422) #26534
  • [3.9] bpo-43853: Handle sqlite3_value_text() errors (GH-25422). #27627
  • bpo-43853: Expand test suite for SQLite UDF's #27642
  • bpo-43853: Amend NEWS entry #27922
  • [3.9] bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922) #27952
  • [3.10] bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922) #27953
  • [3.10] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) #31030
  • [3.9] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) (GH-31030) #31586
  • Files
  • patch.diff
  • 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 2022-03-02.06:41:01.374>
    created_at = <Date 2021-04-15.10:00:09.823>
    labels = ['extension-modules', 'type-bug', '3.9', '3.10', '3.11']
    title = '[sqlite3] Improve sqlite3_value_text() error handling'
    updated_at = <Date 2022-03-02.06:41:01.373>
    user = 'https://github.com/erlend-aasland'

    bugs.python.org fields:

    activity = <Date 2022-03-02.06:41:01.373>
    actor = 'erlendaasland'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-03-02.06:41:01.374>
    closer = 'erlendaasland'
    components = ['Extension Modules']
    creation = <Date 2021-04-15.10:00:09.823>
    creator = 'erlendaasland'
    dependencies = []
    files = ['49961']
    hgrepos = []
    issue_num = 43853
    keywords = ['patch']
    message_count = 17.0
    messages = ['391124', '394267', '395109', '395112', '399075', '399084', '399114', '399120', '400174', '400288', '400292', '400296', '400319', '401565', '411771', '413620', '414325']
    nosy_count = 7.0
    nosy_names = ['gvanrossum', 'berker.peksag', 'serhiy.storchaka', 'JelleZijlstra', 'pablogsal', 'miss-islington', 'erlendaasland']
    pr_nums = ['25422', '26534', '27627', '27642', '27922', '27952', '27953', '31030', '31586']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue43853'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    Activity

    1. erlend-aasland commented on Apr 15, 2021

      @erlend-aasland
      ContributorAuthor

      Fix sqlite3_value_text() usage:

      • Raise MemoryError if sqlite3_value_text() sets SQLITE_NOMEM
      • Let PyUnicode_FromStringAndSize() errors propagate

      Quoting the SQLite docs:
      "As long as the input parameter is correct, these routines can only fail if an out-of-memory error occurs"

      See also:

    2. changed the title [-][sqlite] Fix sqlite3_value_text() usage[/-] [+][sqlite3] Fix sqlite3_value_text() usage[/+] on Apr 15, 2021
    3. changed the title [-][sqlite] Fix sqlite3_value_text() usage[/-] [+][sqlite3] Fix sqlite3_value_text() usage[/+] on Apr 15, 2021
    4. changed the title [-][sqlite3] Fix sqlite3_value_text() usage[/-] [+][sqlite3] Improve sqlite3_value_text() error handling[/+] on May 9, 2021
    5. changed the title [-][sqlite3] Fix sqlite3_value_text() usage[/-] [+][sqlite3] Improve sqlite3_value_text() error handling[/+] on May 9, 2021
    6. erlend-aasland commented on May 24, 2021

      @erlend-aasland
      ContributorAuthor

      The affected branch is exercised by the following tests:

      • test_aggr_check_param_blob
      • test_aggr_check_param_float
      • test_aggr_check_param_int
      • test_aggr_check_param_none
      • test_aggr_check_param_str
      • test_aggr_check_params_int
      • test_aggr_exception_in_finalize
      • test_aggr_exception_in_step
      • test_aggr_no_finalize
      • test_param_string

      I've expanded test_aggr_check_param_str and test_param_string to also check empty strings.

    7. pablogsal commented on Jun 4, 2021

      @pablogsal
      Member

      New changeset 006fd86 by Erlend Egeberg Aasland in branch 'main':
      bpo-43853: Handle sqlite3_value_text() errors (GH-25422)
      006fd86

    8. 12 remaining items

    9. serhiy-storchaka commented on Aug 6, 2021

      @serhiy-storchaka
      Member

      What about new tests and NEWS update?

    10. erlend-aasland commented on Aug 23, 2021

      @erlend-aasland
      ContributorAuthor

      What about new tests and NEWS update?

      See PR 27642 for the expanded tests, and PR 27922 for amending news entries. I didn't combine the two, as I figured you might have more comments on the former PR.

    11. pablogsal commented on Aug 25, 2021

      @pablogsal
      Member

      New changeset 7903a10 by Erlend Egeberg Aasland in branch 'main':
      bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922)
      7903a10

    12. pablogsal commented on Aug 25, 2021

      @pablogsal
      Member

      New changeset 0ec17a2 by Erlend Egeberg Aasland in branch '3.9':
      [3.9] bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922) (GH-27952)
      0ec17a2

    13. pablogsal commented on Aug 25, 2021

      @pablogsal
      Member

      New changeset b34ca7e by Erlend Egeberg Aasland in branch '3.10':
      [3.10] bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922). (GH-27953)
      b34ca7e

    14. erlend-aasland commented on Aug 26, 2021

      @erlend-aasland
      ContributorAuthor

      Thanks for merging the NEWS amendments, Pablo. We can close this issue after landing PR 27642.

    15. erlend-aasland commented on Sep 10, 2021

      @erlend-aasland
      ContributorAuthor

      Serhiy, I believe I've addressed your review remarks on PR 27642. Would you mind taking a look at it again if you have time?

    16. gvanrossum commented on Jan 26, 2022

      @gvanrossum
      Member

      New changeset 3eb3b4f by Erlend Egeberg Aasland in branch 'main':
      bpo-43853: Expand test suite for SQLite UDF's (GH-27642)
      3eb3b4f

    17. JelleZijlstra commented on Feb 21, 2022

      @JelleZijlstra
      Member

      New changeset ba457fe by Erlend Egeberg Aasland in branch '3.10':
      [3.10] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) (GH-31030)
      ba457fe

    18. miss-islington commented on Mar 2, 2022

      @miss-islington
      Contributor

      New changeset 3ea2a8f by Erlend Egeberg Aasland in branch '3.9':
      [3.9] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) (GH-31030) (GH-31586)
      3ea2a8f

    19. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of life3.11only security fixes3.9 (EOL)end of lifeextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions