Skip to content

Commit

Permalink
Prepare a new empty upgrade script and adjust the regression test env…
Browse files Browse the repository at this point in the history
…ironment for the new E-Maj version. Also add the scenario with mixed version for Postgres 12.
  • Loading branch information
beaud76 committed Oct 15, 2019
1 parent 7271a1f commit 8e6fb25
Show file tree
Hide file tree
Showing 28 changed files with 5,918 additions and 1,282 deletions.
6 changes: 6 additions & 0 deletions sql/emaj--3.2.0--devel.sql
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ SELECT emaj._disable_event_triggers();


--<begin_functions> pattern used by the tool that extracts and insert the functions definition
------------------------------------------------------------------
-- drop obsolete functions or functions with modified interface --
------------------------------------------------------------------

------------------------------------------------------------------
-- create new or modified functions --
------------------------------------------------------------------
--<end_functions> pattern used by the tool that extracts and insert the functions definition
------------------------------------------
-- --
Expand Down
2,905 changes: 2,304 additions & 601 deletions sql/emaj--3.1.0.sql → sql/emaj--3.2.0.sql

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions test/10/expected/after_upg_while_logging.out
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ select hist_function, hist_event, hist_object,
order by hist_id;
hist_function | hist_event | hist_object | regexp_replace | hist_user
--------------------------+--------------------+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------
EMAJ_INSTALL | | E-Maj 3.1.0 | Initialisation completed | postgres
EMAJ_INSTALL | | E-Maj 3.2.0 | Initialisation completed | postgres
CREATE_GROUP | BEGIN | myGroup1 | rollbackable | postgres
CREATE_GROUP | LOG_SCHEMA CREATED | emaj_myschema1 | | postgres
CREATE_GROUP | END | myGroup1 | 6 tables/sequences processed | postgres
Expand Down Expand Up @@ -414,7 +414,7 @@ select hist_function, hist_event, hist_object,
LOCK_GROUP | END | myGroup1 | 5 tables locked, 0 deadlock(s) | postgres
SET_MARK_GROUP | BEGIN | myGroup1 | ALTER_% | postgres
SET_MARK_GROUP | END | myGroup1 | ALTER_% | postgres
ALTER_GROUP | TABLE REMOVED | myschema1."myTbl3" | From the group myGroup1 | postgres
ALTER_GROUP | TABLE REMOVED | myschema1."myTbl3" | From the logging group myGroup1 | postgres
ALTER_GROUP | END | myGroup1 | Timestamp Id : 18 | postgres
CREATE_GROUP | BEGIN | myGroup6 | rollbackable | postgres
CREATE_GROUP | LOG_SCHEMA CREATED | emaj_myschema6 | | postgres
Expand All @@ -430,16 +430,16 @@ select hist_function, hist_event, hist_object,
LOCK_GROUP | END | myGroup6 | 4 tables locked, 0 deadlock(s) | postgres
SET_MARK_GROUP | BEGIN | myGroup6 | ALTER_% | postgres
SET_MARK_GROUP | END | myGroup6 | ALTER_% | postgres
ALTER_GROUP | TABLE REMOVED | myschema6.table_with_55_characters_long_name_____0_________0abcde | From the group myGroup6 | postgres
ALTER_GROUP | TABLE REMOVED | myschema6.table_with_55_characters_long_name_____0_________0abcde | From the logging group myGroup6 | postgres
ALTER_GROUP | END | myGroup6 | Timestamp Id : 21 | postgres
STOP_GROUP | BEGIN | myGroup6 | | postgres
LOCK_GROUP | BEGIN | myGroup6 | | postgres
LOCK_GROUP | END | myGroup6 | 3 tables locked, 0 deadlock(s) | postgres
SET_MARK_GROUP | BEGIN | myGroup6 | STOP_% | postgres
SET_MARK_GROUP | END | myGroup6 | STOP_% | postgres
STOP_GROUP | END | myGroup6 | 3 tables/sequences processed | postgres
EMAJ_INSTALL | BEGIN | E-Maj <devel> | Upgrade from 3.1.0 started | postgres
EMAJ_INSTALL | END | E-Maj <devel> | Upgrade from 3.1.0 completed | postgres
EMAJ_INSTALL | BEGIN | E-Maj <devel> | Upgrade from 3.2.0 started | postgres
EMAJ_INSTALL | END | E-Maj <devel> | Upgrade from 3.2.0 completed | postgres
UNPROTECT_GROUP | | myGroup1 | Status 1 | postgres
ROLLBACK_GROUPS | BEGIN | myGroup1,myGroup2 | Unlogged rollback to mark Common (timestamp) | postgres
DBLINK_OPEN_CNX | | rlbk#1 | Status = -5 | postgres
Expand Down
4 changes: 2 additions & 2 deletions test/10/expected/before_upg_while_logging.out
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ delete from emaj.emaj_group_def;
insert into emaj.emaj_group_def values ('myGroup1','myschema1','mytbl1',20);
insert into emaj.emaj_group_def values ('myGroup1','myschema1','mytbl2',NULL);
insert into emaj.emaj_group_def values ('myGroup1','myschema1','mytbl2b',NULL);
insert into emaj.emaj_group_def values ('myGroup1','myschema1','myTbl3_col31_seq',1);
insert into emaj.emaj_group_def values ('myGroup1','myschema1','myTbl3_col31_seq');
insert into emaj.emaj_group_def values ('myGroup1','myschema1','myTbl3',10);
insert into emaj.emaj_group_def values ('myGroup1','myschema1','mytbl4',20);
insert into emaj.emaj_group_def values ('myGroup2','myschema2','mytbl1');
Expand Down Expand Up @@ -358,7 +358,7 @@ select group_name, group_is_rollbackable, group_creation_time_id,
phil's group#3", | f | 3 | | f | t | t | 2 | 1 |
(4 rows)

select mark_group, regexp_replace(mark_name,E'\\d\\d\.\\d\\d\\.\\d\\d\\.\\d\\d\\d','%','g'), mark_time_id,
select mark_group, regexp_replace(mark_name,E'\\d\\d\.\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d','%','g'), mark_time_id,
mark_is_deleted, mark_is_rlbk_protected, mark_comment, mark_log_rows_before_next, mark_logged_rlbk_target_mark
from emaj.emaj_mark order by mark_time_id, mark_group;
mark_group | regexp_replace | mark_time_id | mark_is_deleted | mark_is_rlbk_protected | mark_comment | mark_log_rows_before_next | mark_logged_rlbk_target_mark
Expand Down
8 changes: 4 additions & 4 deletions test/10/expected/install_previous.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ SET default_tablespace TO tspemaj;
------------------------------------------------------------
-- emaj installation in its previous version as an extension
------------------------------------------------------------
CREATE EXTENSION emaj VERSION '3.1.0';
CREATE EXTENSION emaj VERSION '3.2.0';
------------------------------------------------------------
-- check installation
------------------------------------------------------------
-- check impact in catalog
select extname, extversion from pg_extension where extname = 'emaj';
extname | extversion
---------+------------
emaj | 3.1.0
emaj | 3.2.0
(1 row)

-- check the emaj_param content
SELECT param_value_text FROM emaj.emaj_param WHERE param_key = 'emaj_version';
param_value_text
------------------
3.1.0
3.2.0
(1 row)

-- check history
select hist_id, hist_function, hist_event, hist_object, hist_wording, hist_user from emaj.emaj_hist order by hist_id;
hist_id | hist_function | hist_event | hist_object | hist_wording | hist_user
---------+---------------+------------+-------------+--------------------------+-----------
1 | EMAJ_INSTALL | | E-Maj 3.1.0 | Initialisation completed | postgres
1 | EMAJ_INSTALL | | E-Maj 3.2.0 | Initialisation completed | postgres
(1 row)

0 comments on commit 8e6fb25

Please sign in to comment.