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

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : #include <stdio.h>
                                  2                 :                : exec sql include sqlca;
                                  3                 :                : #include <stdlib.h>
                                  4                 :                : exec sql include ../regression;
                                  5                 :                : 
 6465 meskes@postgresql.or        6                 :CBC           1 : int main(void)
                                  7                 :                : {
                                  8                 :                :    exec sql begin declare section;
 6464                             9                 :              1 :    int     *d1=0;
                                 10                 :              1 :    double  *d2=0;
                                 11                 :              1 :    char **d3=0;
                                 12                 :              1 :    char **d4=0;
                                 13                 :              1 :    char **d5=0;
                                 14                 :              1 :    char **d6=0;
                                 15                 :              1 :    char **d7=0;
                                 16                 :                : /*   char **d8=0; */
                                 17                 :              1 :    char **d9=0;
                                 18                 :              1 :    int *i1=0;
                                 19                 :              1 :    int *i2=0;
                                 20                 :              1 :    int *i3=0;
                                 21                 :              1 :    int *i4=0;
                                 22                 :              1 :    int *i5=0;
                                 23                 :              1 :    int *i6=0;
                                 24                 :              1 :    int *i7=0;
                                 25                 :                : /*   int *i8=0; */
                                 26                 :              1 :    int *i9=0;
                                 27                 :                :    exec sql end declare section;
                                 28                 :                :    int i;
                                 29                 :                : 
 6465                            30                 :              1 :    ECPGdebug(1, stderr);
                                 31                 :                : 
                                 32                 :                :    exec sql whenever sqlerror do sqlprint();
                                 33                 :              1 :    exec sql connect to REGRESSDB1;
                                 34         [ -  + ]:              1 : 
 6448                            35                 :              1 :    exec sql set datestyle to mdy;
                                 36         [ -  + ]:              1 : 
 6464                            37                 :              1 :    exec sql create table test (a serial, b numeric(12,3), c varchar, d varchar(3), e char(4), f timestamptz, g boolean, h box, i inet);
                                 38         [ -  + ]:              1 :    exec sql insert into test (b, c, d, e, f, g, h, i) values (23.456, 'varchar', 'v', 'c', '2003-03-03 12:33:07 PDT', true, '(1,2,3,4)', '2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128');
                                 39         [ -  + ]:              1 :    exec sql insert into test (b, c, d, e, f, g, h, i) values (2.446456, NULL, 'v', 'c', '2003-03-03 12:33:07 PDT', false, NULL, NULL);
                                 40         [ -  + ]:              1 : 
 6465                            41                 :              1 :    exec sql allocate descriptor mydesc;
 5213                            42         [ -  + ]:              1 :    exec sql select a,b,c,d,e,f,g,h,i into sql descriptor mydesc from test order by a;
 6464                            43         [ -  + ]:              1 :    exec sql get descriptor mydesc value 1 :d1=DATA, :i1=INDICATOR;
                                 44         [ -  + ]:              1 :    exec sql get descriptor mydesc value 2 :d2=DATA, :i2=INDICATOR;
                                 45         [ -  + ]:              1 :    exec sql get descriptor mydesc value 3 :d3=DATA, :i3=INDICATOR;
                                 46         [ -  + ]:              1 :    exec sql get descriptor mydesc value 4 :d4=DATA, :i4=INDICATOR;
                                 47         [ -  + ]:              1 :    exec sql get descriptor mydesc value 5 :d5=DATA, :i5=INDICATOR;
                                 48         [ -  + ]:              1 :    exec sql get descriptor mydesc value 6 :d6=DATA, :i6=INDICATOR;
                                 49         [ -  + ]:              1 :    exec sql get descriptor mydesc value 7 :d7=DATA, :i7=INDICATOR;
                                 50         [ -  + ]:              1 :    /* skip box for now */
                                 51                 :                :    /* exec sql get descriptor mydesc value 8 :d8=DATA, :i8=INDICATOR; */
                                 52                 :              1 :    exec sql get descriptor mydesc value 9 :d9=DATA, :i9=INDICATOR;
 6465                            53         [ -  + ]:              1 : 
 6464                            54                 :              1 :    printf("Result:\n");
 6465                            55         [ +  + ]:              3 :    for (i=0;i<sqlca.sqlerrd[2];++i)
                                 56                 :                :    {
 6464                            57         [ -  + ]:              2 :       if (i1[i]) printf("NULL, ");
 4891 peter_e@gmx.net            58                 :              2 :       else printf("%d, ",d1[i]);
                                 59                 :                : 
 6464 meskes@postgresql.or       60         [ -  + ]:              2 :       if (i2[i]) printf("NULL, ");
 4891 peter_e@gmx.net            61                 :              2 :       else printf("%f, ",d2[i]);
                                 62                 :                : 
 6464 meskes@postgresql.or       63         [ +  + ]:              2 :       if (i3[i]) printf("NULL, ");
 4891 peter_e@gmx.net            64                 :              1 :       else printf("'%s', ",d3[i]);
                                 65                 :                : 
 6464 meskes@postgresql.or       66         [ -  + ]:              2 :       if (i4[i]) printf("NULL, ");
 4891 peter_e@gmx.net            67                 :              2 :       else printf("'%s', ",d4[i]);
                                 68                 :                : 
 6464 meskes@postgresql.or       69         [ -  + ]:              2 :       if (i5[i]) printf("NULL, ");
 4891 peter_e@gmx.net            70                 :              2 :       else printf("'%s', ",d5[i]);
                                 71                 :                : 
 6464 meskes@postgresql.or       72         [ -  + ]:              2 :       if (i6[i]) printf("NULL, ");
 4891 peter_e@gmx.net            73                 :              2 :       else printf("'%s', ",d6[i]);
                                 74                 :                : 
 6464 meskes@postgresql.or       75         [ -  + ]:              2 :       if (i7[i]) printf("NULL, ");
 4891 peter_e@gmx.net            76                 :              2 :       else printf("'%s', ",d7[i]);
                                 77                 :                : 
 6464 meskes@postgresql.or       78         [ +  + ]:              2 :       if (i9[i]) printf("NULL, ");
 4891 peter_e@gmx.net            79                 :              1 :       else printf("'%s', ",d9[i]);
                                 80                 :                : 
 6464 meskes@postgresql.or       81                 :              2 :       printf("\n");
                                 82                 :                :    }
 6465                            83                 :              1 :    ECPGfree_auto_mem();
                                 84                 :              1 :    printf("\n");
                                 85                 :                : 
                                 86                 :              1 :    exec sql deallocate descriptor mydesc;
                                 87         [ -  + ]:              1 :    exec sql disconnect;
                                 88         [ -  + ]:              1 :    return 0;
                                 89                 :                : }
        

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