1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Improved extended comments of comparison operators when the SQLITE_STOREP2

flags is set on P5.  No changes to non-debug code.

FossilOrigin-Name: bbc1b016164ed0793e07302614384d52119463e0
This commit is contained in:
drh
2016-08-24 21:24:04 +00:00
parent 62659b2a80
commit 72e26dec86
4 changed files with 46 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
C In\ssqlite3FindInIndex(),\simprove\sinternal\scomments\sand\savoid\san\nunreachable\sbranch. C Improved\sextended\scomments\sof\scomparison\soperators\swhen\sthe\sSQLITE_STOREP2\nflags\sis\sset\son\sP5.\s\sNo\schanges\sto\snon-debug\scode.
D 2016-08-24T18:51:23.484 D 2016-08-24T21:24:04.787
F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088 F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a
@@ -450,11 +450,11 @@ F src/update.c 8179e699dbd45b92934fd02d3d8e3732e8da8802
F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
F src/util.c 810ec3f22e2d1b62e66c30fe3621ebdedd23584d F src/util.c 810ec3f22e2d1b62e66c30fe3621ebdedd23584d
F src/vacuum.c 913970b9d86dd6c2b8063ef1af421880f1464ec3 F src/vacuum.c 913970b9d86dd6c2b8063ef1af421880f1464ec3
F src/vdbe.c 766d363ef6520c671eef165098a24c0c6ef36d89 F src/vdbe.c 68d56c11d5c5e704dde6d2d8748750a2f6352a09
F src/vdbe.h 67bc551f7faf04c33493892e4b378aada823ed10 F src/vdbe.h 67bc551f7faf04c33493892e4b378aada823ed10
F src/vdbeInt.h c59381049af5c7751a83456c39b80d1a6fde1f9d F src/vdbeInt.h c59381049af5c7751a83456c39b80d1a6fde1f9d
F src/vdbeapi.c a32d61b7dd05e6890d8fd44d2805f55e2f5ba9f3 F src/vdbeapi.c a32d61b7dd05e6890d8fd44d2805f55e2f5ba9f3
F src/vdbeaux.c a32d79aeaa88dc2b97c261172d952d395254a055 F src/vdbeaux.c 83458783d241cfd6691141c8a105832ee50258e5
F src/vdbeblob.c 3e82a797b60c3b9fed7b8de8c539ca7607874937 F src/vdbeblob.c 3e82a797b60c3b9fed7b8de8c539ca7607874937
F src/vdbemem.c e67dc6d8177fd1830efb5d15e17793408251a187 F src/vdbemem.c e67dc6d8177fd1830efb5d15e17793408251a187
F src/vdbesort.c 91fda3909326860382b0ca8aa251e609c6a9d62c F src/vdbesort.c 91fda3909326860382b0ca8aa251e609c6a9d62c
@@ -1520,7 +1520,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 6099c180db55396d6307538a5428ae5ef1b82d10 P 55945fc12f8157e32e6850e41575c0c6422d29e7
R fa8e14e08c5acfaa4521c63ce095c576 R d8287dc165c2512db536a01f0275f112
U drh U drh
Z 500a8a58193db1f42f4b49dd37f14aa8 Z f51d93eb7238381398d31778d751851b

View File

@@ -1 +1 @@
55945fc12f8157e32e6850e41575c0c6422d29e7 bbc1b016164ed0793e07302614384d52119463e0

View File

@@ -1881,7 +1881,7 @@ case OP_Cast: { /* in1 */
#endif /* SQLITE_OMIT_CAST */ #endif /* SQLITE_OMIT_CAST */
/* Opcode: Eq P1 P2 P3 P4 P5 /* Opcode: Eq P1 P2 P3 P4 P5
** Synopsis: if r[P1]==r[P3] goto P2 ** Synopsis: IF r[P1]==r[P3]
** **
** Compare the values in register P1 and P3. If reg(P3)==reg(P1) then ** Compare the values in register P1 and P3. If reg(P3)==reg(P1) then
** jump to address P2. Or if the SQLITE_STOREP2 flag is set in P5, then ** jump to address P2. Or if the SQLITE_STOREP2 flag is set in P5, then
@@ -1915,7 +1915,7 @@ case OP_Cast: { /* in1 */
** content of r[P2] is only set to 1 (true) if it was not previously NULL. ** content of r[P2] is only set to 1 (true) if it was not previously NULL.
*/ */
/* Opcode: Ne P1 P2 P3 P4 P5 /* Opcode: Ne P1 P2 P3 P4 P5
** Synopsis: if r[P1]!=r[P3] goto P2 ** Synopsis: IF r[P1]!=r[P3]
** **
** This works just like the Eq opcode except that the jump is taken if ** This works just like the Eq opcode except that the jump is taken if
** the operands in registers P1 and P3 are not equal. See the Eq opcode for ** the operands in registers P1 and P3 are not equal. See the Eq opcode for
@@ -1925,7 +1925,7 @@ case OP_Cast: { /* in1 */
** content of r[P2] is only set to 0 (false) if it was not previously NULL. ** content of r[P2] is only set to 0 (false) if it was not previously NULL.
*/ */
/* Opcode: Lt P1 P2 P3 P4 P5 /* Opcode: Lt P1 P2 P3 P4 P5
** Synopsis: if r[P1]<r[P3] goto P2 ** Synopsis: IF r[P1]<r[P3]
** **
** Compare the values in register P1 and P3. If reg(P3)<reg(P1) then ** Compare the values in register P1 and P3. If reg(P3)<reg(P1) then
** jump to address P2. Or if the SQLITE_STOREP2 flag is set in P5 store ** jump to address P2. Or if the SQLITE_STOREP2 flag is set in P5 store
@@ -1954,21 +1954,21 @@ case OP_Cast: { /* in1 */
** strings and strings are considered less than blobs. ** strings and strings are considered less than blobs.
*/ */
/* Opcode: Le P1 P2 P3 P4 P5 /* Opcode: Le P1 P2 P3 P4 P5
** Synopsis: if r[P1]<=r[P3] goto P2 ** Synopsis: IF r[P1]<=r[P3]
** **
** This works just like the Lt opcode except that the jump is taken if ** This works just like the Lt opcode except that the jump is taken if
** the content of register P3 is less than or equal to the content of ** the content of register P3 is less than or equal to the content of
** register P1. See the Lt opcode for additional information. ** register P1. See the Lt opcode for additional information.
*/ */
/* Opcode: Gt P1 P2 P3 P4 P5 /* Opcode: Gt P1 P2 P3 P4 P5
** Synopsis: if r[P1]>r[P3] goto P2 ** Synopsis: IF r[P1]>r[P3]
** **
** This works just like the Lt opcode except that the jump is taken if ** This works just like the Lt opcode except that the jump is taken if
** the content of register P3 is greater than the content of ** the content of register P3 is greater than the content of
** register P1. See the Lt opcode for additional information. ** register P1. See the Lt opcode for additional information.
*/ */
/* Opcode: Ge P1 P2 P3 P4 P5 /* Opcode: Ge P1 P2 P3 P4 P5
** Synopsis: if r[P1]>=r[P3] goto P2 ** Synopsis: IF r[P1]>=r[P3]
** **
** This works just like the Lt opcode except that the jump is taken if ** This works just like the Lt opcode except that the jump is taken if
** the content of register P3 is greater than or equal to the content of ** the content of register P3 is greater than or equal to the content of

View File

@@ -1094,12 +1094,21 @@ static int displayComment(
const char *zSynopsis; const char *zSynopsis;
int nOpName; int nOpName;
int ii, jj; int ii, jj;
char zAlt[50];
zOpName = sqlite3OpcodeName(pOp->opcode); zOpName = sqlite3OpcodeName(pOp->opcode);
nOpName = sqlite3Strlen30(zOpName); nOpName = sqlite3Strlen30(zOpName);
if( zOpName[nOpName+1] ){ if( zOpName[nOpName+1] ){
int seenCom = 0; int seenCom = 0;
char c; char c;
zSynopsis = zOpName += nOpName + 1; zSynopsis = zOpName += nOpName + 1;
if( strncmp(zSynopsis,"IF ",3)==0 ){
if( pOp->p5 & SQLITE_STOREP2 ){
sqlite3_snprintf(sizeof(zAlt), zAlt, "r[P2] = (%s)", zSynopsis+3);
}else{
sqlite3_snprintf(sizeof(zAlt), zAlt, "if %s goto P2", zSynopsis+3);
}
zSynopsis = zAlt;
}
for(ii=jj=0; jj<nTemp-1 && (c = zSynopsis[ii])!=0; ii++){ for(ii=jj=0; jj<nTemp-1 && (c = zSynopsis[ii])!=0; ii++){
if( c=='P' ){ if( c=='P' ){
c = zSynopsis[++ii]; c = zSynopsis[++ii];