Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Issue 924: sqlite3 pragma get/set user_version implemented (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
18 years, 1 month ago by Dimitri
Modified:
16 years, 10 months ago
Reviewers:
google-gears-eng, Aaron, Scott.Hess
Base URL:
http://google-gears.googlecode.com/svn/contrib/dimitri.glazkov/database2/gears/
Visibility:
Public.

Description

Added direct pragma modification calls to sqlite3 API.

Patch Set 1 #

Patch Set 2 : moved code to btree.c, restructured #

Patch Set 3 : Simplified by removing transaction-creating, just report misuse now #

Patch Set 4 : Removed starting a transaction, just report SQLITE_MISUSE now. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -51 lines) Patch
third_party/sqlite_google/preprocessed/sqlite3.h View 1 2 1 chunk +4 lines, -8 lines 0 comments Download
third_party/sqlite_google/src/btree.c View 2 2 chunks +35 lines, -0 lines 16 comments Download
third_party/sqlite_google/src/pragma.c View 1 2 2 chunks +0 lines, -35 lines 0 comments Download
third_party/sqlite_google/src/sqlite.h.in View 1 2 1 chunk +4 lines, -8 lines 0 comments Download

Messages

Total messages: 8
GvR
Dmitri, through scanning the logs for errors, I noticed the base url of your issue ...
18 years, 1 month ago (2008-05-10 16:15:02 UTC) #1
Aaron
LGTM
18 years, 1 month ago (2008-05-11 02:37:57 UTC) #2
Scott.Hess
Sorry for the delay - I'm gradually working my way through all my deferred gears-related ...
18 years ago (2008-05-20 18:37:03 UTC) #3
Dimitri
Thanks for the comments, Scott! Ready for another look. http://codereview.appspot.com/924/diff/1/2 File third_party/sqlite_google/preprocessed/sqlite3.h (right): http://codereview.appspot.com/924/diff/1/2#newcode2689 Line ...
18 years ago (2008-05-21 13:14:30 UTC) #4
Scott.Hess
Main thing about using the automated process for generating sqlite3.h is so that we don't ...
18 years ago (2008-05-22 23:44:27 UTC) #5
Dimitri
Ready for another look. I'll add unit tests after rebranching. http://codereview.appspot.com/924/diff/83/141 File third_party/sqlite_google/src/btree.c (right): http://codereview.appspot.com/924/diff/83/141#newcode6438 ...
18 years ago (2008-06-04 03:02:16 UTC) #6
Scott.Hess
Looking good, I'm happier with the condensed not-mucking-with-transactions-at-all version. Left with style comments, which is ...
18 years ago (2008-06-04 17:48:55 UTC) #7
Dimitri
18 years ago (2008-06-11 01:31:56 UTC) #8
Prettified. Unfortunately, due to branching, I am unable to put the new code
side-by-side. Instead, it's in it's own little world:
http://codereview.appspot.com/2101

http://codereview.appspot.com/924/diff/321/262
File third_party/sqlite_google/src/btree.c (right):

http://codereview.appspot.com/924/diff/321/262#newcode6432
Line 6432: int sqlite3_get_user_version(sqlite3 *sqlite, int *user_version) {
On 2008/06/04 17:48:56, Scott.Hess wrote:
> Did you copy 'sqlite3 *sqlite' from somewhere?  If not, suggest using 'sqlite3
> *db'.  At this level, db is a squishy concept, but I think that's the form
used
> in other code.  [Like I said, if you're copying it from elsewhere in the
SQLite
> codebase, then ignore me.]

Nope, that was all me. Changed to *db.

> 
> I'd usually expect user_version to be piUserVersion in SQLiteland, which I
> believe may be somewhere near Hungary.

Ah, yes, the Magyar notation, we meet again. Changed to piUserVersion and
iUserVersion, respectivelly.

http://codereview.appspot.com/924/diff/321/262#newcode6435
Line 6435: if( sqlite == NULL ) return SQLITE_ERROR;
On 2008/06/04 17:48:56, Scott.Hess wrote:
> SQLite style is 'sqlite==NULL' rather than 'sqlite == NULL'.  Yes, this is the
> opposite of Gears style :-).

Fixed.

http://codereview.appspot.com/924/diff/321/262#newcode6443
Line 6443: */
On 2008/06/04 17:48:56, Scott.Hess wrote:
> Suggest dropping the caveat about unlikely things.  It either needs a lock
going
> in, or it doesn't.

Done.

http://codereview.appspot.com/924/diff/321/262#newcode6444
Line 6444: return sqlite3BtreeGetMeta(bt, kUserCookie, (u32 *)user_version);
On 2008/06/04 17:48:56, Scott.Hess wrote:
> Why the cast?  Alternate phrasing: Why isn't user_verion just u32 from the
> get-go?
> 

That's easy to fix. I made user version unsigned int.

http://codereview.appspot.com/924/diff/321/262#newcode6447
Line 6447: int sqlite3_set_user_version(sqlite3 *sqlite, int user_version) {
On 2008/06/04 17:48:56, Scott.Hess wrote:
> Comparable comments to above on sqlite/db and user_version/iUserVersion.

Fixed.

http://codereview.appspot.com/924/diff/321/262#newcode6450
Line 6450: if( sqlite == NULL ) return SQLITE_ERROR;
On 2008/06/04 17:48:56, Scott.Hess wrote:
> No spaces around ==.

Done.

http://codereview.appspot.com/924/diff/321/262#newcode6456
Line 6456: if( bt->inTrans != TRANS_WRITE ) return SQLITE_MISUSE;
On 2008/06/04 17:48:56, Scott.Hess wrote:
> No spaces around !=.

Done.

http://codereview.appspot.com/924/diff/321/262#newcode6458
Line 6458: return sqlite3BtreeUpdateMeta(bt, kUserCookie, (u32)user_version);
On 2008/06/04 17:48:56, Scott.Hess wrote:
> Comparable comment as above around cast.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b