LCOV - code coverage report
Current view: top level - src/interfaces/ecpg/test/sql - twophase.pgc (source / functions) Hit Total Coverage
Test: PostgreSQL 18devel Lines: 31 31 100.0 %
Date: 2024-12-02 19:14:57 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #include <stdio.h>
       2             : #include <stdlib.h>
       3             : #include <string.h>
       4             : 
       5             : exec sql include ../regression;
       6             : 
       7             : exec sql whenever sqlerror sqlprint;
       8             : 
       9           4 : int main(void)
      10             : {
      11             :     char msg[128];
      12             : 
      13           4 :     ECPGdebug(1, stderr);
      14             : 
      15           4 :     strcpy(msg, "connect");
      16           4 :     exec sql connect to REGRESSDB1;
      17           4 :     exec sql set autocommit to off;
      18           4 : 
      19           4 :     strcpy(msg, "create");
      20           4 :     exec sql create table t1(c int);
      21           4 : 
      22           4 :     strcpy(msg, "commit");
      23           4 :     exec sql commit;
      24           4 : 
      25           4 :     strcpy(msg, "begin");
      26           4 :     exec sql begin;
      27           4 : 
      28           4 :     strcpy(msg, "insert");
      29           4 :     exec sql insert into t1 values(1);
      30           4 : 
      31           4 :     strcpy(msg, "prepare transaction");
      32           4 :     exec sql prepare transaction 'ecpg_twophase';
      33           4 : 
      34           4 :     strcpy(msg, "commit prepared");
      35           4 :     exec sql commit prepared 'ecpg_twophase';
      36           4 : 
      37           4 :     strcpy(msg, "drop");
      38           4 :     exec sql drop table t1;
      39           4 : 
      40           4 :     strcpy(msg, "disconnect");
      41           4 :     exec sql disconnect current;
      42           4 : 
      43           4 :     return 0;
      44             : }

Generated by: LCOV version 1.14