https://bugzilla.wikimedia.org/show_bug.cgi?id=20260

           Summary: SQLite: don't always autocreate DB and its directory
           Product: MediaWiki
           Version: 1.16-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: Database
        AssignedTo: [email protected]
        ReportedBy: [email protected]
            Blocks: 20257


Currently $wgSQLiteDataDir is created not only by installer, but also by
DatabaseSqlite::__construct, and the database file is silently created if it
does not exists, which leads to a few problems:
1) If $wgSQLiteDataDir is empty, the directory defaults to
dirname($_SERVER['DOCUMENT_ROOT']).'/data'. However, if MediaWiki is not
installed in the document root, the data directory will be different for web
scripts and command line maintenance scripts, which will fail with cryptic SQL
errors.
2) If the database file is inaccessible to MW post-install, it will be
transparently recreated and pageviews will result in SQL error messages. An
equivalent of MySQL's "Can't contact database server" would be much more
appropriate.

So my proposal is to check DB file accessibility in DatabaseSqlite constructor,
and throw exceptions instead of creating useless empty databases. This should
also result in deprecation $wgSQLiteDataDirMode, as this value should and needs
to be specified by user during installation once and forever.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to