8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:43:04 +01:00

Always use the dialect 3 for system SQL queries

This commit is contained in:
asfernandes 2010-01-03 18:23:22 +00:00
parent b0142102ac
commit 32baf214bb
2 changed files with 3 additions and 2 deletions

View File

@ -187,7 +187,8 @@ void PreparedStatement::init(thread_db* tdbb, Attachment* attachment, jrd_tra* t
try
{
const Database& dbb = *tdbb->getDatabase();
const int dialect = dbb.dbb_flags & DBB_DB_SQL_dialect_3 ? SQL_DIALECT_V6 : SQL_DIALECT_V5;
const int dialect = isInternalRequest || (dbb.dbb_flags & DBB_DB_SQL_dialect_3) ?
SQL_DIALECT_V6 : SQL_DIALECT_V5;
DSQL_prepare(tdbb, transaction, &request, text.length(), text.c_str(), dialect,
0, NULL, 0, NULL, isInternalRequest);

View File

@ -2238,7 +2238,7 @@ static bool modify_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
sql << "select"
<< sql("rel.rdb$relation_name,", rdbRelationName)
<< sql("rel.rdb$relation_type", rdbRelationType)
<< "from rdb$indices idx join rdb$relations rel on rel.rdb$relation_name = idx.rdb$relation_name"
<< "from rdb$indices idx join rdb$relations rel using (rdb$relation_name)"
<< "where idx.rdb$index_name = " << work->dfw_name;
AutoPreparedStatement ps(attachment->prepareStatement(tdbb, dbb->dbb_sys_trans, sql));
AutoResultSet rs(ps->executeQuery(tdbb, dbb->dbb_sys_trans));