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

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : #include <stdlib.h>
                                  2                 :                : 
                                  3                 :                : exec sql include ../regression;
                                  4                 :                : 
                                  5                 :                : exec sql whenever sqlerror stop;
                                  6                 :                : 
 2424 meskes@postgresql.or        7                 :CBC           1 : int main(void)
                                  8                 :                : {
                                  9                 :                :     exec sql begin declare section;
                                 10                 :                :     struct
                                 11                 :                :     {
                                 12                 :                :         char ename[12];
                                 13                 :                :         float sal;
                                 14                 :                :         float comm;
                                 15                 :                :     } emp;
                                 16                 :                :     int loopcount;
                                 17                 :                :     char msg[128];
                                 18                 :                :     exec sql end declare section;
                                 19                 :                : 
                                 20                 :              1 :     ECPGdebug(1, stderr);
                                 21                 :                : 
                                 22                 :              1 :     strcpy(msg, "connect");
                                 23                 :              1 :     exec sql connect to REGRESSDB1;
                                 24         [ -  + ]:              1 : 
                                 25                 :              1 :     strcpy(msg, "create");
                                 26                 :              1 :     exec sql  create table emp(ename varchar,sal double precision, comm double precision);
                                 27         [ -  + ]:              1 : 
                                 28                 :              1 :     strcpy(msg, "insert");
                                 29                 :              1 :     exec sql insert into emp values ('Ram',111100,21);
                                 30         [ -  + ]:              1 :     exec sql insert into emp values ('aryan',11110,null);
                                 31         [ -  + ]:              1 :     exec sql insert into emp values ('josh',10000,10);
                                 32         [ -  + ]:              1 :     exec sql insert into emp values ('tom',20000,null);
                                 33         [ -  + ]:              1 : 
                                 34                 :                :     exec sql declare c cursor for select ename, sal, comm from emp order by ename collate "C" asc;
                                 35                 :                : 
                                 36                 :              1 :     exec sql open c;
                                 37         [ -  + ]:              1 : 
                                 38                 :                :     /* The 'BREAK' condition to exit the loop. */
                                 39                 :                :     exec sql whenever not found do break;
                                 40                 :                : 
                                 41                 :                :     /* The DO CONTINUE makes the loop start at the next iteration when an error occurs.*/
                                 42                 :                :     exec sql whenever sqlerror do continue;
                                 43                 :                : 
 1907 tgl@sss.pgh.pa.us          44         [ +  - ]:              5 :     for (loopcount = 0; loopcount < 100; loopcount++)
                                 45                 :                :     {
 2424 meskes@postgresql.or       46                 :              5 :         exec sql fetch c into :emp;
                                 47   [ +  +  +  + ]:              5 :         /* The employees with non-NULL commissions will be displayed. */
                                 48                 :              2 :         printf("%s %7.2f %9.2f\n", emp.ename, emp.sal, emp.comm);
                                 49                 :                :     }
                                 50                 :                : 
                                 51                 :                :     /*
                                 52                 :                :      * This 'CONTINUE' shuts off the 'DO CONTINUE' and allow the program to
                                 53                 :                :      * proceed if any further errors do occur.
                                 54                 :                :      */
                                 55                 :                :     exec sql whenever sqlerror continue;
                                 56                 :                : 
                                 57                 :              1 :     exec sql close c;
                                 58                 :                : 
                                 59                 :              1 :     strcpy(msg, "drop");
                                 60                 :              1 :     exec sql drop table emp;
                                 61                 :                : 
                                 62                 :              1 :     exit(0);
                                 63                 :                : }
        

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