OSDN Git Service

Stabilize regtests aganst testing environment.
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Mon, 9 Jun 2014 06:12:53 +0000 (15:12 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Mon, 9 Jun 2014 06:25:13 +0000 (15:25 +0900)
expected/ut-9.1.out
expected/ut-9.2.out
expected/ut-9.3.out
expected/ut-common.out
sql/ut-9.1.sql
sql/ut-9.2.sql
sql/ut-9.3.sql
sql/ut-common.sql

index de59814..4869a1e 100644 (file)
@@ -2132,8 +2132,9 @@ SELECT starelid, attname, stainherit FROM columns_locked_v c;
 DELETE FROM dbms_stats._relation_stats_locked;
 \set s1_st0_oid `psql contrib_regression -tA -c "SELECT c.oid FROM pg_class c, pg_namespace n WHERE c.relnamespace = n.oid AND n.nspname = 's1' AND c.relname = 'st0';"`
 DROP TABLE s1.st0;
-SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
-ERROR:  relation "16712" does not exist
+-- SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
+-- To avoid test unstability caused by relation id alloction, the test
+-- above is omitted.
 SELECT count(*) FROM dbms_stats.relation_stats_locked;
  count 
 -------
index 10a3c3b..bc5b17a 100644 (file)
@@ -2403,8 +2403,9 @@ SELECT starelid, attname, stainherit FROM columns_locked_v c;
 DELETE FROM dbms_stats._relation_stats_locked;
 \set s1_st0_oid `psql contrib_regression -tA -c "SELECT c.oid FROM pg_class c, pg_namespace n WHERE c.relnamespace = n.oid AND n.nspname = 's1' AND c.relname = 'st0';"`
 DROP TABLE s1.st0;
-SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
-ERROR:  relation "16712" does not exist
+-- SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
+-- To avoid test unstability caused by relation id alloction, the test
+-- above is omitted.
 SELECT count(*) FROM dbms_stats.relation_stats_locked;
  count 
 -------
index 2d75003..059e8e0 100644 (file)
@@ -2521,8 +2521,9 @@ SELECT starelid, attname, stainherit FROM columns_locked_v c;
 DELETE FROM dbms_stats._relation_stats_locked;
 \set s1_st0_oid `psql contrib_regression -tA -c "SELECT c.oid FROM pg_class c, pg_namespace n WHERE c.relnamespace = n.oid AND n.nspname = 's1' AND c.relname = 'st0';"`
 DROP TABLE s1.st0;
-SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
-ERROR:  relation "16712" does not exist
+-- SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
+-- To avoid test unstability caused by relation id alloction, the test
+-- above is omitted.
 SELECT count(*) FROM dbms_stats.relation_stats_locked;
  count 
 -------
index e88582c..1540efd 100644 (file)
@@ -1541,10 +1541,21 @@ SELECT count(*) FROM dbms_stats.relation_stats_backup;
      1
 (1 row)
 
-SELECT dbms_stats.backup(1, 's0.st0'::regclass, NULL);
-ERROR:  duplicate key value violates unique constraint "relation_stats_backup_pkey"
-DETAIL:  Key (id, relid)=(1, 16687) already exists.
-CONTEXT:  SQL function "backup" statement 1
+-- SELECT dbms_stats.backup(1, 's0.st0'::regclass, NULL);
+-- To avoid test unstability caused by relation id allocation, unique
+-- constraint which used to be checked above is now checked more
+-- directly in the following step.
+SELECT ic.relname idxname, i.indisprimary
+ FROM pg_index i
+ JOIN pg_class c ON (c.oid = i.indrelid)
+ JOIN pg_namespace n ON (n.oid = c.relnamespace)
+ JOIN pg_class ic ON (ic.oid = i.indexrelid)
+ WHERE n.nspname = 'dbms_stats' AND c.relname = 'relation_stats_backup';
+          idxname           | indisprimary 
+----------------------------+--------------
+ relation_stats_backup_pkey | t
+(1 row)
+
 SELECT count(*) FROM dbms_stats.relation_stats_backup;
  count 
 -------
index f0d5815..6face6e 100644 (file)
@@ -1106,7 +1106,10 @@ SELECT starelid, attname, stainherit FROM columns_locked_v c;
 DELETE FROM dbms_stats._relation_stats_locked;
 \set s1_st0_oid `psql contrib_regression -tA -c "SELECT c.oid FROM pg_class c, pg_namespace n WHERE c.relnamespace = n.oid AND n.nspname = 's1' AND c.relname = 'st0';"`
 DROP TABLE s1.st0;
-SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
+-- SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
+-- To avoid test unstability caused by relation id alloction, the test
+-- above is omitted.
+
 SELECT count(*) FROM dbms_stats.relation_stats_locked;
 SELECT count(*) FROM dbms_stats.column_stats_locked;
 CREATE TABLE s1.st0(id integer, num integer);
index 50b42dd..6f93bcc 100644 (file)
@@ -1250,7 +1250,10 @@ SELECT starelid, attname, stainherit FROM columns_locked_v c;
 DELETE FROM dbms_stats._relation_stats_locked;
 \set s1_st0_oid `psql contrib_regression -tA -c "SELECT c.oid FROM pg_class c, pg_namespace n WHERE c.relnamespace = n.oid AND n.nspname = 's1' AND c.relname = 'st0';"`
 DROP TABLE s1.st0;
-SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
+-- SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
+-- To avoid test unstability caused by relation id alloction, the test
+-- above is omitted.
+
 SELECT count(*) FROM dbms_stats.relation_stats_locked;
 SELECT count(*) FROM dbms_stats.column_stats_locked;
 CREATE TABLE s1.st0(id integer, num integer);
index 3b5c70e..47af64b 100644 (file)
@@ -1263,7 +1263,10 @@ SELECT starelid, attname, stainherit FROM columns_locked_v c;
 DELETE FROM dbms_stats._relation_stats_locked;
 \set s1_st0_oid `psql contrib_regression -tA -c "SELECT c.oid FROM pg_class c, pg_namespace n WHERE c.relnamespace = n.oid AND n.nspname = 's1' AND c.relname = 'st0';"`
 DROP TABLE s1.st0;
-SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
+-- SELECT dbms_stats.restore(2, :s1_st0_oid, NULL);
+-- To avoid test unstability caused by relation id alloction, the test
+-- above is omitted.
+
 SELECT count(*) FROM dbms_stats.relation_stats_locked;
 SELECT count(*) FROM dbms_stats.column_stats_locked;
 CREATE TABLE s1.st0(id integer, num integer);
index 297f335..1f84fcf 100644 (file)
@@ -629,7 +629,16 @@ SELECT starelid::regclass, staattnum FROM dbms_stats.column_stats_backup
  GROUP BY starelid, staattnum
  ORDER BY starelid, staattnum;
 SELECT count(*) FROM dbms_stats.relation_stats_backup;
-SELECT dbms_stats.backup(1, 's0.st0'::regclass, NULL);
+-- SELECT dbms_stats.backup(1, 's0.st0'::regclass, NULL);
+-- To avoid test unstability caused by relation id allocation, unique
+-- constraint which used to be checked above is now checked more
+-- directly in the following step.
+SELECT ic.relname idxname, i.indisprimary
+ FROM pg_index i
+ JOIN pg_class c ON (c.oid = i.indrelid)
+ JOIN pg_namespace n ON (n.oid = c.relnamespace)
+ JOIN pg_class ic ON (ic.oid = i.indexrelid)
+ WHERE n.nspname = 'dbms_stats' AND c.relname = 'relation_stats_backup';
 SELECT count(*) FROM dbms_stats.relation_stats_backup;
 SELECT count(*) FROM dbms_stats.column_stats_backup;