(bug 38406) Properly quote table names in DatabaseBase::tableName()
Currently the logic is the following:
$database = ( $format == 'quoted' || $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) );
This means that $database will *not* be quoted if $format is set to 'quoted',
which is the opposite of what we want here. Instead I just copied the code
used to quote $table just below and replace the variable.
This causes SQL syntax errors when the shared table name contain hyphens
since it is not quoted.
No RELEASE-NOTES entry since this should be backported to 1.19 once merged.
Patchset #2: added some tests
Patchset #3: fix tests for SQLite
Change-Id: Idda844cb470454a9a22001a31b6692de49892ca2