Fossil

Check-in [0c0f268f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the db_is_writable() routine to return FALSE if the database is not even open.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0c0f268ff3fd2b0b12d936ac0e3c9b7418e908af
User & Date: drh 2012-07-19 15:41:24
References
2012-07-19
18:03
Merged in [0c0f268ff3], minor th1-internal doc addition. check-in: 56db3533 user: stephan tags: th1-query-api
Context
2012-07-19
18:41
/ci_edit now auto-checks the Add Tag checkbox if the user types in the tag name field. Thanks to Nolan D. for the suggestion and Steve H. for the graceful solution. check-in: 542f989a user: stephan tags: trunk
18:03
Merged in [0c0f268ff3], minor th1-internal doc addition. check-in: 56db3533 user: stephan tags: th1-query-api
15:41
Fix the db_is_writable() routine to return FALSE if the database is not even open. check-in: 0c0f268f user: drh tags: trunk
2012-07-17
16:55
Separate the download links on the "info" and "ci" pages onto a separate line with a separate label. check-in: 7ee938f4 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/db.c.

  1025   1025                      "   AND value<>'%s'", AUX_SCHEMA);
  1026   1026   }
  1027   1027   
  1028   1028   /*
  1029   1029   ** Return true if the database is writeable
  1030   1030   */
  1031   1031   int db_is_writeable(const char *zName){
  1032         -  return !sqlite3_db_readonly(g.db, db_name(zName));
         1032  +  return g.db!=0 && !sqlite3_db_readonly(g.db, db_name(zName));
  1033   1033   }
  1034   1034   
  1035   1035   /*
  1036   1036   ** Verify that the repository schema is correct.  If it is not correct,
  1037   1037   ** issue a fatal error and die.
  1038   1038   */
  1039   1039   void db_verify_schema(void){