Closed Bug 386179 Opened 16 years ago Closed 15 years ago

Stop using private sqlite functions

Categories

(Toolkit :: Storage, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.9alpha8

People

(Reporter: sdwilsh, Assigned: sdwilsh)

References

Details

Attachments

(2 files)

We currently use two sqlite functions that are not part of their normal api:
sqlite3ApiExit
sqlite3_os_switch

In order to upgrade to newer versions, we need to stop using these.  If Bug 306907 lands before this, we'll also have to stop exporting them in the def file being added by that bug.
Flags: blocking1.9?
OK, for sqlite3ApiExit, it seems like they call it in all their functions as they should, so it should be safe for us to remove it.  I'm not 100% sure on this though since their test_async.c still uses this upon errors.  Based on the documentation in sqlite3.c though, I don't think we need it.  Someone else looking at this would be greatly appreciated.

As for sqlite3_os_switch, I think the in code documentation says it best:
#ifdef SQLITE_ENABLE_REDEF_IO
/*
** A function to return a pointer to the virtual function table.
** This routine really does not accomplish very much since the
** virtual function table is a global variable and anybody who
** can call this function can just as easily access the variable
** for themselves.  Nevertheless, we include this routine for
** backwards compatibility with an earlier redefinable I/O
** interface design.
*/
struct sqlite3OsVtbl *sqlite3_os_switch(void){
  return &sqlite3Os;
}
#endif

I think I'll play around with some of this and see if I can't get a patch.
One step at a time.  Simple fix for this one that I am confident about :)
Assignee: nobody → sdwilsh
Status: NEW → ASSIGNED
Attachment #270218 - Flags: review?(sspitzer)
Comment on attachment 270218 [details] [diff] [review]
Remove sqlite3_os_switch v1.0 (checked in)

r=sspitzer
Attachment #270218 - Flags: review?(sspitzer) → review+
Comment on attachment 270218 [details] [diff] [review]
Remove sqlite3_os_switch v1.0 (checked in)

Checking in storage/src/mozStorageAsyncIO.cpp;
new revision: 1.18; previous revision: 1.17
Checking in db/sqlite3/src/sqlite3file.h;
new revision: 1.6; previous revision: 1.5
Attachment #270218 - Attachment description: Remove sqlite3_os_switch v1.0 → Remove sqlite3_os_switch v1.0 (checked in)
Attachment #273655 - Flags: review?(sdwilsh)
Comment on attachment 273655 [details] [diff] [review]
Stop using sqlite3ApiExit

r=sdwilsh

We discussed this earlier, and this is perfectly safe for us to do.
Attachment #273655 - Flags: review?(sdwilsh) → review+
Checking in db/sqlite3/src/sqlite.def;
/cvsroot/mozilla/db/sqlite3/src/sqlite.def,v  <--  sqlite.def
new revision: 1.2; previous revision: 1.1
done
Checking in db/sqlite3/src/sqlite3file.h;
/cvsroot/mozilla/db/sqlite3/src/sqlite3file.h,v  <--  sqlite3file.h
new revision: 1.10; previous revision: 1.9
done
Checking in storage/src/mozStorageAsyncIO.cpp;
/cvsroot/mozilla/storage/src/mozStorageAsyncIO.cpp,v  <--  mozStorageAsyncIO.cpp
new revision: 1.20; previous revision: 1.19
done
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
Flags: blocking1.9?
You need to log in before you can comment on or make changes to this bug.