Make a copy of the expression that defines a value of a generated column

before sending it to the code generator routines.

FossilOrigin-Name: 03d201c041c17579e791c73fe6babd60b9f892a84ffd1470851f8eb2857d3990
This commit is contained in:
drh 2020-03-10 13:35:04 +00:00
parent 0c76e892d9
commit 24e399038b
3 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Apply\sthe\scorrect\saffinity\stransformations\swhen\spulling\svalues\soff\sof\sthe\nsorter\sindex\sused\sfor\sGROUP\sBY.\s\sTicket\s[e0c2ad1aa8a9c691]
D 2020-03-10T11:50:43.810
C Make\sa\scopy\sof\sthe\sexpression\sthat\sdefines\sa\svalue\sof\sa\sgenerated\scolumn\nbefore\ssending\sit\sto\sthe\scode\sgenerator\sroutines.
D 2020-03-10T13:35:04.074
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -483,7 +483,7 @@ F src/date.c 6c408fdd2e9ddf6e8431aba76315a2d061bea2cec8fbb75e25d7c1ba08274712
F src/dbpage.c 8a01e865bf8bc6d7b1844b4314443a6436c07c3efe1d488ed89e81719047833a
F src/dbstat.c 0f55297469d4244ab7df395849e1af98eb5e95816af7c661e7d2d8402dea23da
F src/delete.c 11000121c4281c0bce4e41db29addfaea0038eaa127ece02557c9207bc3e541d
F src/expr.c 92fa379dabdb55e45811c7650a2337af91035a44ecec32b0fbc5c6682d68f575
F src/expr.c 6454893aab3ed99aff11d36a22735a83225759e85ca781b9568f4f620f958b10
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c 4b575423b0a5d4898b1a7868ce985cf1a8ad91c741c9abbb108ff02536d20f41
F src/func.c 108577cebe8a50c86d849a93b99493a54e348dd0b846f00d13b52ca973d5baf4
@ -1860,7 +1860,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 a2d6f108c5d07559b125823a04c9cb072c80be80d7913097891a6192c7e1e225
R 3dd418ad329a8afd1cad637d51a1b1fd
P 101f7dea75a203f1f3aa422a607ef701eb0901ba4d5e8d1075cd350454a61956
R 4992fbbdcecc97b906ef590b9997e218
U drh
Z 43126d534c48a0ddd9165f34c835e3bc
Z 2bc45efe28100ac60ec8a2886907a19f

View File

@ -1 +1 @@
101f7dea75a203f1f3aa422a607ef701eb0901ba4d5e8d1075cd350454a61956
03d201c041c17579e791c73fe6babd60b9f892a84ffd1470851f8eb2857d3990

View File

@ -3497,7 +3497,7 @@ void sqlite3ExprCodeGeneratedColumn(
}else{
iAddr = 0;
}
sqlite3ExprCode(pParse, pCol->pDflt, regOut);
sqlite3ExprCodeCopy(pParse, pCol->pDflt, regOut);
if( pCol->affinity>=SQLITE_AFF_TEXT ){
sqlite3VdbeAddOp4(v, OP_Affinity, regOut, 1, 0, &pCol->affinity, 1);
}