mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 20:43:02 +01:00
Optimize check of column NULLs when changing field or domain to NOT NULL.
This commit is contained in:
parent
f81d0aab14
commit
b50abdb04c
@ -4005,6 +4005,7 @@ static bool modify_field(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
|
||||
REL IN RDB$RELATIONS
|
||||
WITH REL.RDB$RELATION_NAME EQ RFL.RDB$RELATION_NAME AND
|
||||
RFL.RDB$FIELD_SOURCE EQ depName.c_str() AND
|
||||
(RFL.RDB$NULL_FLAG MISSING OR RFL.RDB$NULL_FLAG = FALSE) AND
|
||||
REL.RDB$VIEW_BLR MISSING
|
||||
REDUCED TO RFL.RDB$RELATION_NAME, RFL.RDB$FIELD_ID
|
||||
{
|
||||
@ -4014,7 +4015,10 @@ static bool modify_field(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
|
||||
|
||||
DeferredWork* work = DFW_post_work(transaction, dfw_check_not_null, &desc, 0);
|
||||
SortedArray<int>& ids = DFW_get_ids(work);
|
||||
ids.add(RFL.RDB$FIELD_ID);
|
||||
|
||||
FB_SIZE_T pos;
|
||||
if (!ids.find(RFL.RDB$FIELD_ID, pos))
|
||||
ids.insert(pos, RFL.RDB$FIELD_ID);
|
||||
}
|
||||
END_FOR
|
||||
}
|
||||
@ -5413,7 +5417,10 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
|
||||
DeferredWork* work = DFW_post_work(transaction,
|
||||
dfw_check_not_null, &desc, 0);
|
||||
SortedArray<int>& ids = DFW_get_ids(work);
|
||||
ids.add(RFR.RDB$FIELD_ID);
|
||||
|
||||
FB_SIZE_T pos;
|
||||
if (!ids.find(RFR.RDB$FIELD_ID, pos))
|
||||
ids.insert(pos, RFR.RDB$FIELD_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2576,7 +2576,11 @@ void VIO_modify(thread_db* tdbb, record_param* org_rpb, record_param* new_rpb, j
|
||||
|
||||
DeferredWork* work = DFW_post_work(transaction, dfw_check_not_null, &desc1, 0);
|
||||
SortedArray<int>& ids = DFW_get_ids(work);
|
||||
ids.add(MOV_get_long(&desc2, 0));
|
||||
|
||||
int id = MOV_get_long(&desc2, 0);
|
||||
FB_SIZE_T pos;
|
||||
if (!ids.find(id, pos))
|
||||
ids.insert(pos, id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user