mirror of https://github.com/citusdata/citus.git
Make copy_options.ch similar to PostgreSQL copy.c
We reorganized these functions in our copy; not sure why (makes diffing harder). I'm moving it back.pull/327/head
parent
bc23113732
commit
2b5ae847d4
|
@ -16,7 +16,21 @@
|
|||
#include "stringutils.h"
|
||||
|
||||
|
||||
/* Concatenates "more" onto "var", and frees the original value of *var. */
|
||||
void
|
||||
free_copy_options(copy_options * ptr)
|
||||
{
|
||||
if (!ptr)
|
||||
return;
|
||||
free(ptr->before_tofrom);
|
||||
free(ptr->after_tofrom);
|
||||
free(ptr->file);
|
||||
free(ptr->tableName);
|
||||
free(ptr->columnList);
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
||||
/* concatenate "more" onto "var", freeing the original value of *var */
|
||||
static void
|
||||
xstrcat(char **var, const char *more)
|
||||
{
|
||||
|
@ -212,20 +226,6 @@ error:
|
|||
|
||||
|
||||
/* Frees copy options. */
|
||||
void
|
||||
free_copy_options(copy_options * ptr)
|
||||
{
|
||||
if (!ptr)
|
||||
return;
|
||||
free(ptr->before_tofrom);
|
||||
free(ptr->after_tofrom);
|
||||
free(ptr->file);
|
||||
free(ptr->tableName);
|
||||
free(ptr->columnList);
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ParseStageOptions takes the given copy options, parses the additional options
|
||||
* needed for the \stage command, and sets them in the copy options structure.
|
||||
|
|
|
@ -46,7 +46,7 @@ typedef struct copy_options
|
|||
bool psql_inout; /* true = use psql stdin/stdout */
|
||||
bool from; /* true = FROM, false = TO */
|
||||
|
||||
char *tableName; /* table name to stage data to */
|
||||
char *tableName; /* table name to stage data to */
|
||||
char *columnList; /* optional column list used in staging */
|
||||
} copy_options;
|
||||
|
||||
|
|
Loading…
Reference in New Issue