Visitar URL original
bpo-9303: Migrate sqlite3 module to _v2 API to enhance performance by palaviv · Pull Request #359 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't call sqlite3_reset in _pysqlite_seterror in using sqlite3_prepa…
…re_v2
  • Loading branch information
palaviv committed Mar 1, 2017
commit 53607957972adb504efb80abda699e4ef8314814
6 changes: 5 additions & 1 deletion Modules/_sqlite/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st)
{
int errorcode;

/* SQLite often doesn't report anything useful, unless you reset the statement first */
#if SQLITE_VERSION_NUMBER >= 3003009

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't >= be < here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

/* SQLite often doesn't report anything useful, unless you reset the statement first.
When using sqlite3_prepare_v2 this is not needed. */
if (st != NULL) {
(void)sqlite3_reset(st);
}
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nitpick: Please remove extra empty line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done


errorcode = sqlite3_errcode(db);

Expand Down