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

 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 BEGIN DECLARE SECTION;
                                  9                 :                :     char str[25];
 1907 tgl@sss.pgh.pa.us          10                 :              1 :     int i, count=1, loopcount;
                                 11                 :                :   EXEC SQL END DECLARE SECTION;
                                 12                 :                : 
 6428 meskes@postgresql.or       13                 :              1 :   ECPGdebug(1, stderr);
                                 14                 :              1 :   EXEC SQL CONNECT TO REGRESSDB1;
                                 15                 :                : 
                                 16                 :                :   EXEC SQL WHENEVER SQLWARNING SQLPRINT;
                                 17                 :                :   EXEC SQL WHENEVER SQLERROR STOP;
                                 18                 :                : 
                                 19                 :              1 :   EXEC SQL CREATE TABLE My_Table ( Item1 int, Item2 text );
                                 20   [ -  +  -  + ]:              1 : 
                                 21                 :              1 :   EXEC SQL INSERT INTO My_Table VALUES ( 1, 'text1');
                                 22   [ -  +  -  + ]:              1 :   EXEC SQL INSERT INTO My_Table VALUES ( 2, 'text2');
                                 23   [ -  +  -  + ]:              1 :   EXEC SQL INSERT INTO My_Table VALUES ( 3, 'text3');
                                 24   [ -  +  -  + ]:              1 :   EXEC SQL INSERT INTO My_Table VALUES ( 4, 'text4');
                                 25   [ -  +  -  + ]:              1 : 
                                 26                 :                :   EXEC SQL DECLARE C CURSOR FOR SELECT * FROM My_Table;
                                 27                 :                : 
                                 28                 :              1 :   EXEC SQL OPEN C;
                                 29   [ -  +  -  + ]:              1 : 
                                 30                 :                :   EXEC SQL WHENEVER NOT FOUND DO BREAK;
 1907 tgl@sss.pgh.pa.us          31         [ +  - ]:              5 :   for (loopcount = 0; loopcount < 100; loopcount++) {
 3808 peter_e@gmx.net            32                 :              5 :     EXEC SQL FETCH 1 IN C INTO :i, :str;
 6428 meskes@postgresql.or       33   [ +  +  -  +  :              5 :     printf("%d: %s\n", i, str);
                                              -  + ]
                                 34                 :                :   }
                                 35                 :                : 
                                 36                 :                :   EXEC SQL WHENEVER NOT FOUND CONTINUE;
                                 37                 :              1 :   EXEC SQL MOVE BACKWARD 2 IN C;
                                 38   [ -  +  -  + ]:              1 : 
 5934                            39                 :              1 :   EXEC SQL FETCH :count IN C INTO :i, :str;
 6428                            40   [ -  +  -  + ]:              1 :   printf("%d: %s\n", i, str);
                                 41                 :                : 
 3792                            42                 :              1 :   EXEC SQL CLOSE C;
                                 43   [ -  +  -  + ]:              1 : 
                                 44                 :                :   EXEC SQL DECLARE D CURSOR FOR SELECT * FROM My_Table WHERE Item1 = $1;
                                 45                 :                : 
 5661                            46                 :              1 :   EXEC SQL OPEN D using 1;
                                 47   [ -  +  -  + ]:              1 : 
 1901                            48                 :              1 :   EXEC SQL FETCH 1 IN D INTO :i, :str;
                                 49   [ -  +  -  + ]:              1 :   printf("%d: %s\n", i, str);
                                 50                 :                : 
 5661                            51                 :              1 :   EXEC SQL CLOSE D;
 6428                            52   [ -  +  -  + ]:              1 : 
                                 53                 :              1 :   EXEC SQL DROP TABLE My_Table;
                                 54   [ -  +  -  + ]:              1 : 
                                 55                 :              1 :   EXEC SQL DISCONNECT ALL;
                                 56   [ -  +  -  + ]:              1 : 
                                 57                 :              1 :   return 0;
                                 58                 :                : }
        

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