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

Method getFlags

src/remote/client/interface.cpp:4583–4625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4581
4582
4583unsigned Statement::getFlags(CheckStatusWrapper* status)
4584{
4585 try
4586 {
4587 reset(status);
4588
4589 // Check and validate handles, etc.
4590
4591 CHECK_HANDLE(statement, isc_bad_req_handle);
4592 Rdb* rdb = statement->rsr_rdb;
4593 rem_port* port = rdb->rdb_port;
4594 RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION);
4595
4596 statement->raiseException();
4597
4598 if (port->port_protocol >= PROTOCOL_VERSION13)
4599 {
4600 // we are in luck - use flags from server
4601 return metadata.getFlags();
4602 }
4603
4604 // Need to guess flags based on statement type
4605 unsigned value = IStatement::FLAG_REPEAT_EXECUTE;
4606 switch (metadata.getType())
4607 {
4608 case isc_info_sql_stmt_ddl:
4609 value &= ~IStatement::FLAG_REPEAT_EXECUTE;
4610 break;
4611 case isc_info_sql_stmt_select:
4612 case isc_info_sql_stmt_select_for_upd:
4613 value |= IStatement::FLAG_HAS_CURSOR;
4614 break;
4615 }
4616
4617 return value;
4618 }
4619 catch (const Exception& ex)
4620 {
4621 ex.stuffException(status);
4622 }
4623
4624 return 0;
4625}
4626
4627
4628const char* Statement::getPlan(CheckStatusWrapper* status, FB_BOOLEAN detailed)

Callers 1

execute_statementMethod · 0.45

Calls 5

CHECK_HANDLEFunction · 0.85
raiseExceptionMethod · 0.80
resetFunction · 0.70
getTypeMethod · 0.45
stuffExceptionMethod · 0.45

Tested by

no test coverage detected