LCOV - differential code coverage report
Current view: top level - src/interfaces/ecpg/test/sql - define.pgc (source / functions) Coverage Total Hit UBC CBC
Current: Differential Code Coverage 16@8cea358b128 vs 17@8cea358b128 Lines: 100.0 % 20 20 20
Current Date: 2024-04-14 14:21:10 Functions: 100.0 % 1 1 1
Baseline: 16@8cea358b128 Branches: 50.0 % 18 9 9 9
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 % 20 20 20
Function coverage date bins:
(240..) days: 100.0 % 1 1 1
Branch coverage date bins:
(240..) days: 50.0 % 18 9 9 9

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : exec sql include sqlca;
                                  2                 :                : exec sql include ../regression;
                                  3                 :                : exec sql define STR 'abcdef';
                                  4                 :                : exec sql define INSERTNULL 1;
                                  5                 :                : exec sql define NUMBER 29;
                                  6                 :                : 
 6465 meskes@postgresql.or        7                 :CBC           1 : int main(void)
                                  8                 :                : {
                                  9                 :                :    exec sql begin declare section;
                                 10                 :                :      int i;
                                 11                 :                :      char s[200];
                                 12                 :                :    exec sql end declare section;
                                 13                 :                : 
                                 14                 :              1 :    ECPGdebug(1, stderr);
                                 15                 :                : 
                                 16                 :                :    exec sql whenever sqlerror do sqlprint();
                                 17                 :              1 :    exec sql connect to REGRESSDB1;
                                 18         [ -  + ]:              1 : 
                                 19                 :              1 :    exec sql create table test (a int, b text);
                                 20         [ -  + ]:              1 :    exec sql insert into test values (NUMBER, STR);
                                 21         [ -  + ]:              1 : 
                                 22                 :                :    exec sql ifdef INSERTNULL;
                                 23                 :              1 :    exec sql insert into test values (NULL, 'defined');
                                 24         [ -  + ]:              1 :    exec sql endif;
                                 25                 :                : 
                                 26                 :                :    exec sql ifndef INSERTNULL;
                                 27                 :                :    exec sql insert into test values (NULL, 'not defined');
                                 28                 :                :    exec sql elif SOMEOTHERVAR;
                                 29                 :                :    exec sql insert into test values (NULL, 'someothervar defined');
                                 30                 :                :    exec sql else;
                                 31                 :              1 :    exec sql insert into test values (NULL, 'someothervar not defined');
                                 32         [ -  + ]:              1 :    exec sql endif;
                                 33                 :                : 
                                 34                 :                :    exec sql define NUMBER 29;
                                 35                 :                : 
                                 36                 :              1 :    exec sql select INSERTNULL, NUMBER::text || '-' || STR INTO :i, :s;
                                 37         [ -  + ]:              1 : 
                                 38                 :              1 :    printf("i: %d, s: %s\n", i, s);
                                 39                 :                : 
                                 40                 :                :    exec sql undef STR;
                                 41                 :                :    exec sql ifndef STR;
                                 42                 :              1 :    exec sql insert into test values (NUMBER, 'no string');
                                 43         [ -  + ]:              1 :    exec sql endif;
                                 44                 :                : 
                                 45                 :                :    exec sql define TZVAR;  /* no value */
                                 46                 :                :    exec sql define TZVAR 'UTC';
                                 47                 :                : 
                                 48                 :                :    exec sql ifndef TZVAR;
                                 49                 :                :    exec sql SET TIMEZONE TO 'GMT';
                                 50                 :                :    exec sql elif TZNAME;
                                 51                 :                :    exec sql SET TIMEZONE TO TZNAME;
                                 52                 :                :    exec sql else;
                                 53                 :              1 :    exec sql SET TIMEZONE TO TZVAR;
                                 54         [ -  + ]:              1 :    exec sql endif;
                                 55                 :                : 
                                 56                 :              1 :    exec sql disconnect;
                                 57         [ -  + ]:              1 :    return 0;
                                 58                 :                : }
        

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