[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:
1 parent
cf3f571dbf
commit
c2f5a06ae6
1 file changed
+3
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user