Fossil SCM
Attempt to augment the "attempt to write a readonly database" error from Fossil by listing all databases it is using that are read-only.
Commit
0ea8703b60c604d768efcdc27786cf470245f8ad04e1964fd5f5770aa5eb3b29
Parent
1c9d5cd81dd0531…
1 file changed
+10
M
src/db.c
+10
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -125,10 +125,20 @@ | ||
| 125 | 125 | #endif /* FOSSIL_ENABLE_JSON */ |
| 126 | 126 | if( g.xferPanic && g.cgiOutput==1 ){ |
| 127 | 127 | cgi_reset_content(); |
| 128 | 128 | @ error Database\serror:\s%F(z) |
| 129 | 129 | cgi_reply(); |
| 130 | + } | |
| 131 | + if( strstr(z,"attempt to write a readonly database") ){ | |
| 132 | + static const char *azDbNames[] = { "repository", "localdb", "configdb" }; | |
| 133 | + int i; | |
| 134 | + for(i=0; i<3; i++){ | |
| 135 | + if( sqlite3_db_readonly(g.db, azDbNames[i])==1 ){ | |
| 136 | + z = mprintf("\"%s\" is readonly.\n%s", | |
| 137 | + sqlite3_db_filename(g.db,azDbNames[i]), z); | |
| 138 | + } | |
| 139 | + } | |
| 130 | 140 | } |
| 131 | 141 | fossil_fatal("Database error: %s", z); |
| 132 | 142 | } |
| 133 | 143 | |
| 134 | 144 | /* |
| 135 | 145 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -125,10 +125,20 @@ | |
| 125 | #endif /* FOSSIL_ENABLE_JSON */ |
| 126 | if( g.xferPanic && g.cgiOutput==1 ){ |
| 127 | cgi_reset_content(); |
| 128 | @ error Database\serror:\s%F(z) |
| 129 | cgi_reply(); |
| 130 | } |
| 131 | fossil_fatal("Database error: %s", z); |
| 132 | } |
| 133 | |
| 134 | /* |
| 135 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -125,10 +125,20 @@ | |
| 125 | #endif /* FOSSIL_ENABLE_JSON */ |
| 126 | if( g.xferPanic && g.cgiOutput==1 ){ |
| 127 | cgi_reset_content(); |
| 128 | @ error Database\serror:\s%F(z) |
| 129 | cgi_reply(); |
| 130 | } |
| 131 | if( strstr(z,"attempt to write a readonly database") ){ |
| 132 | static const char *azDbNames[] = { "repository", "localdb", "configdb" }; |
| 133 | int i; |
| 134 | for(i=0; i<3; i++){ |
| 135 | if( sqlite3_db_readonly(g.db, azDbNames[i])==1 ){ |
| 136 | z = mprintf("\"%s\" is readonly.\n%s", |
| 137 | sqlite3_db_filename(g.db,azDbNames[i]), z); |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | fossil_fatal("Database error: %s", z); |
| 142 | } |
| 143 | |
| 144 | /* |
| 145 |