LCOV - differential code coverage report
Current view: top level - src/interfaces/ecpg/test/sql - func.pgc (source / functions) Coverage Total Hit UBC CBC
Current: Differential Code Coverage 16@8cea358b128 vs 17@8cea358b128 Lines: 100.0 % 23 23 23
Current Date: 2024-04-14 14:21:10 Functions: 100.0 % 1 1 1
Baseline: 16@8cea358b128 Branches: 50.0 % 48 24 24 24
Baseline Date: 2024-04-14 14:21:09 Line coverage date bins:
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed (240..) days: 100.0 % 23 23 23
Function coverage date bins:
(240..) days: 100.0 % 1 1 1
Branch coverage date bins:
(240..) days: 50.0 % 48 24 24 24

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : #include <stdio.h>
                                  2                 :                : #include <stdlib.h>
                                  3                 :                : #include <string.h>
                                  4                 :                : 
                                  5                 :                : EXEC SQL INCLUDE ../regression;
                                  6                 :                : 
 5443 meskes@postgresql.or        7                 :CBC           1 : int main() {
                                  8                 :                :   EXEC SQL char text[25];
                                  9                 :                : 
 6465                            10                 :              1 :   ECPGdebug(1, stderr);
                                 11                 :              1 :   EXEC SQL CONNECT TO REGRESSDB1;
                                 12                 :                : 
                                 13                 :              1 :   EXEC SQL SET AUTOCOMMIT TO ON;
                                 14                 :                :   EXEC SQL WHENEVER SQLWARNING SQLPRINT;
                                 15                 :                :   EXEC SQL WHENEVER SQLERROR SQLPRINT;
                                 16                 :                : 
                                 17                 :              1 :   EXEC SQL CREATE TABLE My_Table ( Item1 int, Item2 text );
 6088                            18   [ -  +  -  + ]:              1 :   EXEC SQL CREATE TABLE Log (name text, w text);
 6465                            19   [ -  +  -  + ]:              1 : 
                                 20                 :              1 :   EXEC SQL CREATE FUNCTION My_Table_Check() RETURNS trigger
                                 21                 :                :     AS $test$
                                 22                 :                :     BEGIN
                                 23                 :                :     INSERT INTO Log VALUES(TG_NAME, TG_WHEN);
                                 24                 :                :     RETURN NEW;
                                 25                 :                :     END; $test$
                                 26                 :                :     LANGUAGE plpgsql;
                                 27   [ -  +  -  + ]:              1 : 
                                 28                 :              1 :   EXEC SQL CREATE TRIGGER My_Table_Check_Trigger
                                 29                 :                :     BEFORE INSERT
                                 30                 :                :     ON My_Table
                                 31                 :                :     FOR EACH ROW
                                 32                 :                :     EXECUTE PROCEDURE My_Table_Check();
                                 33   [ -  +  -  + ]:              1 : 
                                 34                 :              1 :   EXEC SQL INSERT INTO My_Table VALUES (1234, 'Some random text');
                                 35   [ -  +  -  + ]:              1 :   EXEC SQL INSERT INTO My_Table VALUES (5678, 'The Quick Brown');
 6088                            36   [ -  +  -  + ]:              1 :   EXEC SQL SELECT name INTO :text FROM Log LIMIT 1;
                                 37   [ -  +  -  + ]:              1 :   printf("Trigger %s fired.\n", text);
                                 38                 :                : 
 6465                            39                 :              1 :   EXEC SQL DROP TRIGGER My_Table_Check_Trigger ON My_Table;
                                 40   [ -  +  -  + ]:              1 :   EXEC SQL DROP FUNCTION My_Table_Check();
 6088                            41   [ -  +  -  + ]:              1 :   EXEC SQL DROP TABLE Log;
 6465                            42   [ -  +  -  + ]:              1 :   EXEC SQL DROP TABLE My_Table;
                                 43   [ -  +  -  + ]:              1 : 
                                 44                 :              1 :   EXEC SQL DISCONNECT ALL;
                                 45   [ -  +  -  + ]:              1 : 
                                 46                 :              1 :   return 0;
                                 47                 :                : }
        

Generated by: LCOV version 2.1-beta2-3-g6141622