Fossil SCM
Disable triggers using SQLITE_DBCONFIG_ENABLE_TRIGGERS for defense in depth. SQLite 3.35.0 is required due to Fossil's use of TEMP triggers. Also, use the new RETURNING clause for queries where it makes sense, again requiring SQLite 3.35.0.
Commit
8a3dc1a9754e5fec28c9b52bbbca6e94fff980798fb9136abe793ed1739e3638
Parent
60b8c71b0070a7e…
5 files changed
+3
-7
+1
+3
-7
+2
-2
+3
-4
+3
-7
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -1377,11 +1377,10 @@ | ||
| 1377 | 1377 | && subscribe_error_check(&eErr,&zErr,needCaptcha) |
| 1378 | 1378 | ){ |
| 1379 | 1379 | /* A validated request for a new subscription has been received. */ |
| 1380 | 1380 | char ssub[20]; |
| 1381 | 1381 | const char *zEAddr = P("e"); |
| 1382 | - sqlite3_int64 id; /* New subscriber Id */ | |
| 1383 | 1382 | const char *zCode; /* New subscriber code (in hex) */ |
| 1384 | 1383 | int nsub = 0; |
| 1385 | 1384 | const char *suname = PT("suname"); |
| 1386 | 1385 | if( suname==0 && needCaptcha==0 && !g.perm.Admin ) suname = g.zLogin; |
| 1387 | 1386 | if( suname && suname[0]==0 ) suname = 0; |
| @@ -1390,25 +1389,22 @@ | ||
| 1390 | 1389 | if( g.perm.RdForum && PB("sf") ) ssub[nsub++] = 'f'; |
| 1391 | 1390 | if( g.perm.RdTkt && PB("st") ) ssub[nsub++] = 't'; |
| 1392 | 1391 | if( g.perm.RdWiki && PB("sw") ) ssub[nsub++] = 'w'; |
| 1393 | 1392 | if( g.perm.RdForum && PB("sx") ) ssub[nsub++] = 'x'; |
| 1394 | 1393 | ssub[nsub] = 0; |
| 1395 | - db_multi_exec( | |
| 1394 | + zCode = db_text(0, | |
| 1396 | 1395 | "INSERT INTO subscriber(semail,suname," |
| 1397 | 1396 | " sverified,sdonotcall,sdigest,ssub,sctime,mtime,smip)" |
| 1398 | - "VALUES(%Q,%Q,%d,0,%d,%Q,now(),now(),%Q)", | |
| 1397 | + "VALUES(%Q,%Q,%d,0,%d,%Q,now(),now(),%Q)" | |
| 1398 | + "RETURNING hex(subscriberCode);", | |
| 1399 | 1399 | /* semail */ zEAddr, |
| 1400 | 1400 | /* suname */ suname, |
| 1401 | 1401 | /* sverified */ needCaptcha==0, |
| 1402 | 1402 | /* sdigest */ PB("di"), |
| 1403 | 1403 | /* ssub */ ssub, |
| 1404 | 1404 | /* smip */ g.zIpAddr |
| 1405 | 1405 | ); |
| 1406 | - id = db_last_insert_rowid(); | |
| 1407 | - zCode = db_text(0, | |
| 1408 | - "SELECT hex(subscriberCode) FROM subscriber WHERE subscriberId=%lld", | |
| 1409 | - id); | |
| 1410 | 1406 | if( !needCaptcha ){ |
| 1411 | 1407 | /* The new subscription has been added on behalf of a logged-in user. |
| 1412 | 1408 | ** No verification is required. Jump immediately to /alerts page. |
| 1413 | 1409 | */ |
| 1414 | 1410 | if( g.perm.Admin ){ |
| 1415 | 1411 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -1377,11 +1377,10 @@ | |
| 1377 | && subscribe_error_check(&eErr,&zErr,needCaptcha) |
| 1378 | ){ |
| 1379 | /* A validated request for a new subscription has been received. */ |
| 1380 | char ssub[20]; |
| 1381 | const char *zEAddr = P("e"); |
| 1382 | sqlite3_int64 id; /* New subscriber Id */ |
| 1383 | const char *zCode; /* New subscriber code (in hex) */ |
| 1384 | int nsub = 0; |
| 1385 | const char *suname = PT("suname"); |
| 1386 | if( suname==0 && needCaptcha==0 && !g.perm.Admin ) suname = g.zLogin; |
| 1387 | if( suname && suname[0]==0 ) suname = 0; |
| @@ -1390,25 +1389,22 @@ | |
| 1390 | if( g.perm.RdForum && PB("sf") ) ssub[nsub++] = 'f'; |
| 1391 | if( g.perm.RdTkt && PB("st") ) ssub[nsub++] = 't'; |
| 1392 | if( g.perm.RdWiki && PB("sw") ) ssub[nsub++] = 'w'; |
| 1393 | if( g.perm.RdForum && PB("sx") ) ssub[nsub++] = 'x'; |
| 1394 | ssub[nsub] = 0; |
| 1395 | db_multi_exec( |
| 1396 | "INSERT INTO subscriber(semail,suname," |
| 1397 | " sverified,sdonotcall,sdigest,ssub,sctime,mtime,smip)" |
| 1398 | "VALUES(%Q,%Q,%d,0,%d,%Q,now(),now(),%Q)", |
| 1399 | /* semail */ zEAddr, |
| 1400 | /* suname */ suname, |
| 1401 | /* sverified */ needCaptcha==0, |
| 1402 | /* sdigest */ PB("di"), |
| 1403 | /* ssub */ ssub, |
| 1404 | /* smip */ g.zIpAddr |
| 1405 | ); |
| 1406 | id = db_last_insert_rowid(); |
| 1407 | zCode = db_text(0, |
| 1408 | "SELECT hex(subscriberCode) FROM subscriber WHERE subscriberId=%lld", |
| 1409 | id); |
| 1410 | if( !needCaptcha ){ |
| 1411 | /* The new subscription has been added on behalf of a logged-in user. |
| 1412 | ** No verification is required. Jump immediately to /alerts page. |
| 1413 | */ |
| 1414 | if( g.perm.Admin ){ |
| 1415 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -1377,11 +1377,10 @@ | |
| 1377 | && subscribe_error_check(&eErr,&zErr,needCaptcha) |
| 1378 | ){ |
| 1379 | /* A validated request for a new subscription has been received. */ |
| 1380 | char ssub[20]; |
| 1381 | const char *zEAddr = P("e"); |
| 1382 | const char *zCode; /* New subscriber code (in hex) */ |
| 1383 | int nsub = 0; |
| 1384 | const char *suname = PT("suname"); |
| 1385 | if( suname==0 && needCaptcha==0 && !g.perm.Admin ) suname = g.zLogin; |
| 1386 | if( suname && suname[0]==0 ) suname = 0; |
| @@ -1390,25 +1389,22 @@ | |
| 1389 | if( g.perm.RdForum && PB("sf") ) ssub[nsub++] = 'f'; |
| 1390 | if( g.perm.RdTkt && PB("st") ) ssub[nsub++] = 't'; |
| 1391 | if( g.perm.RdWiki && PB("sw") ) ssub[nsub++] = 'w'; |
| 1392 | if( g.perm.RdForum && PB("sx") ) ssub[nsub++] = 'x'; |
| 1393 | ssub[nsub] = 0; |
| 1394 | zCode = db_text(0, |
| 1395 | "INSERT INTO subscriber(semail,suname," |
| 1396 | " sverified,sdonotcall,sdigest,ssub,sctime,mtime,smip)" |
| 1397 | "VALUES(%Q,%Q,%d,0,%d,%Q,now(),now(),%Q)" |
| 1398 | "RETURNING hex(subscriberCode);", |
| 1399 | /* semail */ zEAddr, |
| 1400 | /* suname */ suname, |
| 1401 | /* sverified */ needCaptcha==0, |
| 1402 | /* sdigest */ PB("di"), |
| 1403 | /* ssub */ ssub, |
| 1404 | /* smip */ g.zIpAddr |
| 1405 | ); |
| 1406 | if( !needCaptcha ){ |
| 1407 | /* The new subscription has been added on behalf of a logged-in user. |
| 1408 | ** No verification is required. Jump immediately to /alerts page. |
| 1409 | */ |
| 1410 | if( g.perm.Admin ){ |
| 1411 |
M
src/db.c
+1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1618,10 +1618,11 @@ | ||
| 1618 | 1618 | if( rc!=SQLITE_OK ){ |
| 1619 | 1619 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 1620 | 1620 | } |
| 1621 | 1621 | db_maybe_set_encryption_key(db, zDbName); |
| 1622 | 1622 | sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_FKEY, 0, &rc); |
| 1623 | + sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_TRIGGER, 0, &rc); | |
| 1623 | 1624 | sqlite3_db_config(db, SQLITE_DBCONFIG_TRUSTED_SCHEMA, 0, &rc); |
| 1624 | 1625 | sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DDL, 0, &rc); |
| 1625 | 1626 | sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DML, 0, &rc); |
| 1626 | 1627 | sqlite3_db_config(db, SQLITE_DBCONFIG_DEFENSIVE, 1, &rc); |
| 1627 | 1628 | sqlite3_busy_timeout(db, 15000); |
| 1628 | 1629 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1618,10 +1618,11 @@ | |
| 1618 | if( rc!=SQLITE_OK ){ |
| 1619 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 1620 | } |
| 1621 | db_maybe_set_encryption_key(db, zDbName); |
| 1622 | sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_FKEY, 0, &rc); |
| 1623 | sqlite3_db_config(db, SQLITE_DBCONFIG_TRUSTED_SCHEMA, 0, &rc); |
| 1624 | sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DDL, 0, &rc); |
| 1625 | sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DML, 0, &rc); |
| 1626 | sqlite3_db_config(db, SQLITE_DBCONFIG_DEFENSIVE, 1, &rc); |
| 1627 | sqlite3_busy_timeout(db, 15000); |
| 1628 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1618,10 +1618,11 @@ | |
| 1618 | if( rc!=SQLITE_OK ){ |
| 1619 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 1620 | } |
| 1621 | db_maybe_set_encryption_key(db, zDbName); |
| 1622 | sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_FKEY, 0, &rc); |
| 1623 | sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_TRIGGER, 0, &rc); |
| 1624 | sqlite3_db_config(db, SQLITE_DBCONFIG_TRUSTED_SCHEMA, 0, &rc); |
| 1625 | sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DDL, 0, &rc); |
| 1626 | sqlite3_db_config(db, SQLITE_DBCONFIG_DQS_DML, 0, &rc); |
| 1627 | sqlite3_db_config(db, SQLITE_DBCONFIG_DEFENSIVE, 1, &rc); |
| 1628 | sqlite3_busy_timeout(db, 15000); |
| 1629 |
+3
-7
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -1667,11 +1667,10 @@ | ||
| 1667 | 1667 | login_set_user_cookie(zUserID, uid, NULL, 0); |
| 1668 | 1668 | if( doAlerts ){ |
| 1669 | 1669 | /* Also make the new user a subscriber. */ |
| 1670 | 1670 | Blob hdr, body; |
| 1671 | 1671 | AlertSender *pSender; |
| 1672 | - sqlite3_int64 id; /* New subscriber Id */ | |
| 1673 | 1672 | const char *zCode; /* New subscriber code (in hex) */ |
| 1674 | 1673 | const char *zGoto = P("g"); |
| 1675 | 1674 | int nsub = 0; |
| 1676 | 1675 | char ssub[20]; |
| 1677 | 1676 | CapabilityString *pCap; |
| @@ -1683,34 +1682,31 @@ | ||
| 1683 | 1682 | if( capability_has_any(pCap,"r") ) ssub[nsub++] = 't'; |
| 1684 | 1683 | if( capability_has_any(pCap,"j") ) ssub[nsub++] = 'w'; |
| 1685 | 1684 | ssub[nsub] = 0; |
| 1686 | 1685 | capability_free(pCap); |
| 1687 | 1686 | /* Also add the user to the subscriber table. */ |
| 1688 | - db_multi_exec( | |
| 1687 | + zCode = db_text(0, | |
| 1689 | 1688 | "INSERT INTO subscriber(semail,suname," |
| 1690 | 1689 | " sverified,sdonotcall,sdigest,ssub,sctime,mtime,smip)" |
| 1691 | 1690 | " VALUES(%Q,%Q,%d,0,%d,%Q,now(),now(),%Q)" |
| 1692 | 1691 | " ON CONFLICT(semail) DO UPDATE" |
| 1693 | - " SET suname=excluded.suname", | |
| 1692 | + " SET suname=excluded.suname" | |
| 1693 | + " RETURNING hex(subscriberCode);", | |
| 1694 | 1694 | /* semail */ zEAddr, |
| 1695 | 1695 | /* suname */ zUserID, |
| 1696 | 1696 | /* sverified */ 0, |
| 1697 | 1697 | /* sdigest */ 0, |
| 1698 | 1698 | /* ssub */ ssub, |
| 1699 | 1699 | /* smip */ g.zIpAddr |
| 1700 | 1700 | ); |
| 1701 | - id = db_last_insert_rowid(); | |
| 1702 | 1701 | if( db_exists("SELECT 1 FROM subscriber WHERE semail=%Q" |
| 1703 | 1702 | " AND sverified", zEAddr) ){ |
| 1704 | 1703 | /* This the case where the user was formerly a verified subscriber |
| 1705 | 1704 | ** and here they have also registered as a user as well. It is |
| 1706 | 1705 | ** not necessary to repeat the verfication step */ |
| 1707 | 1706 | redirect_to_g(); |
| 1708 | 1707 | } |
| 1709 | - zCode = db_text(0, | |
| 1710 | - "SELECT hex(subscriberCode) FROM subscriber WHERE subscriberId=%lld", | |
| 1711 | - id); | |
| 1712 | 1708 | /* A verification email */ |
| 1713 | 1709 | pSender = alert_sender_new(0,0); |
| 1714 | 1710 | blob_init(&hdr,0,0); |
| 1715 | 1711 | blob_init(&body,0,0); |
| 1716 | 1712 | blob_appendf(&hdr, "To: <%s>\n", zEAddr); |
| 1717 | 1713 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1667,11 +1667,10 @@ | |
| 1667 | login_set_user_cookie(zUserID, uid, NULL, 0); |
| 1668 | if( doAlerts ){ |
| 1669 | /* Also make the new user a subscriber. */ |
| 1670 | Blob hdr, body; |
| 1671 | AlertSender *pSender; |
| 1672 | sqlite3_int64 id; /* New subscriber Id */ |
| 1673 | const char *zCode; /* New subscriber code (in hex) */ |
| 1674 | const char *zGoto = P("g"); |
| 1675 | int nsub = 0; |
| 1676 | char ssub[20]; |
| 1677 | CapabilityString *pCap; |
| @@ -1683,34 +1682,31 @@ | |
| 1683 | if( capability_has_any(pCap,"r") ) ssub[nsub++] = 't'; |
| 1684 | if( capability_has_any(pCap,"j") ) ssub[nsub++] = 'w'; |
| 1685 | ssub[nsub] = 0; |
| 1686 | capability_free(pCap); |
| 1687 | /* Also add the user to the subscriber table. */ |
| 1688 | db_multi_exec( |
| 1689 | "INSERT INTO subscriber(semail,suname," |
| 1690 | " sverified,sdonotcall,sdigest,ssub,sctime,mtime,smip)" |
| 1691 | " VALUES(%Q,%Q,%d,0,%d,%Q,now(),now(),%Q)" |
| 1692 | " ON CONFLICT(semail) DO UPDATE" |
| 1693 | " SET suname=excluded.suname", |
| 1694 | /* semail */ zEAddr, |
| 1695 | /* suname */ zUserID, |
| 1696 | /* sverified */ 0, |
| 1697 | /* sdigest */ 0, |
| 1698 | /* ssub */ ssub, |
| 1699 | /* smip */ g.zIpAddr |
| 1700 | ); |
| 1701 | id = db_last_insert_rowid(); |
| 1702 | if( db_exists("SELECT 1 FROM subscriber WHERE semail=%Q" |
| 1703 | " AND sverified", zEAddr) ){ |
| 1704 | /* This the case where the user was formerly a verified subscriber |
| 1705 | ** and here they have also registered as a user as well. It is |
| 1706 | ** not necessary to repeat the verfication step */ |
| 1707 | redirect_to_g(); |
| 1708 | } |
| 1709 | zCode = db_text(0, |
| 1710 | "SELECT hex(subscriberCode) FROM subscriber WHERE subscriberId=%lld", |
| 1711 | id); |
| 1712 | /* A verification email */ |
| 1713 | pSender = alert_sender_new(0,0); |
| 1714 | blob_init(&hdr,0,0); |
| 1715 | blob_init(&body,0,0); |
| 1716 | blob_appendf(&hdr, "To: <%s>\n", zEAddr); |
| 1717 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1667,11 +1667,10 @@ | |
| 1667 | login_set_user_cookie(zUserID, uid, NULL, 0); |
| 1668 | if( doAlerts ){ |
| 1669 | /* Also make the new user a subscriber. */ |
| 1670 | Blob hdr, body; |
| 1671 | AlertSender *pSender; |
| 1672 | const char *zCode; /* New subscriber code (in hex) */ |
| 1673 | const char *zGoto = P("g"); |
| 1674 | int nsub = 0; |
| 1675 | char ssub[20]; |
| 1676 | CapabilityString *pCap; |
| @@ -1683,34 +1682,31 @@ | |
| 1682 | if( capability_has_any(pCap,"r") ) ssub[nsub++] = 't'; |
| 1683 | if( capability_has_any(pCap,"j") ) ssub[nsub++] = 'w'; |
| 1684 | ssub[nsub] = 0; |
| 1685 | capability_free(pCap); |
| 1686 | /* Also add the user to the subscriber table. */ |
| 1687 | zCode = db_text(0, |
| 1688 | "INSERT INTO subscriber(semail,suname," |
| 1689 | " sverified,sdonotcall,sdigest,ssub,sctime,mtime,smip)" |
| 1690 | " VALUES(%Q,%Q,%d,0,%d,%Q,now(),now(),%Q)" |
| 1691 | " ON CONFLICT(semail) DO UPDATE" |
| 1692 | " SET suname=excluded.suname" |
| 1693 | " RETURNING hex(subscriberCode);", |
| 1694 | /* semail */ zEAddr, |
| 1695 | /* suname */ zUserID, |
| 1696 | /* sverified */ 0, |
| 1697 | /* sdigest */ 0, |
| 1698 | /* ssub */ ssub, |
| 1699 | /* smip */ g.zIpAddr |
| 1700 | ); |
| 1701 | if( db_exists("SELECT 1 FROM subscriber WHERE semail=%Q" |
| 1702 | " AND sverified", zEAddr) ){ |
| 1703 | /* This the case where the user was formerly a verified subscriber |
| 1704 | ** and here they have also registered as a user as well. It is |
| 1705 | ** not necessary to repeat the verfication step */ |
| 1706 | redirect_to_g(); |
| 1707 | } |
| 1708 | /* A verification email */ |
| 1709 | pSender = alert_sender_new(0,0); |
| 1710 | blob_init(&hdr,0,0); |
| 1711 | blob_init(&body,0,0); |
| 1712 | blob_appendf(&hdr, "To: <%s>\n", zEAddr); |
| 1713 |
+2
-2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -677,12 +677,12 @@ | ||
| 677 | 677 | } |
| 678 | 678 | #endif |
| 679 | 679 | |
| 680 | 680 | fossil_printf_selfcheck(); |
| 681 | 681 | fossil_limit_memory(1); |
| 682 | - if( sqlite3_libversion_number()<3034000 ){ | |
| 683 | - fossil_panic("Unsuitable SQLite version %s, must be at least 3.34.0", | |
| 682 | + if( sqlite3_libversion_number()<3035000 ){ | |
| 683 | + fossil_panic("Unsuitable SQLite version %s, must be at least 3.35.0", | |
| 684 | 684 | sqlite3_libversion()); |
| 685 | 685 | } |
| 686 | 686 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 687 | 687 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 688 | 688 | memset(&g, 0, sizeof(g)); |
| 689 | 689 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -677,12 +677,12 @@ | |
| 677 | } |
| 678 | #endif |
| 679 | |
| 680 | fossil_printf_selfcheck(); |
| 681 | fossil_limit_memory(1); |
| 682 | if( sqlite3_libversion_number()<3034000 ){ |
| 683 | fossil_panic("Unsuitable SQLite version %s, must be at least 3.34.0", |
| 684 | sqlite3_libversion()); |
| 685 | } |
| 686 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 687 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 688 | memset(&g, 0, sizeof(g)); |
| 689 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -677,12 +677,12 @@ | |
| 677 | } |
| 678 | #endif |
| 679 | |
| 680 | fossil_printf_selfcheck(); |
| 681 | fossil_limit_memory(1); |
| 682 | if( sqlite3_libversion_number()<3035000 ){ |
| 683 | fossil_panic("Unsuitable SQLite version %s, must be at least 3.35.0", |
| 684 | sqlite3_libversion()); |
| 685 | } |
| 686 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 687 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 688 | memset(&g, 0, sizeof(g)); |
| 689 |
+3
-4
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -2325,11 +2325,11 @@ | ||
| 2325 | 2325 | if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d", rid) ){ |
| 2326 | 2326 | char *zCom; |
| 2327 | 2327 | parentid = manifest_add_checkin_linkages(rid,p,p->nParent,p->azParent); |
| 2328 | 2328 | search_doc_touch('c', rid, 0); |
| 2329 | 2329 | assert( manifest_event_triggers_are_enabled ); |
| 2330 | - db_multi_exec( | |
| 2330 | + zCom = db_text(0, | |
| 2331 | 2331 | "REPLACE INTO event(type,mtime,objid,user,comment," |
| 2332 | 2332 | "bgcolor,euser,ecomment,omtime)" |
| 2333 | 2333 | "VALUES('ci'," |
| 2334 | 2334 | " coalesce(" |
| 2335 | 2335 | " (SELECT julianday(value) FROM tagxref WHERE tagid=%d AND rid=%d)," |
| @@ -2336,19 +2336,18 @@ | ||
| 2336 | 2336 | " %.17g" |
| 2337 | 2337 | " )," |
| 2338 | 2338 | " %d,%Q,%Q," |
| 2339 | 2339 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," |
| 2340 | 2340 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 2341 | - " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g);", | |
| 2341 | + " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g)" | |
| 2342 | + "RETURNING coalesce(ecomment,comment);", | |
| 2342 | 2343 | TAG_DATE, rid, p->rDate, |
| 2343 | 2344 | rid, p->zUser, p->zComment, |
| 2344 | 2345 | TAG_BGCOLOR, rid, |
| 2345 | 2346 | TAG_USER, rid, |
| 2346 | 2347 | TAG_COMMENT, rid, p->rDate |
| 2347 | 2348 | ); |
| 2348 | - zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event" | |
| 2349 | - " WHERE rowid=last_insert_rowid()"); | |
| 2350 | 2349 | backlink_extract(zCom, 0, rid, BKLNK_COMMENT, p->rDate, 1); |
| 2351 | 2350 | fossil_free(zCom); |
| 2352 | 2351 | |
| 2353 | 2352 | /* If this is a delta-manifest, record the fact that this repository |
| 2354 | 2353 | ** contains delta manifests, to free the "commit" logic to generate |
| 2355 | 2354 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -2325,11 +2325,11 @@ | |
| 2325 | if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d", rid) ){ |
| 2326 | char *zCom; |
| 2327 | parentid = manifest_add_checkin_linkages(rid,p,p->nParent,p->azParent); |
| 2328 | search_doc_touch('c', rid, 0); |
| 2329 | assert( manifest_event_triggers_are_enabled ); |
| 2330 | db_multi_exec( |
| 2331 | "REPLACE INTO event(type,mtime,objid,user,comment," |
| 2332 | "bgcolor,euser,ecomment,omtime)" |
| 2333 | "VALUES('ci'," |
| 2334 | " coalesce(" |
| 2335 | " (SELECT julianday(value) FROM tagxref WHERE tagid=%d AND rid=%d)," |
| @@ -2336,19 +2336,18 @@ | |
| 2336 | " %.17g" |
| 2337 | " )," |
| 2338 | " %d,%Q,%Q," |
| 2339 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," |
| 2340 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 2341 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g);", |
| 2342 | TAG_DATE, rid, p->rDate, |
| 2343 | rid, p->zUser, p->zComment, |
| 2344 | TAG_BGCOLOR, rid, |
| 2345 | TAG_USER, rid, |
| 2346 | TAG_COMMENT, rid, p->rDate |
| 2347 | ); |
| 2348 | zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event" |
| 2349 | " WHERE rowid=last_insert_rowid()"); |
| 2350 | backlink_extract(zCom, 0, rid, BKLNK_COMMENT, p->rDate, 1); |
| 2351 | fossil_free(zCom); |
| 2352 | |
| 2353 | /* If this is a delta-manifest, record the fact that this repository |
| 2354 | ** contains delta manifests, to free the "commit" logic to generate |
| 2355 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -2325,11 +2325,11 @@ | |
| 2325 | if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d", rid) ){ |
| 2326 | char *zCom; |
| 2327 | parentid = manifest_add_checkin_linkages(rid,p,p->nParent,p->azParent); |
| 2328 | search_doc_touch('c', rid, 0); |
| 2329 | assert( manifest_event_triggers_are_enabled ); |
| 2330 | zCom = db_text(0, |
| 2331 | "REPLACE INTO event(type,mtime,objid,user,comment," |
| 2332 | "bgcolor,euser,ecomment,omtime)" |
| 2333 | "VALUES('ci'," |
| 2334 | " coalesce(" |
| 2335 | " (SELECT julianday(value) FROM tagxref WHERE tagid=%d AND rid=%d)," |
| @@ -2336,19 +2336,18 @@ | |
| 2336 | " %.17g" |
| 2337 | " )," |
| 2338 | " %d,%Q,%Q," |
| 2339 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," |
| 2340 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 2341 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g)" |
| 2342 | "RETURNING coalesce(ecomment,comment);", |
| 2343 | TAG_DATE, rid, p->rDate, |
| 2344 | rid, p->zUser, p->zComment, |
| 2345 | TAG_BGCOLOR, rid, |
| 2346 | TAG_USER, rid, |
| 2347 | TAG_COMMENT, rid, p->rDate |
| 2348 | ); |
| 2349 | backlink_extract(zCom, 0, rid, BKLNK_COMMENT, p->rDate, 1); |
| 2350 | fossil_free(zCom); |
| 2351 | |
| 2352 | /* If this is a delta-manifest, record the fact that this repository |
| 2353 | ** contains delta manifests, to free the "commit" logic to generate |
| 2354 |