mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 20:43:02 +01:00
Misc.
This commit is contained in:
parent
5ec7cda835
commit
b5e103c3f5
@ -53,7 +53,7 @@ PreparedStatement::PreparedStatement(thread_db* tdbb, Firebird::MemoryPool& pool
|
||||
|
||||
if (request->req_receive)
|
||||
{
|
||||
for (dsql_par* par = request->req_receive->msg_parameters; par; par = par->par_next)
|
||||
for (const dsql_par* par = request->req_receive->msg_parameters; par; par = par->par_next)
|
||||
{
|
||||
if (!par->par_index)
|
||||
continue;
|
||||
@ -85,7 +85,7 @@ PreparedStatement::PreparedStatement(thread_db* tdbb, Firebird::MemoryPool& pool
|
||||
|
||||
for (int j = 1; j <= paramCount / 2; ++j)
|
||||
{
|
||||
for (dsql_par* par = request->req_receive->msg_parameters; par; par = par->par_next)
|
||||
for (const dsql_par* par = request->req_receive->msg_parameters; par; par = par->par_next)
|
||||
{
|
||||
if (par->par_index != j)
|
||||
continue;
|
||||
@ -150,7 +150,7 @@ ResultSet* PreparedStatement::executeQuery(thread_db* tdbb, jrd_tra* transaction
|
||||
}
|
||||
|
||||
|
||||
int PreparedStatement::getResultCount()
|
||||
int PreparedStatement::getResultCount() const
|
||||
{
|
||||
return values.getCount() / 2;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
void execute(thread_db* tdbb, jrd_tra* transaction);
|
||||
ResultSet* executeQuery(thread_db* tdbb, jrd_tra* transaction);
|
||||
|
||||
int getResultCount();
|
||||
int getResultCount() const;
|
||||
|
||||
dsql_req* getRequest()
|
||||
{
|
||||
|
@ -76,12 +76,12 @@ bool ResultSet::fetch(thread_db* tdbb)
|
||||
}
|
||||
|
||||
|
||||
bool ResultSet::isNull(int param)
|
||||
bool ResultSet::isNull(int param) const
|
||||
{
|
||||
dsc* desc = &stmt->values[(param - 1) * 2 + 1];
|
||||
const dsc* desc = &stmt->values[(param - 1) * 2 + 1];
|
||||
fb_assert(desc->dsc_dtype == dtype_short);
|
||||
|
||||
return *(SSHORT*) desc->dsc_address != 0;
|
||||
return *reinterpret_cast<SSHORT*>(desc->dsc_address) != 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
|
||||
public:
|
||||
bool fetch(thread_db* tdbb);
|
||||
bool isNull(int param);
|
||||
bool isNull(int param) const;
|
||||
dsc& getDesc(int param);
|
||||
|
||||
private:
|
||||
|
@ -47,7 +47,7 @@ using namespace Jrd;
|
||||
using Firebird::AutoPtr;
|
||||
|
||||
|
||||
void ExecuteStatement::execute(Jrd::thread_db* tdbb, jrd_req* request, DSC* dsc)
|
||||
void ExecuteStatement::execute(Jrd::thread_db* tdbb, jrd_req* request, DSC* desc)
|
||||
{
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
@ -60,7 +60,7 @@ void ExecuteStatement::execute(Jrd::thread_db* tdbb, jrd_req* request, DSC* dsc)
|
||||
}
|
||||
|
||||
Firebird::string sqlStatementText;
|
||||
getString(tdbb, sqlStatementText, dsc, request);
|
||||
getString(tdbb, sqlStatementText, desc, request);
|
||||
|
||||
transaction->tra_callback_count++;
|
||||
|
||||
@ -196,7 +196,9 @@ bool ExecuteStatement::fetch(thread_db* tdbb, jrd_nod** jrdVar)
|
||||
void ExecuteStatement::close(thread_db* tdbb)
|
||||
{
|
||||
delete resultSet;
|
||||
resultSet = NULL;
|
||||
delete stmt;
|
||||
stmt = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace Jrd {
|
||||
class ExecuteStatement
|
||||
{
|
||||
public:
|
||||
static void execute(Jrd::thread_db* tdbb, Jrd::jrd_req* request, DSC* dsc);
|
||||
static void execute(Jrd::thread_db* tdbb, Jrd::jrd_req* request, DSC* desc);
|
||||
void open(Jrd::thread_db* tdbb, Jrd::jrd_nod* sql, SSHORT nVars, bool singleton);
|
||||
bool fetch(Jrd::thread_db* tdbb, Jrd::jrd_nod** jrdVar);
|
||||
void close(Jrd::thread_db* tdbb);
|
||||
|
Loading…
Reference in New Issue
Block a user