Ignore COLLATE operators when determining whether the result of a subexpression

should be shallow-copied or deep-copied.

FossilOrigin-Name: 34ae36a45e814bed7c8340412c7ef3fc849b82357656d0eb5f0f805e59d846d0
This commit is contained in:
drh 2023-12-19 13:45:05 +00:00
parent 9c36095367
commit 3e2ec83e0b
3 changed files with 11 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Test\scase\sfor\sthe\sprevious\scheck-in.
D 2023-12-19T13:00:35.897
C Ignore\sCOLLATE\soperators\swhen\sdetermining\swhether\sthe\sresult\sof\sa\ssubexpression\nshould\sbe\sshallow-copied\sor\sdeep-copied.
D 2023-12-19T13:45:05.259
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -686,7 +686,7 @@ F src/date.c 3b8d02977d160e128469de38493b4085f7c5cf4073193459909a6af3cf6d7c91
F src/dbpage.c 80e46e1df623ec40486da7a5086cb723b0275a6e2a7b01d9f9b5da0f04ba2782
F src/dbstat.c 3b677254d512fcafd4d0b341bf267b38b235ccfddbef24f9154e19360fa22e43
F src/delete.c cb766727c78e715f9fb7ec8a7d03658ed2a3016343ca687acfcec9083cdca500
F src/expr.c c21c6d1ba6e73b65ad7dd08336956c631b35a3c44935a8b4f26a766493642fa4
F src/expr.c 74c96889f705c83cb7f19d1dd25d937d28708ba079e9b0f8ee6440c7b272b228
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c a47610f0a5c6cb0ad79f8fcef039c01833dec0c751bb695f28dc0ec6a4c3ba00
F src/func.c 472f6dcfa39cf54f89a6aec76c79c225fb880a6c14469c15d361331662b9bf43
@ -2155,8 +2155,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 d2e6117e4f97ab98b01deb5fcad5520f8181d00bed8d904d34963c01d73df857
R 90dde9152d7c6b35edb0cb5f83423d69
P df5a07e1a5122e08c2fa6076ac08adb2820f997ee11dd88b84863666899dfb57
R 88cb52429199464661f76b121d4935cc
U drh
Z 69483924e6d2b900a24835137337ec8c
Z 118a5efad123e5c170192e2943b0be05
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
df5a07e1a5122e08c2fa6076ac08adb2820f997ee11dd88b84863666899dfb57
34ae36a45e814bed7c8340412c7ef3fc849b82357656d0eb5f0f805e59d846d0

View File

@ -5326,8 +5326,10 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr, int target){
inReg = sqlite3ExprCodeTarget(pParse, pExpr, target);
if( inReg!=target ){
u8 op;
if( ALWAYS(pExpr)
&& (ExprHasProperty(pExpr,EP_Subquery) || pExpr->op==TK_REGISTER)
Expr *pX = sqlite3ExprSkipCollateAndLikely(pExpr);
testcase( pX!=pExpr );
if( ALWAYS(pX)
&& (ExprHasProperty(pX,EP_Subquery) || pX->op==TK_REGISTER)
){
op = OP_Copy;
}else{