Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbd8fe12

Browse files
committed
Relocate a badly placed Assert in COPY FROM code
There's not much point in asserting a pointer isn't NULL after some codehas already dereferenced that pointer.Adjust the code so that the Assert occurs before the pointer dereference.The Assert probably has questionable value in the first place, but itseems worth keeping around to document the contract betweenCopyMultiInsertInfoNextFreeSlot() and its callers.Author: Amul Sul <sulamul@gmail.com>Discussion:https://postgr.es/m/CAAJ_b94hXQzXaJxTLShkxQUgezf_SUxhzX9TH2f-g6gP7bne7g@mail.gmail.com
1 parent1d80d6b commitbd8fe12

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/commands/copyfrom.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,12 @@ CopyMultiInsertInfoNextFreeSlot(CopyMultiInsertInfo *miinfo,
597597
ResultRelInfo*rri)
598598
{
599599
CopyMultiInsertBuffer*buffer=rri->ri_CopyMultiInsertBuffer;
600-
intnused=buffer->nused;
600+
intnused;
601601

602602
Assert(buffer!=NULL);
603-
Assert(nused<MAX_BUFFERED_TUPLES);
603+
Assert(buffer->nused<MAX_BUFFERED_TUPLES);
604+
605+
nused=buffer->nused;
604606

605607
if (buffer->slots[nused]==NULL)
606608
buffer->slots[nused]=table_slot_create(rri->ri_RelationDesc,NULL);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp