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.
Commit
b0a9eb39348702bae0a4eb4a718a392c7df3afecf17457091f534c930a19f760
Parent
6bcb3a6c4557f7f…
1 file changed
+1
-1
+1
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -1981,11 +1981,11 @@ | ||
| 1981 | 1981 | |
| 1982 | 1982 | while( res==TH_OK && nSql>0 ){ |
| 1983 | 1983 | zErr = 0; |
| 1984 | 1984 | report_restrict_sql(&zErr); |
| 1985 | 1985 | 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); | |
| 1987 | 1987 | g.dbIgnoreErrors--; |
| 1988 | 1988 | report_unrestrict_sql(); |
| 1989 | 1989 | if( rc!=0 || zErr!=0 ){ |
| 1990 | 1990 | if( noComplain ) return TH_OK; |
| 1991 | 1991 | Th_ErrorMessage(interp, "SQL error: ", |
| 1992 | 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, 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 |