提交 ba7dc5a4 编写于 作者: H Hao Wu 提交者: Asim R P

Avoid using faultinjector extension when possible

Some tests merely need to create an extension, let's use an extension
that's always enabled instead of gp_inject_fault, which can now be
configured with --enable-faultinjector configure option.

This change is cherry-picked from GitHub PR #9029.
上级 8b897b12
CREATE EXTENSION IF NOT EXISTS gp_inject_fault; -- Creating extension to test alter extension
-- Assume: pageinspect is shipped by default
CREATE EXTENSION pageinspect;
CREATE AGGREGATE example_agg(int4) ( CREATE AGGREGATE example_agg(int4) (
SFUNC = int4larger, SFUNC = int4larger,
STYPE = int4 STYPE = int4
); );
ALTER EXTENSION gp_inject_fault ADD AGGREGATE example_agg(int4); ALTER EXTENSION pageinspect ADD AGGREGATE example_agg(int4);
ALTER EXTENSION gp_inject_fault DROP AGGREGATE example_agg(int4); ALTER EXTENSION pageinspect DROP AGGREGATE example_agg(int4);
DROP EXTENSION pageinspect;
-- Test creating an extension that already exists. Nothing too exciting about -- Test creating an extension that already exists. Nothing too exciting about
-- it, but let's keep up the test coverage. -- it, but let's keep up the test coverage.
CREATE EXTENSION gp_inject_fault; CREATE EXTENSION gp_inject_fault;
......
-- --
-- Test \dx and \dx+, to display extensions. -- Test \dx and \dx+, to display extensions.
-- --
-- We just use gp_inject_fault as an example of an extension here. We don't -- We just use plpgsql as an example of an extension here.
-- inject any faults. \dx plpgsql
\dx gp_inject*
List of installed extensions List of installed extensions
Name | Version | Schema | Description Name | Version | Schema | Description
-----------------+---------+--------+---------------------------------------------- ---------+---------+------------+------------------------------
gp_inject_fault | 1.0 | public | simulate various faults for testing purposes plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(1 row) (1 row)
\dx+ gp_inject* \dx+ plpgsql
Objects in extension "gp_inject_fault" Objects in extension "plpgsql"
Object description Object description
------------------------------------------------------------------------------------ -------------------------------------------
function force_mirrors_to_catch_up() function plpgsql_call_handler()
function gp_inject_fault(text,text,integer) function plpgsql_inline_handler(internal)
function gp_inject_fault(text,text,text,text,text,integer,integer,integer,integer) function plpgsql_validator(oid)
function gp_inject_fault_infinite(text,text,integer) language plpgsql
function gp_wait_until_triggered_fault(text,integer,integer) (4 rows)
function insert_noop_xlog_record()
(6 rows)
-- --
-- Test extended \du flags -- Test extended \du flags
......
CREATE EXTENSION IF NOT EXISTS gp_inject_fault; -- Creating extension to test alter extension
-- Assume: pageinspect is shipped by default
CREATE EXTENSION pageinspect;
CREATE AGGREGATE example_agg(int4) ( CREATE AGGREGATE example_agg(int4) (
SFUNC = int4larger, SFUNC = int4larger,
STYPE = int4 STYPE = int4
); );
ALTER EXTENSION gp_inject_fault ADD AGGREGATE example_agg(int4); ALTER EXTENSION pageinspect ADD AGGREGATE example_agg(int4);
ALTER EXTENSION gp_inject_fault DROP AGGREGATE example_agg(int4); ALTER EXTENSION pageinspect DROP AGGREGATE example_agg(int4);
DROP EXTENSION pageinspect;
-- Test creating an extension that already exists. Nothing too exciting about -- Test creating an extension that already exists. Nothing too exciting about
-- it, but let's keep up the test coverage. -- it, but let's keep up the test coverage.
......
-- --
-- Test \dx and \dx+, to display extensions. -- Test \dx and \dx+, to display extensions.
-- --
-- We just use gp_inject_fault as an example of an extension here. We don't -- We just use plpgsql as an example of an extension here.
-- inject any faults. \dx plpgsql
\dx+ plpgsql
\dx gp_inject*
\dx+ gp_inject*
-- --
-- Test extended \du flags -- Test extended \du flags
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册