Fix a problem in the sqlite3ExprCompare() function that caused two

dissimilar expressions to match if they have the same "COLLATE name" at
the outer layer.

FossilOrigin-Name: fb16348a5bd52752098c9aeacc3281c4e1e8eb5a868d131ea6c3271dc4226b40
This commit is contained in:
drh 2018-04-18 17:52:28 +00:00
parent 6651e10ee7
commit e79f629985
3 changed files with 8 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Add\ssupport\sfor\sPostgreSQL\sUPSERT\ssyntax\sand\sfunctionality.
D 2018-04-18T16:03:36.712
C Fix\sa\sproblem\sin\sthe\ssqlite3ExprCompare()\sfunction\sthat\scaused\stwo\ndissimilar\sexpressions\sto\smatch\sif\sthey\shave\sthe\ssame\s"COLLATE\sname"\sat\nthe\souter\slayer.
D 2018-04-18T17:52:28.271
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in 5ce9343cba9c189046f1afe6d2bcc1f68079439febc05267b98aec6ecc752439
@ -443,7 +443,7 @@ F src/date.c ebe1dc7c8a347117bb02570f1a931c62dd78f4a2b1b516f4837d45b7d6426957
F src/dbpage.c 8db4c97f630e7d83f884ea75caf1ffd0988c160e9d530194d93721c80821e0f6
F src/dbstat.c edabb82611143727511a45ca0859b8cd037851ebe756ae3db289859dd18b6f91
F src/delete.c 20c8788451dc737a967c87ea53ad43544d617f5b57d32ccce8bd52a0daf9e89b
F src/expr.c e27dfc8fd55b7df98ade7341da66bacb1de98589cbf5a0de7dcaa708d41769bc
F src/expr.c 7c08754d68897488cf4d916d15680f7d8ef6ea3c7fd32a9c7d739b0b4dda9cf7
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c d617daf66b5515e2b42c1405b2b4984c30ca50fb705ab164271a9bf66c69e331
F src/func.c 94f42cba2cc1c34aeaa441022ba0170ec3fec4bba54db4e0ded085c6dc0fdc51
@ -1722,8 +1722,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 594ebc69557095c9262db39129dd50a3dbf038556a3d2a3ea69b82ed4c61e2b9 32956519173ee49ec9dd9aa7952278eb4effe567493c6cb304e16f887df6bafa
R a0a65e03dc88603b3bbcbe2ed2843e2a
T +closed 32956519173ee49ec9dd9aa7952278eb4effe567493c6cb304e16f887df6bafa
P fba24aec235dd6f124c1ece66cdac485c9d96e0578c4fbacd8f49d7b767a5b4a
R 30a97c4d09d6fc30a117693d1fff8a6c
U drh
Z 3650955ecafd6ccd6c1e29803e683fbf
Z b4241c44da2068f85d9b7d3cc18d532b

View File

@ -1 +1 @@
fba24aec235dd6f124c1ece66cdac485c9d96e0578c4fbacd8f49d7b767a5b4a
fb16348a5bd52752098c9aeacc3281c4e1e8eb5a868d131ea6c3271dc4226b40

View File

@ -4902,7 +4902,7 @@ int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTab){
if( pA->op==TK_FUNCTION ){
if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
}else if( pA->op==TK_COLLATE ){
return sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ? 2 : 0;
if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
}else if( strcmp(pA->u.zToken,pB->u.zToken)!=0 ){
return 2;
}