/ Check-in [e0a88176]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Silently ignore requests to change the PRAGMA synchronous setting to an illegal integer value, rather than raising an assertion.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e0a88176fcfbed7b554a036948261a332c920053
User & Date: drh 2015-04-16 16:04:39
Context
2015-04-16
16:22
Fix a faulty assert() in the compound-SELECT code generator. check-in: 10715b05 user: drh tags: trunk
16:04
Silently ignore requests to change the PRAGMA synchronous setting to an illegal integer value, rather than raising an assertion. check-in: e0a88176 user: drh tags: trunk
15:47
Make sure errors in coding triggers are propagated back up to the parser. check-in: 928f973c user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pragma.c.

942
943
944
945
946
947
948

949

950
951
952
953
954
955
956
    if( !zRight ){
      returnSingleInt(pParse, "synchronous", pDb->safety_level-1);
    }else{
      if( !db->autoCommit ){
        sqlite3ErrorMsg(pParse, 
            "Safety level may not be changed inside a transaction");
      }else{

        pDb->safety_level = getSafetyLevel(zRight,0,1)+1;

        setAllPagerFlags(db);
      }
    }
    break;
  }
#endif /* SQLITE_OMIT_PAGER_PRAGMAS */








>
|
>







942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
    if( !zRight ){
      returnSingleInt(pParse, "synchronous", pDb->safety_level-1);
    }else{
      if( !db->autoCommit ){
        sqlite3ErrorMsg(pParse, 
            "Safety level may not be changed inside a transaction");
      }else{
        testcase( (getSafetyLevel(zRight,0,1)+1) & ~PAGER_SYNCHRONOUS_MASK );
        pDb->safety_level = (getSafetyLevel(zRight,0,1)+1)
                                & PAGER_SYNCHRONOUS_MASK;
        setAllPagerFlags(db);
      }
    }
    break;
  }
#endif /* SQLITE_OMIT_PAGER_PRAGMAS */

Changes to test/pragma.test.

214
215
216
217
218
219
220












221
222
223
224
225
226
227
  }
} {0}
do_test pragma-1.14 {
  execsql {
    PRAGMA synchronous=2;
    PRAGMA synchronous;
  }












} {2}
} ;# ifcapable pager_pragmas

# Test turning "flag" pragmas on and off.
#
ifcapable debug {
  # Pragma "vdbe_listing" is only available if compiled with SQLITE_DEBUG







>
>
>
>
>
>
>
>
>
>
>
>







214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
  }
} {0}
do_test pragma-1.14 {
  execsql {
    PRAGMA synchronous=2;
    PRAGMA synchronous;
  }
} {2}
do_test pragma-1.14.1 {
  execsql {
    PRAGMA synchronous=4;
    PRAGMA synchronous;
  }
} {0}
do_test pragma-1.14.2 {
  execsql {
    PRAGMA synchronous=10;
    PRAGMA synchronous;
  }
} {2}
} ;# ifcapable pager_pragmas

# Test turning "flag" pragmas on and off.
#
ifcapable debug {
  # Pragma "vdbe_listing" is only available if compiled with SQLITE_DEBUG