silverstripe/silverstripe-postgresql — pull request #11 by tractorcow (2012-11-16 01:47:36+00:00)
Title: BUG Unescaped query fix

In the tableList() method a query is run against the pg_tables view, filtering out system tables that begin with either pg_ or sql_. However, since the underscore in each of these patterns was not being escaped properly, tables such as "SQLQueryTest_DO" were being unintentionally treated as system tables. With the ILIKE operator an underscore matches a single character.

In order to correctly match the underscore literal these characters were escaped with a backslash.

This fix is required to fix an annoying issue I had with SQLQuery tests failing in postgres. I could just rename the fixtures, but I'd rather fix the cause of the issue.