NCBI_NS_FTDS_CTLIB
70 if(
conn.m_ActiveCmd) {
71 conn.m_ActiveCmd->m_IsActive =
false;
73 conn.m_ActiveCmd =
this;
78 const string&
query)
86 if(
conn.m_ActiveCmd) {
87 conn.m_ActiveCmd->m_IsActive =
false;
89 conn.m_ActiveCmd =
this;
118 if(
conn.m_ActiveCmd) {
119 conn.m_ActiveCmd->m_IsActive =
false;
121 conn.m_ActiveCmd =
this;
140 const string&
query)
151 "Connection is not open or already dead."+
GetDbgInfo(),
159 "ct_cmd_alloc failed", 110001
184 switch(
Check(rc)) {
231 const string& param_name,
239param_fmt.
name[
l] =
'\0';
252 if( declare_only ) {
264 if( declare_only ) {
276 if( declare_only ) {
288 if( declare_only ) {
301 if( declare_only ) {
308 value.precision = 19;
312param_fmt.
scale= 0;
325 if( declare_only ) {
343 if( declare_only ) {
368CUtf8::AsBasicString<TCharUCS2>(str_check);
372 if( declare_only ) {
400 if( declare_only ) {
436 if( declare_only ) {
449 #if defined(FTDS_IN_USE) && defined(CS_TDS_72) 460 if( declare_only ) {
475 if( declare_only ) {
491 if( declare_only ) {
507 if( declare_only ) {
512 if(param.IsNULL()) {
531 if( declare_only ) {
536 if(param.IsNULL()) {
557 if( !param.IsNULL() ) {
572 lt.SetNanoSecond(
lt.NanoSecond() / 100 * 100);
574(GetConnection().GetDateTimeSyntax(),
598}
else if(par.
IsNULL()) {
602 size_t n= par.
Size();
606 _ASSERT(n2 >= 0 &&
static_cast<size_t>(n2) ==
n);
608 buf.get(), n2, indicator));
618 if( declare_only ) {
654 const string&
query)
676 switch(
Check(rc)) {
702 "You need to send a command first."+
GetDbgInfo(),
714unique_ptr<CTL_Connection::CAsyncCancelGuard> async_guard
785 "Your command has been canceled due to timeout",
800 switch( res_type ) {
811 "executing a command", 120016 );
854 if(
conn.AsyncCancel(*
this)) {
859 conn.m_CancelRequested =
true;
876TGuard::EContext guard_ctx;
877 switch(cancel_type) {
878 case eAsyncCancel: guard_ctx = TGuard::eAsyncCancel;
break;
879 case eSyncCancel: guard_ctx = TGuard::eSyncCancel;
break;
886 if( !guard.IsForCancelInProgress() ) {
891 CS_INTignored_results_type;
991 const string& lang_query
1009 if(dyn_id.
empty()) {
1014 "ct_command failed", 120001);
1015}
else if(dyn_id ==
"!") {
1020 const_cast<char*
>(dyn_id.
data()),
1022 "ct_dynamic(CS_EXECUTE) failed", 120004);
1057 "ct_dynamic(CS_DEALLOC) failed", 120005);
1060unique_ptr<CDB_Result>
r(
Result());
1094memset(¶m_fmt, 0,
sizeof(param_fmt));
1127 static const charkValid[] =
1128 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@$#_";
1137}
else if(
query.find(
'@') !=
NPOS) {
1141<<
" contains both ? and @. Treating @ as the" 1142 " parameter indicator because there are more" 1143 " parameters than question marks.");
1149 if(pos2 ==
NPOS) {
1154pos =
query.find(
'@', pos2);
1156}
while(pos !=
NPOS);
1160 if(used.
find(name) == used.
end()) {
1168<<
" contains both ? and @. Treating @ as the" 1169 " parameter indicator because all supplied parameter" 1175<<
" contains both ? and @. Treating ? as the" 1176 " parameter indicator because there are enough" 1177 " question marks and some or all supplied" 1178 " parameter names are absent: " 1188 const_cast<char*
>(
query.data()),
1190 "ct_dynamic(CS_PREPARE) failed", 120002);
1195unique_ptr<CDB_Result>
r(
Result());
void SetValue(const CTempString &s)
CTempString GetValue(void) const
void SetDead(bool flag=true)
void SetTimedOut(bool val)
void DropCmd(impl::CCommand &cmd)
virtual ~CTL_CmdBase(void)
void SetRetriable(ERetriable val)
CS_RETCODE Check(CS_RETCODE rc)
CTL_Connection & GetConnection(void)
void EnsureActiveStatus(void)
CTL_CmdBase(CTL_Connection &conn, const string &query)
ERetriable GetRetriable(void) const
bool GetTimedOut(void) const
virtual void SetHasFailed(bool flag=true)
void SetExecCntxInfo(const string &info)
const TDbgInfo & GetDbgInfo(void) const
CTL_RowResult * MakeStatusResult(void)
void SetResult(CTL_RowResult *result)
CTL_RowResult * MakeRowResult(void)
bool AssignCmdParam(CDB_Object ¶m, const string ¶m_name, CS_DATAFMT ¶m_fmt, bool declare_only=false)
void MarkEndOfReply(void)
bool ProcessResultInternal(CDB_Result &res)
CTL_RowResult * MakeComputeResult(void)
CTL_Cmd(CTL_Connection &conn, const string &query)
CS_COMMAND * x_GetSybaseCmd(void) const
void GetRowCount(int *cnt)
void DeleteResultInternal(void)
CTL_RowResult & GetResult(void)
CTL_RowResult * MakeParamResult(void)
CS_RETCODE CheckSFB_Internal(CS_RETCODE rc, const char *msg, unsigned int msg_num)
const CTLibContext & GetCTLibContext(void) const
CS_RETCODE Check(CS_RETCODE rc)
size_t PrepareToCancel(void)
void CancelFinished(size_t was_timeout)
CTL_CmdBase * m_ActiveCmd
CS_RETCODE CheckSFB(CS_RETCODE rc, const char *msg, unsigned int msg_num)
bool x_Cancel(ECancelType cancel_type) override
CTL_RowResult * MakeResultInternal(void)
CTL_LRCmd(CTL_Connection &conn, const string &query)
CDB_Result * MakeResult(void)
bool Cancel(void) override
Cancel the command execution.
virtual bool Send(void)
Send command to the server.
virtual CDB_Result * Result(void)
Get result set.
bool x_AssignParams(void)
virtual int RowCount(void) const
Get the number of rows affected by the command Special case: negative on error or if there is no way ...
CTL_LangCmd(CTL_Connection &conn, const string &lang_query)
CTempString x_GetDynamicID(void)
virtual ~CTL_LangCmd(void)
virtual bool HasMoreResults(void) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
const string & GetQuery(void) const
virtual bool HasFailed(void) const
const CDB_Params & GetBindParamsImpl(void) const
void DetachInterface(void)
void SetWasSent(bool flag=true)
static CDB_Result * Create_Result(CResult &result)
CDB_ResultProcessor * GetResultProcessor(void) const
CDBConnParams::EServerType GetServerType(void)
void SetClosingConnect(bool value)
CDB_Object * GetParam(unsigned int param_no) const
const string & GetParamName(unsigned int param_no) const
TStatus GetParamStatus(unsigned int param_no) const
unsigned int NofParams() const
EEncoding GetClientEncoding(void) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
impl::CDBExceptionStorage & GetCTLExceptionStorage(void)
#define NCBI_CS_STRING_TYPE
#define CS_DATETIME4_TYPE
#define CS_COMPUTEFMT_RESULT
#define CS_LONGBINARY_TYPE
#define CS_COMPUTE_RESULT
static CS_CONNECTION * conn
CS_RETCODE ct_dynamic(CS_COMMAND *cmd, CS_INT type, CS_CHAR *id, CS_INT idlen, CS_CHAR *buffer, CS_INT buflen)
CS_RETCODE ct_command(CS_COMMAND *cmd, CS_INT type, const CS_VOID *buffer, CS_INT buflen, CS_INT option)
CS_RETCODE ct_results(CS_COMMAND *cmd, CS_INT *result_type)
CS_RETCODE ct_res_info(CS_COMMAND *cmd, CS_INT type, CS_VOID *buffer, CS_INT buflen, CS_INT *out_len)
CS_RETCODE ct_cmd_drop(CS_COMMAND *cmd)
CS_RETCODE ct_cmd_alloc(CS_CONNECTION *con, CS_COMMAND **cmd)
CS_RETCODE ct_param(CS_COMMAND *cmd, CS_DATAFMT *datafmt, CS_VOID *data, CS_INT datalen, CS_SMALLINT indicator)
CS_RETCODE ct_send(CS_COMMAND *cmd)
CS_RETCODE ct_cancel(CS_CONNECTION *conn, CS_COMMAND *cmd, CS_INT type)
@ eRetriable_Unknown
It is unknown if the action can succeed if retried.
#define DATABASE_DRIVER_ERROR(message, err_code)
#define DATABASE_DRIVER_INFO(message, err_code)
#define CHECK_DRIVER_ERROR(failed, message, err_code)
#define DATABASE_DRIVER_WARNING(message, err_code)
#define DATABASE_DRIVER_FATAL(message, err_code)
virtual void ProcessResult(CDB_Result &res)
The default implementation just dumps all rows.
Uint2 GetMinutes(void) const
const void * Value() const
static EBlobType GetBlobType(EDB_Type db_type)
const TOffset & GetOffset(void) const
const char * Value(void) const
virtual EDB_Type GetType() const =0
const CTime & GetCTime(void) const
virtual bool MoveTo(size_t byte_number)
Uint2 GetDays(void) const
ESQLType GetSQLType(void) const
const string & AsString(void) const
static CTimeFormat GetTimeFormat(ESyntax syntax, ESQLType sql_type=eDateTime, TOffset offset=null)
virtual size_t Read(void *buff, size_t nof_bytes)
Int4 Get300Secs(void) const
const char * Data(void) const
virtual size_t Size() const
#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
#define NCBI_CURRENT_FUNCTION
Get current function name.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
@ eDiag_Error
Error message.
#define NCBI_CATCH_ALL_X(err_subcode, message)
#define FORMAT(message)
Format message using iostreams library.
void Info(CExceptionArgs_Base &args)
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
NCBI_NS_STD::string::size_type SIZE_TYPE
CTempString & assign(const char *src_str, size_type len)
Assign new values to the content of the a string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
const char * data(void) const
Return a pointer to the array represented.
bool empty(void) const
Return true if the represented string is empty (i.e., the length is zero)
static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)
Convert into UTF8 from a C/C++ string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static string CEncode(const CTempString str, EQuoted quoted=eQuoted)
Encode a string for C/C++.
size_type size(void) const
Return the length of the represented array.
Int4 days
days from 1/1/1900
CTime & SetTimeDBI(const TDBTimeI &t)
Set time using database format time, TDBTimeI.
Int4 time
x/300 seconds from the beginning of current day
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in dbapi libraries (dbapi_driver.lib and others).
if(yy_accept[yy_current_state])
void Check(const string &value)
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
unsigned char * longlong_to_numeric(Int8 l_num, unsigned int prec, unsigned char *cs_num)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
Database format for time where day and time is signed 32 bit.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4