# # # patch "ChangeLog" # from [f260fa063aed5d6bb30b92971e05f919a11914a6] # to [93d76946e23624c4eb829ed3da6ef24739d06a9c] # # patch "database.cc" # from [06897263dccafc0cc2cfd8f521c14865ecf4ac61] # to [5fca8cee415dc3f9fe41146aff97f5532516511b] # # patch "schema_migration.cc" # from [25babf72cf8481272d90e00dc6694835a6c7c12d] # to [f820f10c5c4992df47354a9653d89a6de21c3a87] # ============================================================ --- ChangeLog f260fa063aed5d6bb30b92971e05f919a11914a6 +++ ChangeLog 93d76946e23624c4eb829ed3da6ef24739d06a9c @@ -1,3 +1,10 @@ +2006-03-22 Matt Johnston + + * schema_migration.cc, database.cc: print a more helpful + error message when we fail in calculate_schema_id() (usually + because of locking). Don't bother telling the user what the + sqlite error number is (but still log it). + 2006-03-20 Matt Johnston * configure.ac: use test -f rather than test -e, since Solaris's ============================================================ --- database.cc 06897263dccafc0cc2cfd8f521c14865ecf4ac61 +++ database.cc 5fca8cee415dc3f9fe41146aff97f5532516511b @@ -248,6 +248,8 @@ // errno's. L(FL("sqlite error: %d: %s") % errcode % errmsg); } + // note: if you update this, try to keep calculate_schema_id() in + // schema_migration.cc consistent. std::string auxiliary_message = ""; if (errcode == SQLITE_ERROR) { @@ -257,7 +259,7 @@ // if the last message is empty, the \n will be stripped off too E(errcode == SQLITE_OK, // kind of string surgery to avoid ~duplicate strings - F("sqlite error: %d: %s\n%s") % errcode % errmsg % auxiliary_message); + F("sqlite error: %s\n%s") % errmsg % auxiliary_message); } struct sqlite3 * ============================================================ --- schema_migration.cc 25babf72cf8481272d90e00dc6694835a6c7c12d +++ schema_migration.cc f820f10c5c4992df47354a9653d89a6de21c3a87 @@ -177,8 +177,19 @@ &append_sql_stmt, &tmp, NULL); if (res != SQLITE_OK) { + // note: useful error messages should be kept consistent with + // assert_sqlite3_ok() in database.cc + string errmsg(sqlite3_errmsg(sql)); + L(FL("calculate_schema_id sqlite error: %d: %s") % res % errmsg); + std::string auxiliary_message = ""; + if (res == SQLITE_ERROR) + { + auxiliary_message += _("make sure database and containing directory are writeable\n" + "and you have not run out of disk space"); + + } logged_sqlite3_exec(sql, "ROLLBACK", NULL, NULL, NULL); - E(false, F("failure extracting schema from sqlite_master")); + E(false, F("sqlite error: %s\n%s") % errmsg % auxiliary_message); } massage_sql_tokens(tmp, tmp2); calculate_id(tmp2, id);