Fossil SCM

In the TH1 query command, stop when the remaining SQL holds no statement and nothing was consumed, as at a NUL byte, rather than trying the same text again for ever.

dmestas 2026-11-22 11:02 UTC small-fixes
Commit 11e2cce1f9af37f22fd049ebce59b6939aeac6005c1f45bb804fad8c44f5e0ed
1 file changed +4 -1
+4 -1
--- src/th_main.c
+++ src/th_main.c
@@ -2005,11 +2005,14 @@
20052005
return TH_ERROR;
20062006
}
20072007
n = (int)(zTail - zSql);
20082008
zSql += n;
20092009
nSql -= n;
2010
- if( pStmt==0 ) continue;
2010
+ if( pStmt==0 ){
2011
+ if( n==0 ) break;
2012
+ continue;
2013
+ }
20112014
nVar = sqlite3_bind_parameter_count(pStmt);
20122015
for(i=1; i<=nVar; i++){
20132016
const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
20142017
int szVar = zVar ? th_strlen(zVar) : 0;
20152018
if( szVar>1 && zVar[0]=='$'
20162019
--- src/th_main.c
+++ src/th_main.c
@@ -2005,11 +2005,14 @@
2005 return TH_ERROR;
2006 }
2007 n = (int)(zTail - zSql);
2008 zSql += n;
2009 nSql -= n;
2010 if( pStmt==0 ) continue;
 
 
 
2011 nVar = sqlite3_bind_parameter_count(pStmt);
2012 for(i=1; i<=nVar; i++){
2013 const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
2014 int szVar = zVar ? th_strlen(zVar) : 0;
2015 if( szVar>1 && zVar[0]=='$'
2016
--- src/th_main.c
+++ src/th_main.c
@@ -2005,11 +2005,14 @@
2005 return TH_ERROR;
2006 }
2007 n = (int)(zTail - zSql);
2008 zSql += n;
2009 nSql -= n;
2010 if( pStmt==0 ){
2011 if( n==0 ) break;
2012 continue;
2013 }
2014 nVar = sqlite3_bind_parameter_count(pStmt);
2015 for(i=1; i<=nVar; i++){
2016 const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
2017 int szVar = zVar ? th_strlen(zVar) : 0;
2018 if( szVar>1 && zVar[0]=='$'
2019

Keyboard Shortcuts

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