NCBI C++ ToolKit
Macros | Functions | Variables
transaction2.c File Reference
#include "common.h"
#include <freetds/test_assert.h>
+ Include dependency graph for transaction2.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define SWAP(t, a, b)   do { t xyz = a; a = b; b = xyz; } while(0)
 
#define SWAP_CONN()   do { SWAP(HENV,env,odbc_env); SWAP(HDBC,dbc,odbc_conn); SWAP(HSTMT,stmt,odbc_stmt);} while(0)
 

Functions

static void ReadErrorConn (void)
 
static void AutoCommit (int onoff)
 
static void EndTransaction (SQLSMALLINT type)
 
static int CheckDirtyRead (void)
 
static int CheckNonrepeatableRead (void)
 
static int CheckPhantom (void)
 
static void my_attrs (void)
 
static void ConnectWithTxn (int txn)
 
static int Test (int txn, const char *expected)
 
int main (int argc, char *argv[])
 

Variables

static HENV env = SQL_NULL_HENV
 
static HDBC dbc = SQL_NULL_HDBC
 
static HSTMT stmt = SQL_NULL_HSTMT
 
static int test_with_connect = 0
 
static int global_txn
 
static int hide_error
 

Macro Definition Documentation

◆ SWAP

#define SWAP (   t,
  a,
  b 
)    do { t xyz = a; a = b; b = xyz; } while(0)

Definition at line 35 of file transaction2.c.

◆ SWAP_CONN

#define SWAP_CONN ( )    do { SWAP(HENV,env,odbc_env); SWAP(HDBC,dbc,odbc_conn); SWAP(HSTMT,stmt,odbc_stmt);} while(0)

Definition at line 36 of file transaction2.c.

Function Documentation

◆ AutoCommit()

static void AutoCommit ( int  onoff)
static

Definition at line 24 of file transaction2.c.

References CHKSetConnectAttr, SQL_ATTR_AUTOCOMMIT, and TDS_INT2PTR.

Referenced by main(), and my_attrs().

◆ CheckDirtyRead()

static int CheckDirtyRead ( void  )
static

◆ CheckNonrepeatableRead()

static int CheckNonrepeatableRead ( void  )
static

◆ CheckPhantom()

static int CheckPhantom ( void  )
static

◆ ConnectWithTxn()

static void ConnectWithTxn ( int  txn)
static

Definition at line 159 of file transaction2.c.

References global_txn, my_attrs(), NULL, odbc_connect(), and odbc_set_conn_attr.

Referenced by Test().

◆ EndTransaction()

static void EndTransaction ( SQLSMALLINT  type)
static

Definition at line 30 of file transaction2.c.

References CHKEndTran, odbc_conn, and SQL_HANDLE_DBC.

Referenced by CheckDirtyRead(), CheckNonrepeatableRead(), CheckPhantom(), and main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ my_attrs()

static void my_attrs ( void  )
static

◆ ReadErrorConn()

static void ReadErrorConn ( void  )
static

Definition at line 8 of file transaction2.c.

References C, CHKGetDiagRec, NULL, odbc_conn, odbc_err, ODBC_FREE, ODBC_GET, odbc_sqlstate, and SQL_HANDLE_DBC.

Referenced by main().

◆ Test()

static int Test ( int  txn,
const char *  expected 
)
static

Variable Documentation

◆ dbc

HDBC dbc = SQL_NULL_HDBC
static

Definition at line 39 of file transaction2.c.

◆ env

HENV env = SQL_NULL_HENV
static

Definition at line 38 of file transaction2.c.

◆ global_txn

int global_txn
static

Definition at line 147 of file transaction2.c.

Referenced by ConnectWithTxn(), and my_attrs().

◆ hide_error

int hide_error
static

Definition at line 149 of file transaction2.c.

Referenced by main(), and Test().

◆ stmt

HSTMT stmt = SQL_NULL_HSTMT
static

Definition at line 40 of file transaction2.c.

◆ test_with_connect

int test_with_connect = 0
static

Definition at line 145 of file transaction2.c.

Referenced by main(), and Test().

Modified on Tue Jun 18 13:37:16 2024 by modify_doxy.py rev. 669887