[bug] For bug 45406.

Fix bug for PostgreSQL before 9.5
This commit is contained in:
Sergey Konovalov
2020-10-21 20:22:18 +03:00
committed by Sergey Konovalov
parent 28717580f2
commit 64eed40c3f

View File

@ -43,7 +43,11 @@ BEGIN
LOOP LOOP
-- first try to update the key -- first try to update the key
-- note that "a" must be unique -- note that "a" must be unique
UPDATE "public"."task_result" SET last_open_date=_last_open_date, user_index=user_index+1 WHERE id = _id RETURNING user_index into userindex; IF ((_callback <> '') IS TRUE) AND ((_baseurl <> '') IS TRUE) THEN
UPDATE "public"."task_result" SET last_open_date=_last_open_date, user_index=user_index+1,callback=_callback,baseurl=_baseurl WHERE id = _id RETURNING user_index into userindex;
ELSE
UPDATE "public"."task_result" SET last_open_date=_last_open_date, user_index=user_index+1 WHERE id = _id RETURNING user_index into userindex;
END IF;
IF found THEN IF found THEN
isupdate := 'true'; isupdate := 'true';
RETURN; RETURN;