- #7295: Fixing issue with latest comments being incorrectly displayed on PostgreSQL
parent
b8d653f1e8
commit
c16ada8c46
|
@ -681,8 +681,11 @@ INSERT INTO blocks(module,delta,status) VALUES('user', '1', '1');
|
|||
--- Functions
|
||||
---
|
||||
|
||||
CREATE FUNCTION "greatest"(integer, integer) RETURNS integer AS '
|
||||
CREATE FUNCTION greatest(integer, integer) RETURNS integer AS '
|
||||
BEGIN
|
||||
IF $2 IS NULL THEN
|
||||
RETURN $1;
|
||||
END IF;
|
||||
IF $1 > $2 THEN
|
||||
RETURN $1;
|
||||
END IF;
|
||||
|
|
|
@ -65,6 +65,7 @@ $sql_updates = array(
|
|||
"2004-06-30" => "update_91",
|
||||
"2004-07-07" => "update_92",
|
||||
"2004-07-11" => "update_93",
|
||||
"2004-07-22" => "update_94"
|
||||
);
|
||||
|
||||
function update_32() {
|
||||
|
@ -1162,6 +1163,30 @@ function update_93() {
|
|||
return $ret;
|
||||
}
|
||||
|
||||
function update_94() {
|
||||
/**
|
||||
* Postgres only update
|
||||
*/
|
||||
$ret = array();
|
||||
if ($GLOBALS['db_type'] == 'pgsql') {
|
||||
$ret[] = update_sql('DROP FUNCTION "greatest"(integer, integer)');
|
||||
$ret[] = update_sql("
|
||||
CREATE FUNCTION greatest(integer, integer) RETURNS integer AS '
|
||||
BEGIN
|
||||
IF $2 IS NULL THEN
|
||||
RETURN $1;
|
||||
END IF;
|
||||
IF $1 > $2 THEN
|
||||
RETURN $1;
|
||||
END IF;
|
||||
RETURN $2;
|
||||
END;
|
||||
' LANGUAGE 'plpgsql';
|
||||
");
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function update_sql($sql) {
|
||||
$edit = $_POST["edit"];
|
||||
$result = db_query($sql);
|
||||
|
|
Loading…
Reference in New Issue