Re: Fix tuple deformation with virtual generated NOT NULL columns - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fix tuple deformation with virtual generated NOT NULL columns
Date
Msg-id 1174236.1781736349@sss.pgh.pa.us
Whole thread
In response to Re: Fix tuple deformation with virtual generated NOT NULL columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Fix tuple deformation with virtual generated NOT NULL columns
List pgsql-hackers
I wrote:
> Speculating wildly, I'm wondering about an uninitialized variable that
> happens to usually have the right value.

Nope: valgrind finds nothing, and neither does debug_discard_caches.
What does reproduce it, with seeming 100% reliability, is

set jit = 1;
set jit_above_cost = 0;
set jit_optimize_above_cost = 1000;
CREATE TABLE gtest21c (a int NOT NULL, b int GENERATED ALWAYS AS (a * 2) VIRTUAL NOT NULL, c int NOT NULL);
INSERT INTO gtest21c (a, c) VALUES (10, 42);
table gtest21c;

I conclude that something in the JIT code for tuple formation
is unaware of virtual generated columns.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fix tuple deformation with virtual generated NOT NULL columns
Next
From: Peter Smith
Date:
Subject: Re: DOCS - Clarify behaviour when EXCEPT tables are moved/renamed