SQLRETURN SRVR_STMT_HDL::Prepare(const SQLValue_def *inSqlString, short inStmtType, short inHoldability, long inQueryTimeout,bool isISUD) { FUNCTION_ENTRY("SRVR_STMT_HDL::Prepare",("")); DEBUG_OUT(DEBUG_LEVEL_ENTRY,(" inSqlString='%s'", CLI_SQL_VALUE_STR(inSqlString))); DEBUG_OUT(DEBUG_LEVEL_ENTRY,(" inStmtType=%s, inHoldability=%d, inQueryTimeout=%ld, isISUD=%d", CliDebugStatementType(inStmtType), inHoldability, inQueryTimeout,isISUD)); SQLRETURN rc; size_t len; this->isISUD = isISUD; if (isReadFromModule) // Already SMD label is found CLI_DEBUG_RETURN_SQL(SQL_SUCCESS); // cleanup all memory allocated in the previous operations cleanupAll(); sqlString.dataCharset = inSqlString->dataCharset; sqlString.dataType = inSqlString->dataType; MEMORY_ALLOC_ARRAY(sqlString.dataValue._buffer,unsigned char,inSqlString->dataValue._length+1); sqlString.dataValue._length = inSqlString->dataValue._length+1; strncpy((char *)sqlString.dataValue._buffer, (const char *)inSqlString->dataValue._buffer, inSqlString->dataValue._length); sqlString.dataValue._buffer[inSqlString->dataValue._length] = '\0'; stmtType = inStmtType; holdability = inHoldability; CLI_DEBUG_RETURN_SQL(PREPARE(this)); }
~WrapperCollection() { cleanupAll(); // TODO: don't know why, but segfaults on exit without this line // crashes in clock destructor, internal reference count of // shared pointer to lcm object is invalid memory (from valgrind) // valgrind shows no errors when this line is present drc::Clock::instance()->setLcm(std::shared_ptr<lcm::LCM>()); }
SRVR_STMT_HDL::~SRVR_STMT_HDL() { FUNCTION_ENTRY("SRVR_STMT_HDL()::~SRVR_STMT_HDL",(NULL)); int retcode; cleanupAll(); #ifndef DISABLE_NOWAIT if (stmtInitForNowait) mutexCondDestroy(&cond, &mutex); #endif FUNCTION_RETURN_VOID((NULL)); }