LCOV - differential code coverage report
Current view: top level - src/interfaces/ecpg/test/sql - indicators.pgc (source / functions) Coverage Total Hit 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: - 0 0
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

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : #include <stdio.h>
                                  2                 :                : 
                                  3                 :                : exec sql include sqlca;
                                  4                 :                : exec sql include ../regression;
                                  5                 :                : 
 5443 meskes@postgresql.or        6                 :CBC           1 : int main()
                                  7                 :                : {
                                  8                 :                :     exec sql begin declare section;
 6465                             9                 :              1 :         int intvar = 5;
                                 10                 :              1 :         int nullind = -1;
                                 11                 :                :     exec sql end declare section;
                                 12                 :                : 
                                 13                 :              1 :     ECPGdebug(1,stderr);
                                 14                 :                : 
                                 15                 :              1 :     exec sql connect to REGRESSDB1;
                                 16                 :              1 :     exec sql set autocommit to off;
                                 17                 :                : 
 6088                            18                 :              1 :     exec sql create table indicator_test (
                                 19                 :                :          "id" int primary key,
                                 20                 :                :          "str" text NOT NULL,
                                 21                 :                :           val int null);
 6465                            22                 :              1 :     exec sql commit work;
                                 23                 :                : 
 6088                            24                 :              1 :     exec sql insert into indicator_test (id, str, val) values ( 1, 'Hello', 0);
                                 25                 :                : 
                                 26                 :                :     /* use indicator in insert */
                                 27                 :              1 :     exec sql insert into indicator_test (id, str, val) values ( 2, 'Hi there', :intvar :nullind);
 6465                            28                 :              1 :     nullind = 0;
 6088                            29                 :              1 :     exec sql insert into indicator_test (id, str, val) values ( 3, 'Good evening', :intvar :nullind);
 6465                            30                 :              1 :     exec sql commit work;
                                 31                 :                : 
                                 32                 :                :     /* use indicators to get information about selects */
 6088                            33                 :              1 :     exec sql select val into :intvar from indicator_test where id = 1;
                                 34                 :              1 :     exec sql select val into :intvar :nullind from indicator_test where id = 2;
 6465                            35                 :              1 :     printf("intvar: %d, nullind: %d\n", intvar, nullind);
 6088                            36                 :              1 :     exec sql select val into :intvar :nullind from indicator_test where id = 3;
 6465                            37                 :              1 :     printf("intvar: %d, nullind: %d\n", intvar, nullind);
                                 38                 :                : 
                                 39                 :                :     /* use indicators for update */
                                 40                 :              1 :     intvar = 5; nullind = -1;
 6088                            41                 :              1 :     exec sql update indicator_test set val = :intvar :nullind where id = 1;
                                 42                 :              1 :     exec sql select val into :intvar :nullind from indicator_test where id = 1;
 6465                            43                 :              1 :     printf("intvar: %d, nullind: %d\n", intvar, nullind);
                                 44                 :                : 
 6088                            45                 :              1 :     exec sql drop table indicator_test;
 6465                            46                 :              1 :     exec sql commit work;
                                 47                 :                : 
                                 48                 :              1 :     exec sql disconnect;
                                 49                 :              1 :     return 0;
                                 50                 :                : }
        

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