1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Ensure temp db is open before executing a pragma like "temp.cachesize = xxx". Fix for #1682. (CVS 3104)

FossilOrigin-Name: 1e4644b2369547da65fcaa9a3c8ddd206a3c82ae
This commit is contained in:
danielk1977
2006-02-17 12:25:14 +00:00
parent 7d9bd4e19e
commit ddfb2f036a
6 changed files with 54 additions and 16 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the PRAGMA command.
**
** $Id: pragma.c,v 1.118 2006/02/11 01:25:51 drh Exp $
** $Id: pragma.c,v 1.119 2006/02/17 12:25:16 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -227,6 +227,13 @@ void sqlite3Pragma(
if( iDb<0 ) return;
pDb = &db->aDb[iDb];
/* If the temp database has been explicitly named as part of the
** pragma, make sure it is open.
*/
if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){
return;
}
zLeft = sqlite3NameFromToken(pId);
if( !zLeft ) return;
if( minusFlag ){
@@ -948,10 +955,12 @@ void sqlite3Pragma(
** Reset the safety level, in case the fullfsync flag or synchronous
** setting changed.
*/
#ifndef SQLITE_OMIT_PAGER_PRAGMAS
if( db->autoCommit ){
sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level,
(db->flags&SQLITE_FullFSync)!=0);
}
#endif
}
pragma_out:
sqliteFree(zLeft);