Update the tracing output for the query-invariant checker such that it shows

the SQL that is run to verify that a found query-invariant discrepency is
valid.  Changes to testing logic only.

FossilOrigin-Name: 8f45ad27403e971d88ec62e674c03f82eb19df0b43aa58d20b3400cdb6611d90
This commit is contained in:
drh 2023-03-16 11:50:44 +00:00
parent 7d5a549121
commit db8c6aa03a
3 changed files with 29 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Do\snot\suse\sthe\sone-pass\soptimization\son\san\sUPDATE\sif\sthere\sis\sa\ssubquery\nin\sthe\sWHERE\sclause,\ssince\sif\sthe\ssubquery\sis\shidden\sbehind\sa\sshort-circuit\noperator,\sthe\ssubquery\smight\snot\sbe\sevaluated\suntil\safter\sone\sor\smore\srows\nhave\sbeen\supdated.\s\sFix\sfor\sthe\sproblem\sreported\sby\n[forum:/forumpost/0007d1fdb1|forum\spost\s0007d1fdb1].\s\sThis\sis\sthe\ssame\nproblem\sthat\swas\sfixed\sby\s[73f0036f045bf371]\sonly\sfor\sUPDATE\sinstead\sof\nDELETE.
D 2023-03-16T10:17:30.566
C Update\sthe\stracing\soutput\sfor\sthe\squery-invariant\schecker\ssuch\sthat\sit\sshows\nthe\sSQL\sthat\sis\srun\sto\sverify\sthat\sa\sfound\squery-invariant\sdiscrepency\sis\nvalid.\s\sChanges\sto\stesting\slogic\sonly.
D 2023-03-16T11:50:44.645
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -1154,7 +1154,7 @@ F test/fuzzdata8.db f6c2f2af4deaaae0ddb3310d509c2659990794aa653dc501b80a0534c349
F test/fuzzer1.test 3d4c4b7e547aba5e5511a2991e3e3d07166cfbb8
F test/fuzzer2.test a85ef814ce071293bce1ad8dffa217cbbaad4c14
F test/fuzzerfault.test f64c4aef4c9e9edf1d6dc0d3f1e65dcc81e67c996403c88d14f09b74807a42bc
F test/fuzzinvariants.c 3ec82ac4277a0c62918f39e7a35893d6fb5ed57c465a938ad18e8e7a69527615
F test/fuzzinvariants.c cc9291de9be93207442561ec9a0c07d2c236389c47c4965a6f90bc0fbf4ab6bd
F test/gcfault.test dd28c228a38976d6336a3fc42d7e5f1ad060cb8c
F test/gencol1.test aef8b0670abd4b1ae4cae786b15a43758d86f6cd9f12b381d45d96bb51e597c9
F test/genesis.tcl 1e2e2e8e5cc4058549a154ff1892fe5c9de19f98
@ -2050,8 +2050,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 1dffeffe150fff6777cf26bc960326ca4e4190d25d05bb066b082d1e1c8eb374
R 5410b321a0481083a3d313d81510e3fc
P 2c56b984a0bd3be5ec326a2109ea7b8f1d4ef63c8fc325caac9663cf2479eaff
R b0e423029bdbdf0c07b87c0b38c5e2f1
U drh
Z eea9af84fd6b98bd366cd12ed13a97d2
Z cc7b3cfd55b0f4c7215af58b26a1c7fb
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
2c56b984a0bd3be5ec326a2109ea7b8f1d4ef63c8fc325caac9663cf2479eaff
8f45ad27403e971d88ec62e674c03f82eb19df0b43aa58d20b3400cdb6611d90

View File

@ -126,6 +126,12 @@ int fuzz_invariant(
sqlite3_finalize(pTestStmt);
return rc;
}
if( eVerbosity>=2 ){
char *zSql = sqlite3_expanded_sql(pCk);
printf("invariant-validity-check #1:\n%s\n", zSql);
sqlite3_free(zSql);
}
rc = sqlite3_step(pCk);
if( rc!=SQLITE_ROW
|| sqlite3_column_text(pCk, 0)==0
@ -146,6 +152,11 @@ int fuzz_invariant(
sqlite3_db_config(db, SQLITE_DBCONFIG_REVERSE_SCANORDER, !iOrigRSO, 0);
sqlite3_prepare_v2(db, sqlite3_sql(pStmt), -1, &pCk, 0);
sqlite3_db_config(db, SQLITE_DBCONFIG_REVERSE_SCANORDER, iOrigRSO, 0);
if( eVerbosity>=2 ){
char *zSql = sqlite3_expanded_sql(pCk);
printf("invariant-validity-check #2:\n%s\n", zSql);
sqlite3_free(zSql);
}
while( (rc = sqlite3_step(pCk))==SQLITE_ROW ){
for(i=0; i<nCol; i++){
if( !sameValue(pStmt, i, pTestStmt, i, 0) ) break;
@ -167,6 +178,12 @@ int fuzz_invariant(
"SELECT ?1=?2 OR ?1=?2 COLLATE nocase OR ?1=?2 COLLATE rtrim",
-1, &pCk, 0);
if( rc==SQLITE_OK ){
if( eVerbosity>=2 ){
char *zSql = sqlite3_expanded_sql(pCk);
printf("invariant-validity-check #3:\n%s\n", zSql);
sqlite3_free(zSql);
}
sqlite3_reset(pTestStmt);
while( (rc = sqlite3_step(pTestStmt))==SQLITE_ROW ){
for(i=0; i<nCol; i++){
@ -185,6 +202,11 @@ int fuzz_invariant(
rc = sqlite3_prepare_v2(db,
"SELECT 1 FROM bytecode(?1) WHERE opcode='VOpen'", -1, &pCk, 0);
if( rc==SQLITE_OK ){
if( eVerbosity>=2 ){
char *zSql = sqlite3_expanded_sql(pCk);
printf("invariant-validity-check #4:\n%s\n", zSql);
sqlite3_free(zSql);
}
sqlite3_bind_pointer(pCk, 1, pStmt, "stmt-pointer", 0);
rc = sqlite3_step(pCk);
}