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

Commitb85e910

Browse files
committed
Don't try to read default for a non-existent attribute
Oversight in commit9f8377f for COPY .. DEFAULTper report from Alexander Lakhin
1 parent483bdb2 commitb85e910

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/commands/copyfromparse.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,8 @@ CopyReadAttributesText(CopyFromState cstate)
16831683
strncmp(start_ptr,cstate->opts.null_print,input_len)==0)
16841684
cstate->raw_fields[fieldno]=NULL;
16851685
/* Check whether raw input matched default marker */
1686-
elseif (cstate->opts.default_print&&
1686+
elseif (fieldno<list_length(cstate->attnumlist)&&
1687+
cstate->opts.default_print&&
16871688
input_len==cstate->opts.default_print_len&&
16881689
strncmp(start_ptr,cstate->opts.default_print,input_len)==0)
16891690
{
@@ -1897,7 +1898,8 @@ CopyReadAttributesCSV(CopyFromState cstate)
18971898
strncmp(start_ptr,cstate->opts.null_print,input_len)==0)
18981899
cstate->raw_fields[fieldno]=NULL;
18991900
/* Check whether raw input matched default marker */
1900-
elseif (cstate->opts.default_print&&
1901+
elseif (fieldno<list_length(cstate->attnumlist)&&
1902+
cstate->opts.default_print&&
19011903
input_len==cstate->opts.default_print_len&&
19021904
strncmp(start_ptr,cstate->opts.default_print,input_len)==0)
19031905
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp