mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 04:43:03 +01:00
Fixed the INSERT INTO ... SELECT bug reported by Ivan Prenosil in fb-devel.
This commit is contained in:
parent
c1da0c0e8a
commit
93aa34bddb
@ -199,6 +199,30 @@ namespace Firebird {
|
||||
Stack<Object, Capacity>& stack;
|
||||
};
|
||||
|
||||
// Restore the stack when we go out of scope.
|
||||
class AutoRestore
|
||||
{
|
||||
public:
|
||||
AutoRestore(Stack<Object, Capacity>& s)
|
||||
: stack(s),
|
||||
count(s.getCount())
|
||||
{
|
||||
}
|
||||
|
||||
~AutoRestore()
|
||||
{
|
||||
size_t currentCount = stack.getCount();
|
||||
fb_assert(currentCount >= count);
|
||||
|
||||
while (currentCount-- > count)
|
||||
stack.pop();
|
||||
}
|
||||
|
||||
private:
|
||||
Stack<Object, Capacity>& stack;
|
||||
size_t count;
|
||||
};
|
||||
|
||||
class iterator;
|
||||
friend class iterator;
|
||||
|
||||
|
@ -5497,6 +5497,7 @@ DmlNode* StoreNode::parse(thread_db* tdbb, MemoryPool& pool, CompilerScratch* cs
|
||||
StmtNode* StoreNode::internalDsqlPass(DsqlCompilerScratch* dsqlScratch, bool updateOrInsert)
|
||||
{
|
||||
thread_db* tdbb = JRD_get_thread_data();
|
||||
DsqlContextStack::AutoRestore autoContext(*dsqlScratch->context);
|
||||
|
||||
dsqlScratch->getStatement()->setType(DsqlCompiledStatement::TYPE_INSERT);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user