/ Check-in [824328f9]
Login

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

Overview
Comment:Enhance the command-line shell with the ability to set the SQLITE_TESTCTRL_NEVER_CORRUPT flag using: ".testctrl never_corrupt 1".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 824328f9833d01fc155a9d0265ef41d338cf1ffb
User & Date: drh 2015-01-19 15:05:54
Context
2015-01-19
20:05
Fix compilation on Cygwin when SQLITE_MAX_WORKER_THREADS is greater than zero. check-in: 2037442c user: mistachkin tags: trunk
19:48
An alternative way of implementing the assert() that verifies the relative values of KeyInfo.nField+KeyInfo.nXField and the number of columns in a record. This version of the assert() only fires when the high-speed comparison routines are used - which is to say it only fires when the constraint actually matters. check-in: bf744b49 user: drh tags: tkt-f97c4637
19:21
An alternative way of fixing the key comparison bug of ticket [f97c4637102a3ae72b]. Closed-Leaf check-in: e41376cf user: drh tags: alt1-tkt-f97c4637
17:28
Add an assert() to verify that the nField+nXField values of a KeyInfo object are never less then the number of columns in a row for a non-corrupt database. This assert() currently fails, which is the root of the problem with ticket [f97c4637102a3ae72b]. check-in: 083f523d user: drh tags: tkt-f97c4637
15:05
Enhance the command-line shell with the ability to set the SQLITE_TESTCTRL_NEVER_CORRUPT flag using: ".testctrl never_corrupt 1". check-in: 824328f9 user: drh tags: trunk
00:35
Eliminate all use of sprintf(), strcpy() and strcat() from test logic because OpenBSD hates those functions. check-in: 10321910 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  3531   3531         { "assert",                SQLITE_TESTCTRL_ASSERT                 },
  3532   3532         { "always",                SQLITE_TESTCTRL_ALWAYS                 },
  3533   3533         { "reserve",               SQLITE_TESTCTRL_RESERVE                },
  3534   3534         { "optimizations",         SQLITE_TESTCTRL_OPTIMIZATIONS          },
  3535   3535         { "iskeyword",             SQLITE_TESTCTRL_ISKEYWORD              },
  3536   3536         { "scratchmalloc",         SQLITE_TESTCTRL_SCRATCHMALLOC          },
  3537   3537         { "byteorder",             SQLITE_TESTCTRL_BYTEORDER              },
         3538  +      { "never_corrupt",         SQLITE_TESTCTRL_NEVER_CORRUPT          },
  3538   3539       };
  3539   3540       int testctrl = -1;
  3540   3541       int rc = 0;
  3541   3542       int i, n;
  3542   3543       open_db(p, 0);
  3543   3544   
  3544   3545       /* convert testctrl text option to value. allow any unique prefix
................................................................................
  3597   3598               fprintf(stderr,"Error: testctrl %s takes a single unsigned"
  3598   3599                              " int option\n", azArg[1]);
  3599   3600             }
  3600   3601             break;
  3601   3602             
  3602   3603           /* sqlite3_test_control(int, int) */
  3603   3604           case SQLITE_TESTCTRL_ASSERT:              
  3604         -        case SQLITE_TESTCTRL_ALWAYS:              
         3605  +        case SQLITE_TESTCTRL_ALWAYS:      
         3606  +        case SQLITE_TESTCTRL_NEVER_CORRUPT:        
  3605   3607             if( nArg==3 ){
  3606   3608               int opt = booleanValue(azArg[2]);        
  3607   3609               rc = sqlite3_test_control(testctrl, opt);
  3608   3610               fprintf(p->out, "%d (0x%08x)\n", rc, rc);
  3609   3611             } else {
  3610   3612               fprintf(stderr,"Error: testctrl %s takes a single int option\n",
  3611   3613                               azArg[1]);