From b3ebf3043faaf96f0042dc0bce1876efc81c52ad Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 14 Apr 2022 19:48:32 +0000 Subject: [PATCH 1/4] Cherry pick subroutine indentation improvements and the hardening of OP_Gosub from the right-join branch back into trunk. FossilOrigin-Name: 12645f100d902690630a2925674aedbb01d41a53426a26a2f56de5b8fdec955f --- manifest | 17 ++++++++++------- manifest.uuid | 2 +- src/expr.c | 8 ++++---- src/vdbe.c | 14 +++++++------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index 85b801ffe8..917b78da94 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\san\sassert()\sin\sbtree.c\sthat\smight\snot\sbe\strue\sfor\sa\scorrupt\sdatabase\sfile. -D 2022-04-13T10:49:50.291 +C Cherry\spick\ssubroutine\sindentation\simprovements\sand\sthe\shardening\sof\nOP_Gosub\sfrom\sthe\sright-join\sbranch\sback\sinto\strunk. +D 2022-04-14T19:48:32.540 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -503,7 +503,7 @@ F src/date.c 15082566229d4b1e5f24fdb490bf9bcc68824b911d70e3573ef075a1b9e2d26f F src/dbpage.c 90661a87e1db8bfbc8d2ebbdcd3749651ddb287c555c07a28fb17c7c591ffb68 F src/dbstat.c 861e08690fcb0f2ee1165eff0060ea8d4f3e2ea10f80dab7d32ad70443a6ff2d F src/delete.c a8e844af211a48b13b5b358be77a12c860c6a557c21990ad51a548e2536500ce -F src/expr.c 5e247a8dfabb92e9fd10b78a675dc5d25430433dfd9e316471b4447b548635ba +F src/expr.c 38a25dcba22bc6c9d8614e64624497aab1762911ba88e81fc55f1e67a85ebc16 F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007 F src/fkey.c 94927f9b46d72a9cb858c208febf04ceb0a3270c5fa5fd0b7f436cf16e09f72a F src/func.c a3407a6fbb0d4088d8d502e46f0ace63e0aeae7467ae23a9ca9815bbf9239761 @@ -624,7 +624,7 @@ F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 F src/util.c 602fe229f32a96ceccae4f40824129669582096f7c355f53dbac156c9fecef23 F src/vacuum.c 6c38ddc52f0619865c91dae9c441d4d48bf3040d7dc1bc5b22da1e45547ed0b3 -F src/vdbe.c eefc5a96938cc113a95e36a42b626bf594a7f0b8bb56ae299accbbf015b973cd +F src/vdbe.c 841057c12c1c4e2dcc7e51516a06aabb72d9898ab50484edef162b9218da65b0 F src/vdbe.h 89f5edb1422c8783a0b29db836e409876f2b3e847f78e2b21b1fbcc48a93f85f F src/vdbeInt.h 5f3d0abcf30c2b7a6672ad4386f18be0fca9c9b2cefe18f85a2e3df74f2613bf F src/vdbeapi.c 354c893f1500cf524cc45c32879b9c68893a28b77e3442c24668d6afe4236217 @@ -1945,8 +1945,11 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P bff4f083eb1c35544988493a5d73a42e646c4250b841f5aae38c2183f0867a0e -R 1538c33a9ca8b52845c5bdc4ee31c46c +P dbd8e2e46cfb2de0ebdbb62cda2fe669df3eda98f5d6112d541f581995b1361d +Q +079b7b125206fb295720612f4853a5b786ec431ab595d35407195844779c149d +Q +647211e044a5856ceb6bf3e7b78e650fe7d81f8b7bf34568b99b346405ba520c +Q +73f4036b04798660b30e540cbab69420078df9fb62a6a39944e078c36272f905 +R a06dd4204ed9dc6148823319b9085bc9 U drh -Z 98d0ff758b95c26883d10f0f51771962 +Z 8357da3748da436bd7d9f47cf82232f1 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2a7d8f8807..2cd2ea1e78 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dbd8e2e46cfb2de0ebdbb62cda2fe669df3eda98f5d6112d541f581995b1361d \ No newline at end of file +12645f100d902690630a2925674aedbb01d41a53426a26a2f56de5b8fdec955f \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index 2c00bb498d..78bb0c2ebf 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3181,8 +3181,8 @@ void sqlite3CodeRhsOfIN( assert( ExprUseYSub(pExpr) ); assert( sqlite3VdbeGetOp(v,pExpr->y.sub.iAddr-1)->opcode==OP_BeginSubrtn || pParse->nErr ); - sqlite3VdbeAddOp3(v, OP_Return, pExpr->y.sub.regReturn, 0, - pExpr->y.sub.iAddr-1); + sqlite3VdbeAddOp2(v, OP_Return, pExpr->y.sub.regReturn, + pExpr->y.sub.iAddr); sqlite3VdbeChangeP1(v, pExpr->y.sub.iAddr-1, sqlite3VdbeCurrentAddr(v)-1); sqlite3ClearTempRegCache(pParse); } @@ -3312,8 +3312,8 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ assert( ExprUseYSub(pExpr) ); assert( sqlite3VdbeGetOp(v,pExpr->y.sub.iAddr-1)->opcode==OP_BeginSubrtn || pParse->nErr ); - sqlite3VdbeAddOp3(v, OP_Return, pExpr->y.sub.regReturn, 0, - pExpr->y.sub.iAddr-1); + sqlite3VdbeAddOp2(v, OP_Return, pExpr->y.sub.regReturn, + pExpr->y.sub.iAddr); sqlite3VdbeChangeP1(v, pExpr->y.sub.iAddr-1, sqlite3VdbeCurrentAddr(v)-1); sqlite3ClearTempRegCache(pParse); return rReg; diff --git a/src/vdbe.c b/src/vdbe.c index 18286c297b..092ccbcd1b 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -983,12 +983,7 @@ case OP_Gosub: { /* jump */ pIn1->flags = MEM_Int; pIn1->u.i = (int)(pOp-aOp); REGISTER_TRACE(pOp->p1, pIn1); - - /* Most jump operations do a goto to this spot in order to update - ** the pOp pointer. */ -jump_to_p2: - pOp = &aOp[pOp->p2 - 1]; - break; + goto jump_to_p2_and_check_for_interrupt; } /* Opcode: Return P1 P2 P3 * * @@ -1035,7 +1030,12 @@ case OP_InitCoroutine: { /* jump */ assert( !VdbeMemDynamic(pOut) ); pOut->u.i = pOp->p3 - 1; pOut->flags = MEM_Int; - if( pOp->p2 ) goto jump_to_p2; + if( pOp->p2==0 ) break; + + /* Most jump operations do a goto to this spot in order to update + ** the pOp pointer. */ +jump_to_p2: + pOp = &aOp[pOp->p2 - 1]; break; } From b192970809949903b955e37b71853585cef864c4 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 16 Apr 2022 15:46:23 +0000 Subject: [PATCH 2/4] Fix a problem with "ON DELETE RESTRICT" and "ON UPDATE RESTRICT" foreign keys in attached databases scanning child tables in the wrong schema. FossilOrigin-Name: 04d5b637f087520cd58211505f9b5c086ff96d864a1908f60464b6fe22c62b7d --- manifest | 19 ++++++++----------- manifest.uuid | 2 +- src/fkey.c | 17 +++++++++-------- test/fkey8.test | 22 ++++++++++++++++++++++ 4 files changed, 40 insertions(+), 20 deletions(-) diff --git a/manifest b/manifest index 917b78da94..1436d1d1ca 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Cherry\spick\ssubroutine\sindentation\simprovements\sand\sthe\shardening\sof\nOP_Gosub\sfrom\sthe\sright-join\sbranch\sback\sinto\strunk. -D 2022-04-14T19:48:32.540 +C Fix\sa\sproblem\swith\s"ON\sDELETE\sRESTRICT"\sand\s"ON\sUPDATE\sRESTRICT"\sforeign\skeys\sin\sattached\sdatabases\sscanning\schild\stables\sin\sthe\swrong\sschema. +D 2022-04-16T15:46:23.749 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -505,7 +505,7 @@ F src/dbstat.c 861e08690fcb0f2ee1165eff0060ea8d4f3e2ea10f80dab7d32ad70443a6ff2d F src/delete.c a8e844af211a48b13b5b358be77a12c860c6a557c21990ad51a548e2536500ce F src/expr.c 38a25dcba22bc6c9d8614e64624497aab1762911ba88e81fc55f1e67a85ebc16 F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007 -F src/fkey.c 94927f9b46d72a9cb858c208febf04ceb0a3270c5fa5fd0b7f436cf16e09f72a +F src/fkey.c d965ede15d8360c09ed59348940649ee647b192e784466837d7aefa836d1d91e F src/func.c a3407a6fbb0d4088d8d502e46f0ace63e0aeae7467ae23a9ca9815bbf9239761 F src/global.c e83ee571b79ee3adc32e380cf554cf1254bc43763d23786c71721fbcdfbbb965 F src/hash.c 8d7dda241d0ebdafb6ffdeda3149a412d7df75102cecfc1021c98d6219823b19 @@ -920,7 +920,7 @@ F test/fkey4.test 86446017011273aad8f9a99c1a65019e7bd9ca9d F test/fkey5.test 6727452e163a427147e84e739da18713da553d79f9783559b04fdcd36d5c7421 F test/fkey6.test d078a1e323a740062bed38df32b8a736fd320dc0 F test/fkey7.test 64fb28da03da5dfe3cdef5967aa7e832c2507bf7fb8f0780cacbca1f2338d031 -F test/fkey8.test 48ef829d63f5f7b37aabd4df9363ac05f65539d1da8c4a44251631769d920579 +F test/fkey8.test 51deda7f1a1448bca95875e4a6e1a3a75b4bd7215e924e845bd60de60e4d84bf F test/fkey_malloc.test 594a7ea1fbab553c036c70813cd8bd9407d63749 F test/fordelete.test ba98f14446b310f9c9d935b97ec748753d0144a28b356ba30d1f4f6958fdde5c F test/format4.test eeae341953db8b6bda7f549044797c3278a6cc345d11ada81471671b654f8ef4 @@ -1945,11 +1945,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 dbd8e2e46cfb2de0ebdbb62cda2fe669df3eda98f5d6112d541f581995b1361d -Q +079b7b125206fb295720612f4853a5b786ec431ab595d35407195844779c149d -Q +647211e044a5856ceb6bf3e7b78e650fe7d81f8b7bf34568b99b346405ba520c -Q +73f4036b04798660b30e540cbab69420078df9fb62a6a39944e078c36272f905 -R a06dd4204ed9dc6148823319b9085bc9 -U drh -Z 8357da3748da436bd7d9f47cf82232f1 +P 12645f100d902690630a2925674aedbb01d41a53426a26a2f56de5b8fdec955f +R 65b6ae478c0c46336b2e3d4a00d84d7d +U dan +Z 20ffa409115b35ade94fa1104d7de644 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2cd2ea1e78..d23cd4cac5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -12645f100d902690630a2925674aedbb01d41a53426a26a2f56de5b8fdec955f \ No newline at end of file +04d5b637f087520cd58211505f9b5c086ff96d864a1908f60464b6fe22c62b7d \ No newline at end of file diff --git a/src/fkey.c b/src/fkey.c index bae9b11ac3..a057925145 100644 --- a/src/fkey.c +++ b/src/fkey.c @@ -534,14 +534,10 @@ static Expr *exprTableColumn( ** Operation | FK type | Action taken ** -------------------------------------------------------------------------- ** DELETE immediate Increment the "immediate constraint counter". -** Or, if the ON (UPDATE|DELETE) action is RESTRICT, -** throw a "FOREIGN KEY constraint failed" exception. ** ** INSERT immediate Decrement the "immediate constraint counter". ** ** DELETE deferred Increment the "deferred constraint counter". -** Or, if the ON (UPDATE|DELETE) action is RESTRICT, -** throw a "FOREIGN KEY constraint failed" exception. ** ** INSERT deferred Decrement the "deferred constraint counter". ** @@ -1189,9 +1185,9 @@ int sqlite3FkRequired( ** ** It returns a pointer to a Trigger structure containing a trigger ** equivalent to the ON UPDATE or ON DELETE action specified by pFKey. -** If the action is "NO ACTION" or "RESTRICT", then a NULL pointer is -** returned (these actions require no special handling by the triggers -** sub-system, code for them is created by fkScanChildren()). +** If the action is "NO ACTION" then a NULL pointer is returned (these actions +** require no special handling by the triggers sub-system, code for them is +** created by fkScanChildren()). ** ** For example, if pFKey is the foreign key and pTab is table "p" in ** the following schema: @@ -1320,18 +1316,23 @@ static Trigger *fkActionTrigger( nFrom = sqlite3Strlen30(zFrom); if( action==OE_Restrict ){ + int iDb = sqlite3SchemaToIndex(db, pTab->pSchema); Token tFrom; + Token tDb; Expr *pRaise; tFrom.z = zFrom; tFrom.n = nFrom; + tDb.z = db->aDb[iDb].zDbSName; + tDb.n = sqlite3Strlen30(tDb.z); + pRaise = sqlite3Expr(db, TK_RAISE, "FOREIGN KEY constraint failed"); if( pRaise ){ pRaise->affExpr = OE_Abort; } pSelect = sqlite3SelectNew(pParse, sqlite3ExprListAppend(pParse, 0, pRaise), - sqlite3SrcListAppend(pParse, 0, &tFrom, 0), + sqlite3SrcListAppend(pParse, 0, &tDb, &tFrom), pWhere, 0, 0, 0, 0, 0 ); diff --git a/test/fkey8.test b/test/fkey8.test index 085190e675..2d72f6fcf0 100644 --- a/test/fkey8.test +++ b/test/fkey8.test @@ -228,4 +228,26 @@ do_execsql_test 5.3 { PRAGMA integrity_check; } {ok} +#------------------------------------------------------------------------- +reset_db +forcedelete test.db2 +do_execsql_test 6.1 { + PRAGMA foreign_keys = on; + CREATE TABLE c1(b); + INSERT INTO c1 VALUES(123); +} + +do_execsql_test 6.2 { + ATTACH 'test.db2' AS aux; + CREATE TABLE aux.p1(a INTEGER PRIMARY KEY); + CREATE TABLE aux.c1(b REFERENCES p1(a) ON DELETE RESTRICT); + + INSERT INTO aux.p1 VALUES(123); +} + +do_execsql_test 6.3 { + DELETE FROM aux.p1 WHERE a=123; +} + + finish_test From 2d27d36cba01b9ceff2c36ad0cef9468db370024 Mon Sep 17 00:00:00 2001 From: larrybr Date: Sat, 16 Apr 2022 17:53:25 +0000 Subject: [PATCH 3/4] Make shell auto-column work with lots of columns when log() is missing. FossilOrigin-Name: 82366436ef74838dae1f379f3e5b8ad187225a30ec58fb49f047ab7c08a263cf --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/shell.c.in | 13 ++++++++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 1436d1d1ca..375c4eca36 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\swith\s"ON\sDELETE\sRESTRICT"\sand\s"ON\sUPDATE\sRESTRICT"\sforeign\skeys\sin\sattached\sdatabases\sscanning\schild\stables\sin\sthe\swrong\sschema. -D 2022-04-16T15:46:23.749 +C Make\sshell\sauto-column\swork\swith\slots\sof\scolumns\swhen\slog()\sis\smissing. +D 2022-04-16T17:53:25.671 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -553,7 +553,7 @@ F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c F src/resolve.c 18d99e7146852d6064559561769fcca0743eb32b14a97da6dbed373a30ee0e76 F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c 5ac7c08646ac5a03634da8a954645bdaa13d9bf692fb6b0b5fb3b55b19ab884e -F src/shell.c.in eb7f10d5e2c47bd014d92ec5db1def21fcc1ed56ffaaa4ee715b6c37c370b47f +F src/shell.c.in ecff6f4ab0e8e25acd578b3eb27ac0bad4d48643c160259a277151d6e9d412e1 F src/sqlite.h.in 2a35f62185eb5e7ecc64a2f68442b538ce9be74f80f28a00abc24837edcf1c17 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h f49e28c25bd941e79794db5415fdf7b202deb3bc072ed6f1ed273d578703684e @@ -1945,8 +1945,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 12645f100d902690630a2925674aedbb01d41a53426a26a2f56de5b8fdec955f -R 65b6ae478c0c46336b2e3d4a00d84d7d -U dan -Z 20ffa409115b35ade94fa1104d7de644 +P 04d5b637f087520cd58211505f9b5c086ff96d864a1908f60464b6fe22c62b7d +R 247d42769b42eb4f49b3d0e81a9caafe +U larrybr +Z 012ec694a47eae04b9be0b86d525b8a4 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d23cd4cac5..0034ef782e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -04d5b637f087520cd58211505f9b5c086ff96d864a1908f60464b6fe22c62b7d \ No newline at end of file +82366436ef74838dae1f379f3e5b8ad187225a30ec58fb49f047ab7c08a263cf \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index 996a7f942b..5a2ff6ea26 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -7833,7 +7833,7 @@ static int recoverDatabaseCmd(ShellState *pState, int nArg, char **azArg){ #endif /* !(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) */ -/* +/* * zAutoColumn(zCol, &db, ?) => Maybe init db, add column zCol to it. * zAutoColumn(0, &db, ?) => (db!=0) Form columns spec for CREATE TABLE, * close db and set it to 0, and return the columns spec, to later @@ -7916,6 +7916,13 @@ UPDATE ColNames AS t SET reps=\ static const char * const zColDigits = "\ SELECT CAST(ceil(log(count(*)+0.5)) AS INT) FROM ColNames \ "; +#else + /* Counting on SQLITE_MAX_COLUMN < 100,000 here. (32767 is the hard limit.) */ + static const char * const zColDigits = "\ +SELECT CASE WHEN (nc < 10) THEN 1 WHEN (nc < 100) THEN 2 \ + WHEN (nc < 1000) THEN 3 WHEN (nc < 10000) THEN 4 \ + ELSE 5 FROM (SELECT count(*) AS nc FROM ColNames) \ +"; #endif static const char * const zRenameRank = #ifdef SHELL_COLUMN_RENAME_CLEAN @@ -8001,11 +8008,7 @@ FROM (\ /* Formulate the columns spec, close the DB, zero *pDb. */ char *zColsSpec = 0; int hasDupes = db_int(*pDb, zHasDupes); -#ifdef SQLITE_ENABLE_MATH_FUNCTIONS int nDigits = (hasDupes)? db_int(*pDb, zColDigits) : 0; -#else -# define nDigits 2 -#endif if( hasDupes ){ #ifdef SHELL_COLUMN_RENAME_CLEAN rc = sqlite3_exec(*pDb, zDedoctor, 0, 0, 0); From e98b71e65dcb073550c80e8dcf9c37434cd17639 Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 18 Apr 2022 14:15:07 +0000 Subject: [PATCH 4/4] Improved comment field in the bytecode generated for OP_Column and OP_Rowid. FossilOrigin-Name: 1b2c5cef9560123344db391cd065090d1914724715ec6643d2d9b5fac2051a21 --- manifest | 19 ++++++++++--------- manifest.uuid | 2 +- src/expr.c | 1 + src/vdbe.c | 4 ++-- src/vdbeaux.c | 7 ++++++- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 375c4eca36..275be40dfb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\sshell\sauto-column\swork\swith\slots\sof\scolumns\swhen\slog()\sis\smissing. -D 2022-04-16T17:53:25.671 +C Improved\scomment\sfield\sin\sthe\sbytecode\sgenerated\sfor\sOP_Column\sand\sOP_Rowid. +D 2022-04-18T14:15:07.659 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -503,7 +503,7 @@ F src/date.c 15082566229d4b1e5f24fdb490bf9bcc68824b911d70e3573ef075a1b9e2d26f F src/dbpage.c 90661a87e1db8bfbc8d2ebbdcd3749651ddb287c555c07a28fb17c7c591ffb68 F src/dbstat.c 861e08690fcb0f2ee1165eff0060ea8d4f3e2ea10f80dab7d32ad70443a6ff2d F src/delete.c a8e844af211a48b13b5b358be77a12c860c6a557c21990ad51a548e2536500ce -F src/expr.c 38a25dcba22bc6c9d8614e64624497aab1762911ba88e81fc55f1e67a85ebc16 +F src/expr.c 1d9a1eefd803c9f9b1cfed9015589157de173e0994b7a73e2d9cf5a267a77449 F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007 F src/fkey.c d965ede15d8360c09ed59348940649ee647b192e784466837d7aefa836d1d91e F src/func.c a3407a6fbb0d4088d8d502e46f0ace63e0aeae7467ae23a9ca9815bbf9239761 @@ -624,11 +624,11 @@ F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 F src/util.c 602fe229f32a96ceccae4f40824129669582096f7c355f53dbac156c9fecef23 F src/vacuum.c 6c38ddc52f0619865c91dae9c441d4d48bf3040d7dc1bc5b22da1e45547ed0b3 -F src/vdbe.c 841057c12c1c4e2dcc7e51516a06aabb72d9898ab50484edef162b9218da65b0 +F src/vdbe.c e82071ff183d3cf9aa3afeefc40f10a2443e8056e16c38f6d80e041da7ec3fb2 F src/vdbe.h 89f5edb1422c8783a0b29db836e409876f2b3e847f78e2b21b1fbcc48a93f85f F src/vdbeInt.h 5f3d0abcf30c2b7a6672ad4386f18be0fca9c9b2cefe18f85a2e3df74f2613bf F src/vdbeapi.c 354c893f1500cf524cc45c32879b9c68893a28b77e3442c24668d6afe4236217 -F src/vdbeaux.c baafd56664ccca4cf361a48b912f7ff37f95ee19aaf7cada420ce2ca73396833 +F src/vdbeaux.c ac98cd2fbf32fd1dec548d362f69103b64ec391a3926bb64ab2e9cfa875f6b05 F src/vdbeblob.c 5e61ce31aca17db8fb60395407457a8c1c7fb471dde405e0cd675974611dcfcd F src/vdbemem.c 7189090b72baa025f945a1ac8c61ee420c645254476e8a191d555db76dfea5d4 F src/vdbesort.c 43756031ca7430f7aec3ef904824a7883c4ede783e51f280d99b9b65c0796e35 @@ -1945,8 +1945,9 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 04d5b637f087520cd58211505f9b5c086ff96d864a1908f60464b6fe22c62b7d -R 247d42769b42eb4f49b3d0e81a9caafe -U larrybr -Z 012ec694a47eae04b9be0b86d525b8a4 +P 82366436ef74838dae1f379f3e5b8ad187225a30ec58fb49f047ab7c08a263cf +Q +009bbf8026106c5a74cced06cced48badb870a4b6e6a2f8104a544d2a8d79e45 +R 7ec2e027f14c1113394a6f2b89ad97e8 +U drh +Z 913b185da9d2fc4d6a61edeeeba6fe46 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0034ef782e..da113a5941 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -82366436ef74838dae1f379f3e5b8ad187225a30ec58fb49f047ab7c08a263cf \ No newline at end of file +1b2c5cef9560123344db391cd065090d1914724715ec6643d2d9b5fac2051a21 \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index 78bb0c2ebf..f5916c53ee 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3748,6 +3748,7 @@ void sqlite3ExprCodeGetColumnOfTable( } if( iCol<0 || iCol==pTab->iPKey ){ sqlite3VdbeAddOp2(v, OP_Rowid, iTabCur, regOut); + VdbeComment((v, "%s.rowid", pTab->zName)); }else{ int op; int x; diff --git a/src/vdbe.c b/src/vdbe.c index 092ccbcd1b..16b6f9bb55 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -2659,7 +2659,7 @@ case OP_Offset: { /* out3 */ #endif /* SQLITE_ENABLE_OFFSET_SQL_FUNC */ /* Opcode: Column P1 P2 P3 P4 P5 -** Synopsis: r[P3]=PX +** Synopsis: r[P3]=PX cursor P1 column P2 ** ** Interpret the data that cursor P1 points to as a structure built using ** the MakeRecord instruction. (See the MakeRecord opcode for additional @@ -5742,7 +5742,7 @@ case OP_RowData: { } /* Opcode: Rowid P1 P2 * * * -** Synopsis: r[P2]=rowid +** Synopsis: r[P2]=PX rowid of P1 ** ** Store in register P2 an integer which is the key of the table entry that ** P1 is currently point to. diff --git a/src/vdbeaux.c b/src/vdbeaux.c index cb2433c2cd..a67bc68f9e 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -1490,8 +1490,13 @@ char *sqlite3VdbeDisplayComment( if( c=='4' ){ sqlite3_str_appendall(&x, zP4); }else if( c=='X' ){ - sqlite3_str_appendall(&x, pOp->zComment); + if( pOp->zComment && pOp->zComment[0] ){ + sqlite3_str_appendall(&x, pOp->zComment); + }else{ + sqlite3_str_appendall(&x, zSynopsis+1); + } seenCom = 1; + break; }else{ int v1 = translateP(c, pOp); int v2;