Skip to content

Commit 08fdfba

Browse files
authored
Merge pull request IvorySQL#851 from OreoYang/master
fix oracle regression test case status unstable
2 parents 3ffef63 + a1850e4 commit 08fdfba

2 files changed

Lines changed: 19 additions & 20 deletions

File tree

src/oracle_test/regress/expected/stats.out

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,23 +1481,21 @@ DECLARE
14811481
BEGIN
14821482
-- we don't want to wait forever; loop will exit after 30 seconds
14831483
FOR i IN 1 .. 300 LOOP
1484-
SELECT (pg_stat_get_tuples_hot_updated('brin_hot'::regclass::oid) > 0) INTO updated;
1485-
EXIT WHEN updated;
1484+
-- SELECT (pg_stat_get_tuples_hot_updated('brin_hot'::regclass::oid) > 0) INTO updated;
1485+
updated := (pg_stat_get_tuples_hot_updated('brin_hot'::regclass::oid) > 0);
1486+
-- EXIT WHEN updated;
1487+
if updated then
1488+
exit;
1489+
end if;
14861490

14871491
-- wait a little
14881492
PERFORM pg_sleep_for('100 milliseconds');
14891493
-- reset stats snapshot so we can test again
14901494
PERFORM pg_stat_clear_snapshot();
14911495
END LOOP;
1492-
-- report time waited in postmaster log (where it won't change test output)
1493-
RAISE log 'wait_for_hot_stats delayed % seconds',
1494-
EXTRACT(epoch FROM clock_timestamp() - start_time);
14951496
END
1496-
$$ LANGUAGE plpgsql;
1497+
$$ LANGUAGE plisql;
14971498
/
1498-
ERROR: syntax error at or near "FROM"
1499-
LINE 18: EXTRACT(epoch FROM clock_timestamp() - start_time);
1500-
^
15011499
UPDATE brin_hot SET val = -3 WHERE id = 42;
15021500
-- We can't just call wait_for_hot_stats() at this point, because we only
15031501
-- transmit stats when the session goes idle, and we probably didn't
@@ -1507,10 +1505,11 @@ UPDATE brin_hot SET val = -3 WHERE id = 42;
15071505
-- then send its stats before dying.
15081506
\c -
15091507
SELECT wait_for_hot_stats();
1510-
ERROR: function wait_for_hot_stats() does not exist
1511-
LINE 1: SELECT wait_for_hot_stats();
1512-
^
1513-
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
1508+
wait_for_hot_stats
1509+
--------------------
1510+
1511+
(1 row)
1512+
15141513
SELECT pg_stat_get_tuples_hot_updated('brin_hot'::regclass::oid);
15151514
pg_stat_get_tuples_hot_updated
15161515
--------------------------------
@@ -1519,7 +1518,6 @@ SELECT pg_stat_get_tuples_hot_updated('brin_hot'::regclass::oid);
15191518

15201519
DROP TABLE brin_hot;
15211520
DROP FUNCTION wait_for_hot_stats();
1522-
ERROR: function wait_for_hot_stats() does not exist
15231521
-- Test handling of index predicates - updating attributes in precicates
15241522
-- should not block HOT when summarizing indexes are involved. We update
15251523
-- a row that was not indexed due to the index predicate, and becomes

src/oracle_test/regress/sql/stats.sql

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -763,19 +763,20 @@ DECLARE
763763
BEGIN
764764
-- we don't want to wait forever; loop will exit after 30 seconds
765765
FOR i IN 1 .. 300 LOOP
766-
SELECT (pg_stat_get_tuples_hot_updated('brin_hot'::regclass::oid) > 0) INTO updated;
767-
EXIT WHEN updated;
766+
-- SELECT (pg_stat_get_tuples_hot_updated('brin_hot'::regclass::oid) > 0) INTO updated;
767+
updated := (pg_stat_get_tuples_hot_updated('brin_hot'::regclass::oid) > 0);
768+
-- EXIT WHEN updated;
769+
if updated then
770+
exit;
771+
end if;
768772

769773
-- wait a little
770774
PERFORM pg_sleep_for('100 milliseconds');
771775
-- reset stats snapshot so we can test again
772776
PERFORM pg_stat_clear_snapshot();
773777
END LOOP;
774-
-- report time waited in postmaster log (where it won't change test output)
775-
RAISE log 'wait_for_hot_stats delayed % seconds',
776-
EXTRACT(epoch FROM clock_timestamp() - start_time);
777778
END
778-
$$ LANGUAGE plpgsql;
779+
$$ LANGUAGE plisql;
779780
/
780781

781782
UPDATE brin_hot SET val = -3 WHERE id = 42;

0 commit comments

Comments
 (0)