Use in-memory database for tests.
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Jan 2006, PHP 5.1.2
+- Updated libsqlite in ext/sqlite to 2.8.17. (Ilia)
- Updated to libxml2-2.6.22 and libxslt-1.1.15 in the win32 bundle. (Rob)
- Added new extensions: (Ilia, Wez)
. XMLWriter
sqliteSetString(&zFull, zRelative, (char*)0);
}else{
char zBuf[5000];
+ zBuf[0] = 0;
sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative,
(char*)0);
}
pPg = pager_lookup(pPager, pgno);
pPg->alwaysRollback = 1;
- if( pPg && pPg->dirty ){
+ if( pPg && pPg->dirty && !pPager->ckptInUse ){
if( pPager->dbSize==(int)pPg->pgno && pPager->origDbSize<pPager->dbSize ){
/* If this pages is the last page in the file and the file has grown
** during the current transaction, then do NOT mark the page as clean.
/*
** The version of the SQLite library.
*/
-#define SQLITE_VERSION "2.8.16"
+#define SQLITE_VERSION "2.8.17"
/*
** The version string is also compiled into the library so that a program
#endif
char *sqliteMPrintf(const char*, ...);
char *sqliteVMPrintf(const char*, va_list);
-void sqliteSetString(char **, const char *, ...);
+void sqliteSetString(char **, ...);
void sqliteSetNString(char **, ...);
void sqliteErrorMsg(Parse*, const char*, ...);
void sqliteDequote(char*);
** point to that string. The 1st argument must either be NULL or
** point to memory obtained from sqliteMalloc().
*/
-void sqliteSetString(char **pz, const char *zFirst, ...){
+void sqliteSetString(char **pz, ...){
va_list ap;
int nByte;
const char *z;
char *zResult;
if( pz==0 ) return;
- nByte = strlen(zFirst) + 1;
- va_start(ap, zFirst);
+ nByte = 1;
+ va_start(ap, pz);
while( (z = va_arg(ap, const char*))!=0 ){
nByte += strlen(z);
}
if( zResult==0 ){
return;
}
- strcpy(zResult, zFirst);
- zResult += strlen(zResult);
- va_start(ap, zFirst);
+ *zResult = 0;
+ va_start(ap, pz);
while( (z = va_arg(ap, const char*))!=0 ){
strcpy(zResult, z);
zResult += strlen(zResult);
<?php #vim:ft=php
-$dbname = tempnam(dirname(__FILE__), "phpsql");
-function cleanup() {
- $retry = 10;
-
- if (is_resource($GLOBALS['db'])) {
- @sqlite_close($GLOBALS['db']);
- }
- do {
- usleep(500000);
- if (@unlink($GLOBALS['dbname']))
- break;
- } while (file_exists($GLOBALS['dbname']) && --$retry);
-}
-register_shutdown_function("cleanup");
-$db = sqlite_open($dbname);
+$db = sqlite_open(":memory:");
?>
<?php #vim:ft=php
-$dbname = tempnam(dirname(__FILE__), "phpsql");
-function cleanup() {
- global $db, $dbname;
- $db = NULL;
- usleep(500000);
- @unlink($dbname);
-}
-register_shutdown_function("cleanup");
-$db = new SQLiteDatabase($dbname);
+$db = new SQLiteDatabase(":memory:");
?>