(Applies to SQLITE 3.7.15.2 (but v3.7.17.0 uses the same code))

Pager bug(?):

Following code excerpt from sqlite3.c should crash if pPage==NULL &&
createFlag==0:

static sqlite3_pcache_page *pcache1Fetch(
  sqlite3_pcache *p,
  unsigned int iKey,
  int createFlag
){
{
  ...
  if( pPage || createFlag==0 ){
    pcache1PinPage(pPage);
    goto fetch_out;
  }
  ...

fetch_out:
  ...
  return &pPage->page;
}

Note:
The funny thing is that when I debugged (VS 2010) the return statement for
pPage=NULL, there was no crash and the routine returned NULL value to the
caller.
In other words a correct return instead of crash. (Probably due to page
structure definition, where the member page is located at the offset 0.)

-----------------------------------

2nd problem:
#ifdef SQLITE_LOG_CACHE_SPILL
  // this code refers sqlite3GlobalConfig.pcache
  // instead of sqlite3GlobalConfig.pcache2

#endif


-----------------------------------

A suggestion:

sqlite3_status(SQLITE_STATUS_PAGECACHE_OVERFLOW...) ... reported by sqlite3
shell as "Number of Pcache Overflow Bytes".

I find the term "overflow" highly confusing in this context as this number
normally refers to the standard memory allocated by the page cache. (2000
pages by default.)

Please, consider using less confusing wording at least in sqlite shell.

Best regards,
    Jan Slodicka


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to