[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:
Kevin Locke
2015-06-06 20:29:58 -06:00
parent cf3f571dbf
commit c2f5a06ae6

View File

@ -233,6 +233,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);