Excluded converting "NULLIF", patch received from Jamie Strachan
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@418089 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
@@ -156,8 +156,8 @@
|
||||
$curryear = date( 'Y');
|
||||
$sql = str_replace( 'FROM \''.$curryear, 'FROM TIMESTAMP \''.$curryear, $sql);
|
||||
|
||||
// MySQL 'IF' conversion
|
||||
$pattern = '/ IF[ ]*\(([^,]+),([^,]+),([^\)]+)\)/';
|
||||
// MySQL 'IF' conversion - Note : NULLIF doesn't need to be corrected
|
||||
$pattern = '/ (?<!NULL)IF[ ]*\(([^,]+),([^,]+),([^\)]+)\)/';
|
||||
$sql = preg_replace( $pattern, ' CASE WHEN $1 THEN $2 ELSE $3 END', $sql);
|
||||
|
||||
$sql = str_replace('GROUP BY '.$table_prefix.'posts."ID"', '' , $sql);
|
||||
|
Reference in New Issue
Block a user