This issue causes pagination to fail for search results on sites
using the postgres db.
Patch corrects the TotalItems in the returned List to show all items
matching the search criteria rather than just the items returned in
the current 'page' requested.
This issue causes the comparison to fail if comparing a non text fields (for example, a date or integer). This will cause the CMS to fail in places such as Gridfield selector.
Similar fix as this one: https://github.com/silverstripe/silverstripe-framework/pull/2242 The difference being comparisonClause(...) being more apt solution in SS 3.1
Previous implementation of PostgreSQLDatabase::selectDatabase() just updated internal
registers, and expected connectDatabase() or similar to be called. This is out of line
with MySQLDatabase's behaviour, and frankly a bit stupid. FullTextSearch's test system
expected different behaviour from selectDatabase() and so this is needed to fix that.
Since it's making PostgreSQLDatabase match the behaviour of MySQLDatabase, I don't consider
it an API change.
When clearing tables this will delete all rows instead of truncating it.
Benchmarking this change by running the full cms and framework test suit changed improved the running time from 32 minutes to 9 minutes.
If truncate functionality is needed for any special cases it should be run as
DB::query("TRUNCATE \"TableToTruncate\"");
In prepration for https://github.com/silverstripe/sapphire/pull/1319
Probably should accept this at the same time.
If someone knows of the relevant ALTER permissions in Postgres, feel free to implment.
When a postgres db server is down or credentials are wrone, the adapter still tries to check for a existing database and loops back into trying to connect again.
This caused tables starting with "sql" to be excluded from
the tableList() results, where only "sql_" should be filtered.
An unescaped underscore in ANSI SQL pattern matching stands
for "any single character", the escape needed to be doubled
to account for PHP's own escape expanding.
This broke SQLQueryTest since the test data wasn't reset
between test runs.
UPDATED: Syntax to conform (better) to SS coding convention
UPDATED: Refactor, cleanup, and simplification of alterTable to reduce duplication of effort. Use of index parsing mechanism to pre-prepare indexe specifications for generation.
UPDATED: Better naming of variables (For instance, $indexName instead of $k)
BUG: Index generation is still not working properly. To investigate.