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

Futher pedantic fixes to the sqlite3_uri_boolean() interface.

FossilOrigin-Name: 77b3430de69e23ba3feda3d618fe4880dd465023
This commit is contained in:
drh
2012-01-31 14:24:47 +00:00
parent 0c7db64045
commit 38d9c612ed
5 changed files with 18 additions and 17 deletions

View File

@@ -46,8 +46,8 @@ static u8 getSafetyLevel(const char *z, int omitFull, int dflt){
/*
** Interpret the given string as a boolean value.
*/
u8 sqlite3GetBoolean(const char *z){
return getSafetyLevel(z,1,0)!=0;
u8 sqlite3GetBoolean(const char *z, int dflt){
return getSafetyLevel(z,1,dflt)!=0;
}
/* The sqlite3GetBoolean() function is used by other modules but the
@@ -221,7 +221,7 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
mask &= ~(SQLITE_ForeignKeys);
}
if( sqlite3GetBoolean(zRight) ){
if( sqlite3GetBoolean(zRight, 0) ){
db->flags |= mask;
}else{
db->flags &= ~mask;
@@ -437,7 +437,7 @@ void sqlite3Pragma(
int b = -1;
assert( pBt!=0 );
if( zRight ){
b = sqlite3GetBoolean(zRight);
b = sqlite3GetBoolean(zRight, 0);
}
if( pId2->n==0 && b>=0 ){
int ii;
@@ -1041,7 +1041,7 @@ void sqlite3Pragma(
#ifndef NDEBUG
if( sqlite3StrICmp(zLeft, "parser_trace")==0 ){
if( zRight ){
if( sqlite3GetBoolean(zRight) ){
if( sqlite3GetBoolean(zRight, 0) ){
sqlite3ParserTrace(stderr, "parser: ");
}else{
sqlite3ParserTrace(0, 0);
@@ -1055,7 +1055,7 @@ void sqlite3Pragma(
*/
if( sqlite3StrICmp(zLeft, "case_sensitive_like")==0 ){
if( zRight ){
sqlite3RegisterLikeFunctions(db, sqlite3GetBoolean(zRight));
sqlite3RegisterLikeFunctions(db, sqlite3GetBoolean(zRight, 0));
}
}else