Commit fd9df11f authored by Andrew Dunstan's avatar Andrew Dunstan

Small stylistic improvement in recent FORCE QUOTE * code - use a bool instead of a magic value.

parent de7531a9
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.313 2009/07/25 00:07:11 adunstan Exp $ * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.314 2009/07/25 13:35:32 adunstan Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -729,9 +729,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString) ...@@ -729,9 +729,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
TupleDesc tupDesc; TupleDesc tupDesc;
int num_phys_attrs; int num_phys_attrs;
uint64 processed; uint64 processed;
bool force_quote_all = false;
/* a dummy list that represents 'all-columns' */
List all_columns = { T_List };
/* Allocate workspace and zero all fields */ /* Allocate workspace and zero all fields */
cstate = (CopyStateData *) palloc0(sizeof(CopyStateData)); cstate = (CopyStateData *) palloc0(sizeof(CopyStateData));
...@@ -813,7 +811,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString) ...@@ -813,7 +811,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
errmsg("conflicting or redundant options"))); errmsg("conflicting or redundant options")));
if (IsA(defel->arg, A_Star)) if (IsA(defel->arg, A_Star))
force_quote = &all_columns; force_quote_all = true;
else else
force_quote = (List *) defel->arg; force_quote = (List *) defel->arg;
} }
...@@ -1099,7 +1097,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString) ...@@ -1099,7 +1097,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
/* Convert FORCE QUOTE name list to per-column flags, check validity */ /* Convert FORCE QUOTE name list to per-column flags, check validity */
cstate->force_quote_flags = (bool *) palloc0(num_phys_attrs * sizeof(bool)); cstate->force_quote_flags = (bool *) palloc0(num_phys_attrs * sizeof(bool));
if (force_quote == &all_columns) if (force_quote_all)
{ {
int i; int i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment