LCOV - differential code coverage report
Current view: top level - src/interfaces/ecpg/test/connect - test2.pgc (source / functions) Coverage Total Hit CBC
Current: c70b6db34ffeab48beef1fb4ce61bcad3772b8dd vs 06473f5a344df8c9594ead90a609b86f6724cff8 Lines: 100.0 % 15 15 15
Current Date: 2025-09-06 07:49:51 +0900 Functions: 100.0 % 1 1 1
Baseline: lcov-20250907-010129-baseline Line coverage date bins:
Baseline Date: 2025-09-05 08:21:35 +0100 (360..) days: 100.0 % 15 15 15
Legend: Lines:     hit not hit Function coverage date bins:
(360..) days: 100.0 % 1 1 1

 Age         Owner                  TLA  Line data    Source code
                                  1                 : /*
                                  2                 :  * this file tests multiple connections to databases and switches
                                  3                 :  * between them.
                                  4                 :  */
                                  5                 : 
                                  6                 : #include <stdlib.h>
                                  7                 : #include <string.h>
                                  8                 : #include <stdlib.h>
                                  9                 : #include <stdio.h>
                                 10                 : 
                                 11                 : exec sql include ../regression;
                                 12                 : 
                                 13                 : int
 6976 meskes@postgresql.or       14 CBC           1 : main(void)
                                 15                 : {
                                 16                 : exec sql begin declare section;
                                 17                 :     char id[200];
                                 18                 :     char res[200];
                                 19                 : exec sql end declare section;
                                 20                 : 
                                 21               1 :     ECPGdebug(1, stderr);
                                 22                 : 
                                 23               1 :     strcpy(id, "first");
 3339 tgl@sss.pgh.pa.us          24               1 :     exec sql connect to ecpg2_regression as :id;
 6974 meskes@postgresql.or       25               1 :     exec sql connect to REGRESSDB1 as second;
                                 26                 : 
                                 27                 :     /* this selects from "second" which was opened last */
 6976                            28               1 :     exec sql select current_database() into :res;
                                 29               1 :     exec sql at first select current_database() into :res;
                                 30               1 :     exec sql at second select current_database() into :res;
                                 31                 : 
                                 32               1 :     exec sql set connection first;
                                 33               1 :     exec sql select current_database() into :res;
                                 34                 : 
                                 35                 :     /* this will disconnect from "first" */
                                 36               1 :     exec sql disconnect;
                                 37               1 :     exec sql select current_database() into :res;
                                 38                 : 
                                 39                 :     /* error here since "first" is already disconnected */
                                 40               1 :     exec sql disconnect :id;
                                 41                 : 
                                 42                 :     /* disconnect from "second" */
                                 43               1 :     exec sql disconnect;
                                 44                 : 
 2943 peter_e@gmx.net            45               1 :     return 0;
                                 46                 : }
        

Generated by: LCOV version 2.4-beta