Fossil SCM

In the TH1 query command, prepare the text that remains after each statement rather than the whole argument again, so that SQL holding more than one statement runs each in turn instead of looping forever on the first.

dmestas 2026-11-21 21:38 UTC small-fixes
Commit b0a9eb39348702bae0a4eb4a718a392c7df3afecf17457091f534c930a19f760
1 file changed +1 -1
+1 -1
--- src/th_main.c
+++ src/th_main.c
@@ -1981,11 +1981,11 @@
19811981
19821982
while( res==TH_OK && nSql>0 ){
19831983
zErr = 0;
19841984
report_restrict_sql(&zErr);
19851985
g.dbIgnoreErrors++;
1986
- rc = sqlite3_prepare_v2(g.db, argv[1], TH1_LEN(argl[1]), &pStmt, &zTail);
1986
+ rc = sqlite3_prepare_v2(g.db, zSql, nSql, &pStmt, &zTail);
19871987
g.dbIgnoreErrors--;
19881988
report_unrestrict_sql();
19891989
if( rc!=0 || zErr!=0 ){
19901990
if( noComplain ) return TH_OK;
19911991
Th_ErrorMessage(interp, "SQL error: ",
19921992
--- src/th_main.c
+++ src/th_main.c
@@ -1981,11 +1981,11 @@
1981
1982 while( res==TH_OK && nSql>0 ){
1983 zErr = 0;
1984 report_restrict_sql(&zErr);
1985 g.dbIgnoreErrors++;
1986 rc = sqlite3_prepare_v2(g.db, argv[1], TH1_LEN(argl[1]), &pStmt, &zTail);
1987 g.dbIgnoreErrors--;
1988 report_unrestrict_sql();
1989 if( rc!=0 || zErr!=0 ){
1990 if( noComplain ) return TH_OK;
1991 Th_ErrorMessage(interp, "SQL error: ",
1992
--- src/th_main.c
+++ src/th_main.c
@@ -1981,11 +1981,11 @@
1981
1982 while( res==TH_OK && nSql>0 ){
1983 zErr = 0;
1984 report_restrict_sql(&zErr);
1985 g.dbIgnoreErrors++;
1986 rc = sqlite3_prepare_v2(g.db, zSql, nSql, &pStmt, &zTail);
1987 g.dbIgnoreErrors--;
1988 report_unrestrict_sql();
1989 if( rc!=0 || zErr!=0 ){
1990 if( noComplain ) return TH_OK;
1991 Th_ErrorMessage(interp, "SQL error: ",
1992

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button