提交 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) (
SFUNC = int4larger,
STYPE = int4
);
ALTER EXTENSION gp_inject_fault ADD AGGREGATE example_agg(int4);
ALTER EXTENSION gp_inject_fault DROP AGGREGATE example_agg(int4);
ALTER EXTENSION pageinspect ADD 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
-- it, but let's keep up the test coverage.
CREATE EXTENSION gp_inject_fault;
......
--
-- Test \dx and \dx+, to display extensions.
--
-- We just use gp_inject_fault as an example of an extension here. We don't
-- inject any faults.
\dx gp_inject*
List of installed extensions
Name | Version | Schema | Description
-----------------+---------+--------+----------------------------------------------
gp_inject_fault | 1.0 | public | simulate various faults for testing purposes
-- We just use plpgsql as an example of an extension here.
\dx plpgsql
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(1 row)
\dx+ gp_inject*
Objects in extension "gp_inject_fault"
Object description
------------------------------------------------------------------------------------
function force_mirrors_to_catch_up()
function gp_inject_fault(text,text,integer)
function gp_inject_fault(text,text,text,text,text,integer,integer,integer,integer)
function gp_inject_fault_infinite(text,text,integer)
function gp_wait_until_triggered_fault(text,integer,integer)
function insert_noop_xlog_record()
(6 rows)
\dx+ plpgsql
Objects in extension "plpgsql"
Object description
-------------------------------------------
function plpgsql_call_handler()
function plpgsql_inline_handler(internal)
function plpgsql_validator(oid)
language plpgsql
(4 rows)
--
-- 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) (
SFUNC = int4larger,
STYPE = int4
);
ALTER EXTENSION gp_inject_fault ADD AGGREGATE example_agg(int4);
ALTER EXTENSION gp_inject_fault DROP AGGREGATE example_agg(int4);
ALTER EXTENSION pageinspect ADD 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
-- it, but let's keep up the test coverage.
......
--
-- Test \dx and \dx+, to display extensions.
--
-- We just use gp_inject_fault as an example of an extension here. We don't
-- inject any faults.
\dx gp_inject*
\dx+ gp_inject*
-- We just use plpgsql as an example of an extension here.
\dx plpgsql
\dx+ plpgsql
--
-- Test extended \du flags
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册