You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unique key violation leads to server crash when the INSERT is preceded by a PL/pgSQL block that handled non-null violation exception.
Example:
yugabyte(26555)# DROP TABLE t1;
CREATE TABLE t1 (k int PRIMARY KEY);
DO $body$
BEGIN
INSERT INTO t1 (k) VALUES (null);
EXCEPTION
WHEN others THEN RAISE NOTICE '%', SQLERRM;
END;
$body$;
INSERT INTO t1 (k) VALUES (1);
INSERT INTO t1 (k) VALUES (1);
DROP TABLE
yugabyte(26555)# CREATE TABLE
yugabyte(26555)# yugabyte$# yugabyte$# yugabyte$# yugabyte$# yugabyte$# yugabyte$# NOTICE: null value in column "k" violates not-null constraint
DO
yugabyte(26555)# INSERT 0 1
yugabyte(26555)# server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
()> ()>
According to @d-uspenskiy, this issue is related to the code introduced as a part of the change for #9467, and I've verified that his suggested change fixes this, too.
Jira Link: DB-755
Description
Unique key violation leads to server crash when the INSERT is preceded by a PL/pgSQL block that handled non-null violation exception.
Example:
The backtrace and the failed ASSERT:
The text was updated successfully, but these errors were encountered: