Commit e55f025
committed
Refactor CopyFrom() in copyfrom.c.
This commit simplifies CopyFrom() by removing the unnecessary local variable
'skipped', which tracked the number of rows skipped due to on_error = 'ignore'.
That count is already handled by cstate->num_errors, so the 'skipped' variable
was redundant.
Additionally, the condition on_error != COPY_ON_ERROR_STOP is removed.
Since on_error == COPY_ON_ERROR_IGNORE is already checked, and on_error
only has two values (ignore and stop), the additional check was redundant
and made the logic harder to read. Seemingly this was introduced
in preparation for a future patch, but the current checks don’t offer
clear value and have been removed to improve readability.
Author: Atsushi Torikoshi
Reviewed-by: Masahiko Sawada, Fujii Masao
Discussion: https://postgr.es/m/ab59dad10490ea3734cf022b16c24cfd@oss.nttdata.com1 parent a1c4c8a commit e55f025
1 file changed
+8
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
660 | | - | |
661 | 660 | | |
662 | 661 | | |
663 | 662 | | |
| |||
1004 | 1003 | | |
1005 | 1004 | | |
1006 | 1005 | | |
1007 | | - | |
| 1006 | + | |
1008 | 1007 | | |
1009 | 1008 | | |
1010 | 1009 | | |
1011 | | - | |
1012 | | - | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1013 | 1014 | | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
| 1015 | + | |
1022 | 1016 | | |
1023 | 1017 | | |
1024 | 1018 | | |
1025 | | - | |
| 1019 | + | |
1026 | 1020 | | |
| 1021 | + | |
1027 | 1022 | | |
1028 | 1023 | | |
1029 | 1024 | | |
| |||
0 commit comments