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

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : exec sql include sqlca;
                                  2                 :                : #include <stdio.h>
                                  3                 :                : 
                                  4                 :                : exec sql include ../regression;
                                  5                 :                : 
                                  6                 :                : 
 5443 meskes@postgresql.or        7                 :CBC           1 : int main()
                                  8                 :                : {  exec sql begin declare section;
                                  9                 :                :    int index;
                                 10                 :                :    exec sql end declare section;
                                 11                 :                : 
                                 12                 :                : 
 6465                            13                 :              1 :    ECPGdebug(1,stderr);
                                 14                 :                : 
                                 15                 :              1 :    exec sql connect to REGRESSDB1;
                                 16         [ -  + ]:              1 :    if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 17                 :                : 
                                 18                 :              1 :    exec sql create table test (
                                 19                 :                :         "index" numeric(3) primary key,
                                 20                 :                :         "payload" int4 NOT NULL);
                                 21         [ -  + ]:              1 :    if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 22                 :              1 :    exec sql commit work;
                                 23         [ -  + ]:              1 :    if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 24                 :                : 
                                 25         [ +  + ]:             11 :    for (index=0;index<10;++index)
                                 26                 :             10 :    {  exec sql insert into test
                                 27                 :                :                 (payload, index)
                                 28                 :                :                 values (0, :index);
                                 29         [ -  + ]:             10 :       if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 30                 :                :    }
                                 31                 :              1 :    exec sql commit work;
                                 32         [ -  + ]:              1 :    if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 33                 :                : 
                                 34                 :              1 :    exec sql update test
                                 35                 :                :     set payload=payload+1 where index=-1;
                                 36         [ -  + ]:              1 :    if (sqlca.sqlcode!=100) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 37                 :                : 
                                 38                 :              1 :    exec sql delete from test where index=-1;
                                 39         [ -  + ]:              1 :    if (sqlca.sqlcode!=100) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 40                 :                : 
                                 41                 :              1 :    exec sql insert into test (select * from test where index=-1);
                                 42         [ -  + ]:              1 :    if (sqlca.sqlcode!=100) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 43                 :                : 
                                 44                 :              1 :    exec sql drop table test;
                                 45         [ -  + ]:              1 :    if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 46                 :              1 :    exec sql commit work;
                                 47         [ -  + ]:              1 :    if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 48                 :                : 
                                 49                 :              1 :    exec sql disconnect;
                                 50         [ -  + ]:              1 :    if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
                                 51                 :              1 :    return 0;
                                 52                 :                : }
        

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