2017-03-13 20:47:27 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
exec sql include ../regression;
|
|
|
|
|
|
|
|
exec sql whenever sqlerror sqlprint;
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
char msg[128];
|
|
|
|
|
|
|
|
ECPGdebug(1, stderr);
|
|
|
|
|
|
|
|
strcpy(msg, "connect");
|
|
|
|
exec sql connect to REGRESSDB1;
|
|
|
|
exec sql set autocommit to off;
|
|
|
|
|
|
|
|
strcpy(msg, "create");
|
|
|
|
exec sql create table t1(c int);
|
|
|
|
|
|
|
|
strcpy(msg, "commit");
|
|
|
|
exec sql commit;
|
|
|
|
|
|
|
|
strcpy(msg, "begin");
|
|
|
|
exec sql begin;
|
|
|
|
|
|
|
|
strcpy(msg, "insert");
|
|
|
|
exec sql insert into t1 values(1);
|
|
|
|
|
|
|
|
strcpy(msg, "prepare transaction");
|
2024-04-29 14:10:41 +02:00
|
|
|
exec sql prepare transaction 'ecpg_twophase';
|
2017-03-13 20:47:27 +01:00
|
|
|
|
|
|
|
strcpy(msg, "commit prepared");
|
2024-04-29 14:10:41 +02:00
|
|
|
exec sql commit prepared 'ecpg_twophase';
|
2017-03-13 20:47:27 +01:00
|
|
|
|
|
|
|
strcpy(msg, "drop");
|
|
|
|
exec sql drop table t1;
|
|
|
|
|
|
|
|
strcpy(msg, "disconnect");
|
|
|
|
exec sql disconnect current;
|
|
|
|
|
2017-08-17 18:39:20 +02:00
|
|
|
return 0;
|
2017-03-13 20:47:27 +01:00
|
|
|
}
|