Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | When reporting database errors in CGI mode, make sure the CGI header comes out first. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
3dce979214cc309749697d2982c77fac |
| User & Date: | drh 2008-05-24 13:30:36.000 |
Context
|
2008-05-24
| ||
| 16:02 | Clarification of wiki formatting rules. check-in: 3beb385964 user: drh tags: trunk | |
| 13:30 | When reporting database errors in CGI mode, make sure the CGI header comes out first. check-in: 3dce979214 user: drh tags: trunk | |
| 02:34 | Fix the "card count" on sync to include the configuration cards sent and received. check-in: d53af79c81 user: drh tags: trunk | |
Changes
Changes to src/db.c.
| ︙ | ︙ | |||
63 64 65 66 67 68 69 |
va_list ap;
char *z;
va_start(ap, zFormat);
z = vmprintf(zFormat, ap);
va_end(ap);
if( g.cgiPanic ){
g.cgiPanic = 0;
| | | | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
va_list ap;
char *z;
va_start(ap, zFormat);
z = vmprintf(zFormat, ap);
va_end(ap);
if( g.cgiPanic ){
g.cgiPanic = 0;
cgi_printf("<h1>Database Error</h1>\n"
"<pre>%h</pre>", z);
cgi_reply();
}else{
fprintf(stderr, "%s: %s\n", g.argv[0], z);
}
db_force_rollback();
exit(1);
}
|
| ︙ | ︙ | |||
175 176 177 178 179 180 181 |
int db_vprepare(Stmt *pStmt, const char *zFormat, va_list ap){
char *zSql;
blob_zero(&pStmt->sql);
blob_vappendf(&pStmt->sql, zFormat, ap);
va_end(ap);
zSql = blob_str(&pStmt->sql);
if( sqlite3_prepare_v2(g.db, zSql, -1, &pStmt->pStmt, 0)!=0 ){
| | | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
int db_vprepare(Stmt *pStmt, const char *zFormat, va_list ap){
char *zSql;
blob_zero(&pStmt->sql);
blob_vappendf(&pStmt->sql, zFormat, ap);
va_end(ap);
zSql = blob_str(&pStmt->sql);
if( sqlite3_prepare_v2(g.db, zSql, -1, &pStmt->pStmt, 0)!=0 ){
db_err("%s\n%s", sqlite3_errmsg(g.db), zSql);
}
pStmt->pNext = pStmt->pPrev = 0;
return 0;
}
int db_prepare(Stmt *pStmt, const char *zFormat, ...){
int rc;
va_list ap;
|
| ︙ | ︙ | |||
209 210 211 212 213 214 215 |
/*
** Return the index of a bind parameter
*/
static int paramIdx(Stmt *pStmt, const char *zParamName){
int i = sqlite3_bind_parameter_index(pStmt->pStmt, zParamName);
if( i==0 ){
| | | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
/*
** Return the index of a bind parameter
*/
static int paramIdx(Stmt *pStmt, const char *zParamName){
int i = sqlite3_bind_parameter_index(pStmt->pStmt, zParamName);
if( i==0 ){
db_err("no such bind parameter: %s\nSQL: %b", zParamName, &pStmt->sql);
}
return i;
}
/*
** Bind an integer, string, or Blob value to a named parameter.
*/
int db_bind_int(Stmt *pStmt, const char *zParamName, int iValue){
|
| ︙ | ︙ |