Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible record key hash corruption on insert after an update #52

Open
monok0 opened this issue May 23, 2023 · 0 comments
Open

Possible record key hash corruption on insert after an update #52

monok0 opened this issue May 23, 2023 · 0 comments

Comments

@monok0
Copy link

monok0 commented May 23, 2023

PostgreSQL 14.6 (Ubuntu 14.6-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
pg_variables 1.2.5

I discovered erroneous behaviour with chains of updates to the record variable followed by an insert. The following script makes pgv_select claim that there is no record with key 33, but pgv_select on the whole collection shows, that the record is there. After that it is also possible to insert another record with key 33, meaning that the original record is either lost or its key hash is corrupted.
In addition, if you add or remove a single update, it works fine, showing the record.

`Select pgv_free();
select pgv_insert('test', 'aaa', row(33::text, 'data2'::text));
select pgv_update('test','aaa', row(33::text, 'data2'::text));
select pgv_update('test','aaa', row(33::text, 'data2'::text));
select pgv_update('test','aaa', row(33::text, 'data2'::text));
select pgv_insert('test','aaa', row(32::text, 'data3'::text));

Select pgv_select('test', 'aaa', '33'::text), array(select pgv_select('test', 'aaa'));`

Output of this script
изображение

Output with one update removed
изображение

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant