Author erlendaasland
Recipients erlendaasland, petr.viktorin
Date 2021-09-07.11:46:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Quoting Petr Viktorin in PR 27940,

- db is not set to NULL if init fails.
- This segfaults for me:

  import sqlite3

  conn = sqlite3.connect(':memory:')
  conn.execute('CREATE TABLE foo (bar)')

  except sqlite3.OperationalError:

  conn.execute('INSERT INTO foo (bar) VALUES (1), (2), (3), (4)')

Other issues:
- reinitialisation is not handled gracefully
- __init__ is messy; members are initialised here and there

Suggested to reorder connection __init__ in logical groups to more easily handle errors:
  1. handle reinit
  2. open and configure database
  3. create statement LRU cache and weak ref cursor list
  4. initialise members in the order they're defined in connection.h
  5. set isolation level, since it's a weird case anyway
Date User Action Args
2021-09-07 11:46:02erlendaaslandsetrecipients: + erlendaasland, petr.viktorin
2021-09-07 11:46:02erlendaaslandsetmessageid: <>
2021-09-07 11:46:02erlendaaslandlinkissue45126 messages
2021-09-07 11:46:01erlendaaslandcreate