Change of sqlite3_prepare to sqlite3_prepare_v2
Needs ReviewPublic

Authored by staniek on Jan 27 2016, 10:14 PM.

Details

Reviewers
wkosowicz
wicik
Summary

sqlite_reset according to
http://www.sqlite.org/c3ref/prepare.html
is no longer required

Test Plan

Rebuilt KDB
Run Kexi

Diff Detail

Repository
R15 KDb
Lint
Lint Skipped
Unit
Unit Tests Skipped
wkosowicz updated this revision to Diff 2126.Jan 27 2016, 10:14 PM
wkosowicz retitled this revision from to Change of sqlite3_prepare to sqlite3_prepare_v2.
wkosowicz updated this object.
wkosowicz edited the test plan for this revision. (Show Details)
wkosowicz added reviewers: staniek, wicik.
wkosowicz set the repository for this revision to R15 KDb.
wkosowicz added a project: KDb.
staniek edited edge metadata.Jan 27 2016, 10:47 PM

Yes, second call to sqlite3_reset() used on error (actually not by us) isn't necessary. But the first call is, otherwise old values bound to columns won't be removed.

From https://www.sqlite.org/c3ref/reset.html:

The sqlite3_reset() function is called to reset a prepared statement object back to its initial state, ready to be re-executed.

So if I am not mistaken sqlite3_reset() stays and by adding _v2 we will get more detailed error codes.

BTW, the more fresh shell.c from here https://www.sqlite.org/src/artifact/dcd7a83645ef2a58 from the official SQLite3 code also uses sqlite3_reset() with sqlite3_prepare_v2().

staniek requested changes to this revision.Jan 27 2016, 10:47 PM
staniek edited edge metadata.
This revision now requires changes to proceed.Jan 27 2016, 10:47 PM
wkosowicz updated this revision to Diff 2132.Jan 28 2016, 8:14 PM
wkosowicz edited edge metadata.
staniek accepted this revision.Jan 28 2016, 8:41 PM
staniek edited edge metadata.

Good! Almost done, please also change 2 occurrences of sqlite3_prepare in the code comments and push.

This revision is now accepted and ready to land.Jan 28 2016, 8:41 PM
staniek commandeered this revision.Sep 27 2016, 11:11 PM
staniek edited reviewers, added: wkosowicz; removed: staniek.
This revision now requires review to proceed.Sep 27 2016, 11:11 PM

Let's integrate this after 3.0.0.