MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / par_transaction_modes

Function par_transaction_modes

src/gpre/sql.cpp:6361–6418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6359//
6360
6361static bool par_transaction_modes(gpre_tra* trans, bool expect_iso)
6362{
6363
6364 if (MSC_match(KW_READ))
6365 {
6366 if (MSC_match(KW_ONLY))
6367 {
6368 if (expect_iso)
6369 CPR_s_error("SNAPSHOT");
6370
6371 trans->tra_flags |= TRA_ro;
6372 return true;
6373 }
6374
6375 if (MSC_match(KW_WRITE))
6376 {
6377 if (expect_iso)
6378 CPR_s_error("SNAPSHOT");
6379
6380 return true;
6381 }
6382
6383 if (!(MSC_match(KW_COMMITTED) || MSC_match(KW_UNCOMMITTED)))
6384 CPR_s_error("COMMITTED");
6385
6386 trans->tra_flags |= TRA_read_committed;
6387
6388 if (MSC_match(KW_NO))
6389 {
6390 if (MSC_match(KW_VERSION))
6391 return true;
6392 if (MSC_match(KW_WAIT))
6393 {
6394 trans->tra_flags |= TRA_nw;
6395 return true;
6396 }
6397 CPR_s_error("WAIT or VERSION");
6398 }
6399
6400 if (MSC_match(KW_VERSION))
6401 trans->tra_flags |= TRA_rec_version;
6402
6403 return true;
6404 }
6405
6406 if (MSC_match(KW_SNAPSHOT))
6407 {
6408 if (MSC_match(KW_TABLE))
6409 {
6410 trans->tra_flags |= TRA_con;
6411
6412 MSC_match(KW_STABILITY);
6413 }
6414 return true;
6415 }
6416
6417 return false;
6418}

Callers 1

act_set_transactionFunction · 0.85

Calls 2

MSC_matchFunction · 0.85
CPR_s_errorFunction · 0.85

Tested by

no test coverage detected