mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 02:53:51 +08:00
Fix flaky data_node_bootstrap test
Copy collation and chartype before releasing syscache since we need them past the lifetime of the current context.
This commit is contained in:
parent
5c69adfb7e
commit
02d4aefb85
@ -109,6 +109,9 @@ get_database_info(Oid dbid, DbInfo *database)
|
|||||||
database->chartype = TextDatumGetCString(datum);
|
database->chartype = TextDatumGetCString(datum);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
database->collation = pstrdup(database->collation);
|
||||||
|
database->chartype = pstrdup(database->chartype);
|
||||||
|
|
||||||
ReleaseSysCache(dbtuple);
|
ReleaseSysCache(dbtuple);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -23,12 +23,9 @@ SELECT * FROM add_data_node('bootstrap_test', host => 'localhost', database => '
|
|||||||
-- Ensure database and extensions are installed and have the correct
|
-- Ensure database and extensions are installed and have the correct
|
||||||
-- encoding, ctype and collation.
|
-- encoding, ctype and collation.
|
||||||
\c bootstrap_test :ROLE_CLUSTER_SUPERUSER;
|
\c bootstrap_test :ROLE_CLUSTER_SUPERUSER;
|
||||||
SELECT extname, nspname
|
SELECT extname, extnamespace::regnamespace FROM pg_extension e WHERE extname = 'timescaledb';
|
||||||
FROM pg_extension e, pg_namespace n
|
extname | extnamespace
|
||||||
WHERE e.extnamespace = n.oid
|
-------------+--------------
|
||||||
AND e.extname = 'timescaledb';
|
|
||||||
extname | nspname
|
|
||||||
-------------+---------
|
|
||||||
timescaledb | public
|
timescaledb | public
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
@ -57,12 +54,9 @@ SELECT * FROM show_data_nodes();
|
|||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
\c bootstrap_test :ROLE_CLUSTER_SUPERUSER;
|
\c bootstrap_test :ROLE_CLUSTER_SUPERUSER;
|
||||||
SELECT extname, nspname
|
SELECT extname, extnamespace::regnamespace FROM pg_extension e WHERE extname = 'timescaledb';
|
||||||
FROM pg_extension e, pg_namespace n
|
extname | extnamespace
|
||||||
WHERE e.extnamespace = n.oid
|
-------------+--------------
|
||||||
AND e.extname = 'timescaledb';
|
|
||||||
extname | nspname
|
|
||||||
-------------+---------
|
|
||||||
timescaledb | public
|
timescaledb | public
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
@ -23,10 +23,7 @@ SELECT * FROM add_data_node('bootstrap_test', host => 'localhost', database => '
|
|||||||
-- Ensure database and extensions are installed and have the correct
|
-- Ensure database and extensions are installed and have the correct
|
||||||
-- encoding, ctype and collation.
|
-- encoding, ctype and collation.
|
||||||
\c bootstrap_test :ROLE_CLUSTER_SUPERUSER;
|
\c bootstrap_test :ROLE_CLUSTER_SUPERUSER;
|
||||||
SELECT extname, nspname
|
SELECT extname, extnamespace::regnamespace FROM pg_extension e WHERE extname = 'timescaledb';
|
||||||
FROM pg_extension e, pg_namespace n
|
|
||||||
WHERE e.extnamespace = n.oid
|
|
||||||
AND e.extname = 'timescaledb';
|
|
||||||
SELECT PG_ENCODING_TO_CHAR(encoding) = :enc
|
SELECT PG_ENCODING_TO_CHAR(encoding) = :enc
|
||||||
, datcollate = :coll
|
, datcollate = :coll
|
||||||
, datctype = :ctype
|
, datctype = :ctype
|
||||||
@ -41,10 +38,7 @@ SELECT * FROM show_data_nodes();
|
|||||||
|
|
||||||
\c bootstrap_test :ROLE_CLUSTER_SUPERUSER;
|
\c bootstrap_test :ROLE_CLUSTER_SUPERUSER;
|
||||||
|
|
||||||
SELECT extname, nspname
|
SELECT extname, extnamespace::regnamespace FROM pg_extension e WHERE extname = 'timescaledb';
|
||||||
FROM pg_extension e, pg_namespace n
|
|
||||||
WHERE e.extnamespace = n.oid
|
|
||||||
AND e.extname = 'timescaledb';
|
|
||||||
|
|
||||||
\c :TEST_DBNAME :ROLE_CLUSTER_SUPERUSER;
|
\c :TEST_DBNAME :ROLE_CLUSTER_SUPERUSER;
|
||||||
\set ON_ERROR_STOP 0
|
\set ON_ERROR_STOP 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user