mirror of
https://github.com/PostgreSQL-For-Wordpress/postgresql-for-wordpress.git
synced 2025-07-30 17:57:13 +02:00
[nextgen-gallery] Support SIGNED data type in CAST()
MySQL recognizes SIGNED and UNSIGNED in place of SIGNED INTEGER and UNSIGNED INTEGER. Notice this in calls to CAST() and replace it with INTEGER (which is signed by default). Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
This commit is contained in:
@ -234,6 +234,9 @@
|
||||
// Handle CAST( ... AS CHAR)
|
||||
$sql = preg_replace( '/CAST\((.+) AS CHAR\)/', 'CAST($1 AS TEXT)', $sql);
|
||||
|
||||
// Handle CAST( ... AS SIGNED)
|
||||
$sql = preg_replace( '/CAST\((.+) AS SIGNED\)/', 'CAST($1 AS INTEGER)', $sql);
|
||||
|
||||
// Handle COUNT(*)...ORDER BY...
|
||||
$sql = preg_replace( '/COUNT(.+)ORDER BY.+/s', 'COUNT$1', $sql);
|
||||
|
||||
|
Reference in New Issue
Block a user