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.
Commit
11e2cce1f9af37f22fd049ebce59b6939aeac6005c1f45bb804fad8c44f5e0ed
Parent
6cce924fa9725a1…
1 file changed
+4
-1
+4
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -2005,11 +2005,14 @@ | ||
| 2005 | 2005 | return TH_ERROR; |
| 2006 | 2006 | } |
| 2007 | 2007 | n = (int)(zTail - zSql); |
| 2008 | 2008 | zSql += n; |
| 2009 | 2009 | nSql -= n; |
| 2010 | - if( pStmt==0 ) continue; | |
| 2010 | + if( pStmt==0 ){ | |
| 2011 | + if( n==0 ) break; | |
| 2012 | + continue; | |
| 2013 | + } | |
| 2011 | 2014 | nVar = sqlite3_bind_parameter_count(pStmt); |
| 2012 | 2015 | for(i=1; i<=nVar; i++){ |
| 2013 | 2016 | const char *zVar = sqlite3_bind_parameter_name(pStmt, i); |
| 2014 | 2017 | int szVar = zVar ? th_strlen(zVar) : 0; |
| 2015 | 2018 | if( szVar>1 && zVar[0]=='$' |
| 2016 | 2019 |
| --- 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 |