You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by re...@apache.org on 2025/01/23 14:13:31 UTC
(cloudberry) 11/16: Fix gpsd test flakes
This is an automated email from the ASF dual-hosted git repository.
reshke pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit c0230d50b48174a2c06e7723277832ec3f09a2de
Author: Chris Hajas <ch...@vmware.com>
AuthorDate: Mon Mar 4 15:46:30 2024 -0800
Fix gpsd test flakes
By explicitly updating pg_statistic, there is the possibility that
autoanalyze analyzes the table between when it is set and when we check
for the expected result. In this case, the intent of the test is to
ensure gpsd dumps quotes. I've added a row with single quotes and
removed the explicit update of pg_statistic.
---
src/test/regress/expected/gpsd.out | 19 ++++++++-----------
src/test/regress/sql/gpsd.sql | 8 ++------
2 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/src/test/regress/expected/gpsd.out b/src/test/regress/expected/gpsd.out
index 2dfd9d7b43..d466e7ca13 100644
--- a/src/test/regress/expected/gpsd.out
+++ b/src/test/regress/expected/gpsd.out
@@ -53,17 +53,14 @@ create database gpsd_db_without_hll;
create table gpsd_foo(a int, s text) partition by range(a);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
-create table gpsd_foo_1 partition of gpsd_foo for values from (1) to (5);
+create table gpsd_foo_1 partition of gpsd_foo for values from (1) to (6);
NOTICE: table has parent, setting distribution columns to match parent table
insert into gpsd_foo values(1, 'something');
insert into gpsd_foo values(2, chr(1000));
insert into gpsd_foo values(3, chr(105));
insert into gpsd_foo values(4, 'a \ and a "');
+insert into gpsd_foo values(5, 'z''world''');
analyze gpsd_foo;
--- arbitrarily populate stats data values having text (with quotes) in a slot
--- (without paying heed to the slot's stakind) to test dumpability
-set allow_system_table_mods to on;
-update pg_statistic set stavalues3='{"hello", "''world''"}'::text[] where starelid='gpsd_foo'::regclass and staattnum=2;
-- start_ignore
-- end_ignore
\c regression
@@ -104,12 +101,12 @@ select
stavalues4,
stavalues5
from pg_statistic where starelid IN ('gpsd_foo'::regclass, 'gpsd_foo_1'::regclass);
- staattnum | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stacoll1 | stacoll2 | stacoll3 | stacoll4 | stacoll5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
------------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+----------+----------+----------+----------+----------+-------------+-------------+-------------+-------------+-------------+---------------------------------+------------+-----------------+------------+------------
- 1 | t | 0 | 4 | -1 | 2 | 0 | 0 | 0 | 0 | 97 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | | | | | {1,2,3,4} | | | |
- 2 | t | 0 | 6 | -1 | 2 | 0 | 0 | 0 | 0 | 664 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | | | | | {"a \\ and a \"",i,something,Ϩ} | | {hello,'world'} | |
- 1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | {1} | | | | {1,2,3,4} | | | |
- 2 | f | 0 | 6 | -1 | 2 | 3 | 0 | 0 | 0 | 664 | 664 | 0 | 0 | 0 | 100 | 100 | 0 | 0 | 0 | | {-1} | | | | {"a \\ and a \"",i,something,Ϩ} | | | |
+ staattnum | stainherit | stanullfrac | stawidth | stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2 | staop3 | staop4 | staop5 | stacoll1 | stacoll2 | stacoll3 | stacoll4 | stacoll5 | stanumbers1 | stanumbers2 | stanumbers3 | stanumbers4 | stanumbers5 | stavalues1 | stavalues2 | stavalues3 | stavalues4 | stavalues5
+-----------+------------+-------------+----------+-------------+----------+----------+----------+----------+----------+--------+--------+--------+--------+--------+----------+----------+----------+----------+----------+-------------+-------------+-------------+-------------+-------------+------------------------------------------+------------+------------+------------+------------
+ 1 | t | 0 | 4 | -1 | 2 | 0 | 0 | 0 | 0 | 97 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | | | | | {1,2,3,4,5} | | | |
+ 2 | t | 0 | 7 | -1 | 2 | 0 | 0 | 0 | 0 | 664 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | | | | | {"a \\ and a \"",i,something,z'world',Ϩ} | | | |
+ 1 | f | 0 | 4 | -1 | 2 | 3 | 0 | 0 | 0 | 97 | 97 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | {1} | | | | {1,2,3,4,5} | | | |
+ 2 | f | 0 | 7 | -1 | 2 | 3 | 0 | 0 | 0 | 664 | 664 | 0 | 0 | 0 | 100 | 100 | 0 | 0 | 0 | | {-1} | | | | {"a \\ and a \"",i,something,z'world',Ϩ} | | | |
(4 rows)
--------------------------------------------------------------------------------
diff --git a/src/test/regress/sql/gpsd.sql b/src/test/regress/sql/gpsd.sql
index 2cb932600f..494d708e89 100644
--- a/src/test/regress/sql/gpsd.sql
+++ b/src/test/regress/sql/gpsd.sql
@@ -18,18 +18,14 @@ create database gpsd_db_without_hll;
\c gpsd_db_without_hll
create table gpsd_foo(a int, s text) partition by range(a);
-create table gpsd_foo_1 partition of gpsd_foo for values from (1) to (5);
+create table gpsd_foo_1 partition of gpsd_foo for values from (1) to (6);
insert into gpsd_foo values(1, 'something');
insert into gpsd_foo values(2, chr(1000));
insert into gpsd_foo values(3, chr(105));
insert into gpsd_foo values(4, 'a \ and a "');
+insert into gpsd_foo values(5, 'z''world''');
analyze gpsd_foo;
--- arbitrarily populate stats data values having text (with quotes) in a slot
--- (without paying heed to the slot's stakind) to test dumpability
-set allow_system_table_mods to on;
-update pg_statistic set stavalues3='{"hello", "''world''"}'::text[] where starelid='gpsd_foo'::regclass and staattnum=2;
-
-- start_ignore
\! PYTHONIOENCODING=utf-8 gpsd gpsd_db_without_hll > data/gpsd-without-hll.sql
-- end_ignore
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org