LCOV - differential code coverage report
Current view: top level - src/interfaces/ecpg/test/connect - test2.pgc (source / functions) Coverage Total Hit CBC
Current: Differential Code Coverage HEAD vs 15 Lines: 100.0 % 15 15 15
Current Date: 2023-04-08 15:15:32 Functions: 100.0 % 1 1 1
Baseline: 15
Baseline Date: 2023-04-08 15:09:40
Legend: Lines: hit not hit

           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
      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");
      24               1 :     exec sql connect to ecpg2_regression as :id;
      25               1 :     exec sql connect to REGRESSDB1 as second;
      26                 : 
      27                 :     /* this selects from "second" which was opened last */
      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                 : 
      45               1 :     return 0;
      46                 : }
        

Generated by: LCOV version v1.16-55-g56c0a2a