8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 14:03:07 +01:00

Fixed CORE-3893 - Cannot restore tpcc database in FB 3.0.

This commit is contained in:
asfernandes 2012-07-20 02:41:58 +00:00
parent 561ef68248
commit 594bea6af3
8 changed files with 7 additions and 31 deletions

View File

@ -137,11 +137,6 @@ void BlrWriter::putDebugSrcInfo(USHORT line, USHORT col)
debugData.add(col >> 8);
ULONG offset = (blrData.getCount() - baseOffset);
// for DDL statements we store BLR's length at the first 2 bytes
if (isDdlDyn())
offset -= 2;
debugData.add(offset);
debugData.add(offset >> 8);
}

View File

@ -141,9 +141,6 @@ public:
virtual bool isVersion4() = 0;
protected:
virtual bool isDdlDyn() = 0;
private:
BlrData blrData;
DebugData debugData;

View File

@ -1072,12 +1072,6 @@ public:
return dsqlScratch->isVersion4();
}
protected:
virtual bool isDdlDyn()
{
return false;
}
private:
DsqlCompilerScratch* dsqlScratch;
};

View File

@ -62,6 +62,7 @@ public:
static const unsigned FLAG_SUB_ROUTINE = 0x0400;
static const unsigned FLAG_INTERNAL_REQUEST = 0x0800;
static const unsigned FLAG_AMBIGUOUS_STMT = 0x1000;
static const unsigned FLAG_DDL = 0x2000;
public:
DsqlCompilerScratch(MemoryPool& p, dsql_dbb* aDbb, jrd_tra* aTransaction,
@ -122,11 +123,6 @@ protected:
{
}
virtual bool isDdlDyn()
{
return statement->isDdl() && !(flags & FLAG_BLOCK);
}
public:
virtual bool isVersion4()
{

View File

@ -1388,6 +1388,7 @@ DeclareSubFuncNode* DeclareSubFuncNode::dsqlPass(DsqlCompilerScratch* dsqlScratc
dsqlScratch->getAttachment(), dsqlScratch->getTransaction(), statement);
blockScratch->clientDialect = dsqlScratch->clientDialect;
blockScratch->flags |= DsqlCompilerScratch::FLAG_FUNCTION | DsqlCompilerScratch::FLAG_SUB_ROUTINE;
blockScratch->flags |= dsqlScratch->flags & DsqlCompilerScratch::FLAG_DDL;
dsqlBlock = dsqlBlock->dsqlPass(blockScratch);
@ -1643,6 +1644,7 @@ DeclareSubProcNode* DeclareSubProcNode::dsqlPass(DsqlCompilerScratch* dsqlScratc
dsqlScratch->getAttachment(), dsqlScratch->getTransaction(), statement);
blockScratch->clientDialect = dsqlScratch->clientDialect;
blockScratch->flags |= DsqlCompilerScratch::FLAG_PROCEDURE | DsqlCompilerScratch::FLAG_SUB_ROUTINE;
blockScratch->flags |= dsqlScratch->flags & DsqlCompilerScratch::FLAG_DDL;
dsqlBlock = dsqlBlock->dsqlPass(blockScratch);

View File

@ -121,7 +121,7 @@ static void post_607(const Arg::StatusVector& v);
// Determine whether ids or names should be referenced when generating blr for fields and relations.
bool DDL_ids(const DsqlCompilerScratch* scratch)
{
return !scratch->getStatement()->isDdl();
return !(scratch->flags & DsqlCompilerScratch::FLAG_DDL);
}
@ -328,13 +328,8 @@ void DDL_resolve_intl_type2(DsqlCompilerScratch* dsqlScratch, dsql_fld* field,
const dsql_str* dfl_charset = NULL;
if (dsqlScratch->getStatement()->isDdl() ||
(dsqlScratch->flags & (
DsqlCompilerScratch::FLAG_FUNCTION | DsqlCompilerScratch::FLAG_PROCEDURE |
DsqlCompilerScratch::FLAG_TRIGGER)))
{
if (dsqlScratch->flags & DsqlCompilerScratch::FLAG_DDL)
dfl_charset = METD_get_default_charset(dsqlScratch->getTransaction());
}
else
{
USHORT charSet = dsqlScratch->getAttachment()->dbb_attachment->att_charset;

View File

@ -939,6 +939,8 @@ void DsqlDdlRequest::dsqlPass(thread_db* tdbb, DsqlCompilerScratch* scratch,
{
internalScratch = scratch;
scratch->flags |= DsqlCompilerScratch::FLAG_DDL;
node = Node::doDsqlPass(scratch, node);
if (scratch->getAttachment()->dbb_read_only)

View File

@ -458,11 +458,6 @@ public:
const Firebird::RefStrPtr& getSqlText() const { return sqlText; }
void setSqlText(Firebird::RefString* value) { sqlText = value; }
bool isDdl() const
{
return type == TYPE_DDL || type == TYPE_CREATE_DB;
}
dsql_msg* getSendMsg() { return sendMsg; }
const dsql_msg* getSendMsg() const { return sendMsg; }
void setSendMsg(dsql_msg* value) { sendMsg = value; }