mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 18:43:03 +01:00
Front ported fix for bug CORE-3282 : EXECUTE STATEMENT parses the SQL text using wrong charset
This commit is contained in:
parent
7130421c45
commit
8e4755b20f
@ -2274,7 +2274,7 @@ const StmtNode* ExecStatementNode::execute(thread_db* tdbb, jrd_req* request, Ex
|
||||
fb_assert(!*stmtPtr);
|
||||
|
||||
string sSql;
|
||||
getString(tdbb, request, sql, sSql);
|
||||
getString(tdbb, request, sql, sSql, true);
|
||||
|
||||
string sDataSrc;
|
||||
getString(tdbb, request, dataSource, sDataSrc);
|
||||
@ -2344,7 +2344,7 @@ const StmtNode* ExecStatementNode::execute(thread_db* tdbb, jrd_req* request, Ex
|
||||
}
|
||||
|
||||
void ExecStatementNode::getString(thread_db* tdbb, jrd_req* request, const ValueExprNode* node,
|
||||
string& str) const
|
||||
string& str, bool useAttCS) const
|
||||
{
|
||||
MoveBuffer buffer;
|
||||
UCHAR* p = NULL;
|
||||
@ -2352,7 +2352,10 @@ void ExecStatementNode::getString(thread_db* tdbb, jrd_req* request, const Value
|
||||
const dsc* dsc = node ? EVL_expr(tdbb, request, node) : NULL;
|
||||
|
||||
if (dsc && !(request->req_flags & req_null))
|
||||
len = MOV_make_string2(tdbb, dsc, dsc->getTextType(), &p, buffer);
|
||||
{
|
||||
const Jrd::Attachment* att = tdbb->getAttachment();
|
||||
len = MOV_make_string2(tdbb, dsc, useAttCS ? att->att_charset : dsc->getTextType(), &p, buffer);
|
||||
}
|
||||
|
||||
str = string((char*) p, len);
|
||||
str.trim();
|
||||
|
@ -412,7 +412,7 @@ private:
|
||||
static void genOptionalExpr(DsqlCompilerScratch* dsqlScratch, const UCHAR code, dsql_nod* node);
|
||||
|
||||
void getString(thread_db* tdbb, jrd_req* request, const ValueExprNode* node,
|
||||
Firebird::string& str) const;
|
||||
Firebird::string& str, bool useAttCS = false) const;
|
||||
|
||||
public:
|
||||
dsql_nod* dsqlSql;
|
||||
|
Loading…
Reference in New Issue
Block a user