Skip to content

Commit

Permalink
Set a protection again the "incorrect result of cleaning" error.
Browse files Browse the repository at this point in the history
See more details by the link [1]. The patch doesn't solve the error
but protects againsts kicking the logic off by a wrong data. Further
investigations of the issue [1] is required.

[1] #3
  • Loading branch information
grayhemp committed Sep 15, 2014
1 parent 58fe8d4 commit 45696aa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/PgToolkit/Compactor/Table.pm
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ sub _process {
$max_tupples_per_page.'.'),
level => 'warning',
target => $self->{'_log_target'});

$to_page = $last_to_page;
last;
}

$self->_commit();
Expand Down
22 changes: 22 additions & 0 deletions misc/scratch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,28 @@ FROM generate_series(1, 10000) i;
DELETE FROM table4
WHERE random() < 0.9;
--
CREATE TABLE table4_p1 () INHERITS (table4);
INSERT INTO table4_p1
SELECT
i AS id,
repeat(
(random() * 1000000)::text,
(random() * 50000)::integer) AS text_column
FROM generate_series(1, 10000) i;
DELETE FROM table4_p1
WHERE random() < 0.3;
--
CREATE TABLE table4_p2 () INHERITS (table4);
INSERT INTO table4_p2
SELECT
i AS id,
repeat(
(random() * 1000000)::text,
(random() * 50000)::integer) AS text_column
FROM generate_series(1, 10000) i;
DELETE FROM table4_p2
WHERE random() < 0.6;
--
CREATE SCHEMA dummy;
--
ALTER DATABASE dbname1 SET search_path TO dummy;
Expand Down

0 comments on commit 45696aa

Please sign in to comment.