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
create extension if not exists pgcrypto;
drop table if exists funds;
-- creating a table with duplicate values for k.
create table funds(k integer, u uuid default gen_random_uuid(), v integer);
insert into funds(k, v) values (1, 1);
insert into funds(k, v) values (1, 1);
insert into funds(k, v) values (1, 1);
-- deduplicate rows with same k. Keep only the one with largest value of u.
delete from funds f1
using funds f2
where f1.u < f2.u and f1.k = f2.k;
select * from funds;
We would expect the DELETE to delete two rows, but it seems to be reporting an incorrect number of rows (3).
delete from funds f1
using funds f2
where f1.u < f2.u and f1.k = f2.k;
DELETE 3
It seems to be just a reporting mistake. Because table does seem to have 1 remaining row left and only 2 rows seem to have gotten deleted.
select * from funds;
k | u | v
---+--------------------------------------+---
1 | bb7e5ed3-2cf8-45be-8c3e-e568c7e8b4ba | 1
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
I confirm this issue does not contain any sensitive information.
The text was updated successfully, but these errors were encountered:
Summary:
This commit fixes an issue where the deleted row count was incorrect
when using the USING clause. The problem was caused by the
target_tuple_fetched variable always being set to true, preventing
rows_affected_count from updating correctly and skipping the break
statement. As a result,es_processed was not incremented as expected.
Changes:
1. Fixed the incorrect row count issue by ensuring target_tuple_fetched
is set correctly.
2.Added a Java test (TestPgDelete) to verify the fix.
Fixesyugabyte#25305
Test Plan:
Added a Java test (TestPgDelete), which now passes successfully.
Uh oh!
There was an error while loading. Please reload this page.
Jira Link: DB-14503
Description
Test Case:
We would expect the DELETE to delete two rows, but it seems to be reporting an incorrect number of rows (3).
It seems to be just a reporting mistake. Because table does seem to have 1 remaining row left and only 2 rows seem to have gotten deleted.
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: