Added a handle for converting CAST(... AS CHAR) to CAST(... AS TEXT) (Problem pointed out by Aart Jan)

git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@542064 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
hawk__
2012-05-09 20:59:27 +00:00
parent cd0b6c4916
commit 4cc22003a8

View File

@ -201,6 +201,9 @@
$sql = preg_replace( $pattern, 'SELECT COUNT($1) $2', $sql);
}
// Handle CAST( ... AS CHAR)
$sql = preg_replace( '/CAST\((.+) AS CHAR\)/', 'CAST($1 AS TEXT)', $sql);
// Handle COUNT(*)...ORDER BY...
$sql = preg_replace( '/COUNT(.+)ORDER BY.+/', 'COUNT$1', $sql);