Skip to content

Commit

Permalink
HAWQ-1651. Fix some bugs in bulid and unittest.
Browse files Browse the repository at this point in the history
  • Loading branch information
oushu1wangziming1 authored and huor committed Aug 23, 2018
1 parent 0a271bc commit da823d7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 21 deletions.
1 change: 0 additions & 1 deletion contrib/exthdfs/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "fmgr.h"
#include "funcapi.h"
#include "access/extprotocol.h"
#include "access/fileam.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_exttable.h"
#include "utils/array.h"
Expand Down
2 changes: 1 addition & 1 deletion src/backend/cdb/cdbvars.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ bool gp_interconnect_cache_future_packets=true;

int Gp_udp_bufsize_k; /* UPD recv buf size, in KB */

#ifdef USE_ASSERT_CHECKING
/*
* UDP-IC Test hooks (for fault injection).
*
* Dropseg: specifies which segment to apply the drop_percent to.
*/
#ifdef USE_ASSERT_CHECKING
int gp_udpic_dropseg = UNDEF_SEGMENT;
int gp_udpic_dropxmit_percent = 0;
int gp_udpic_dropacks_percent = 0;
Expand Down
20 changes: 10 additions & 10 deletions src/backend/commands/tablecmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -18380,7 +18380,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format
{
DefElem *defel = (DefElem *)lfirst(option);

if (strcmp(defel->defname, "delimiter") == 0)
if (strcmp(defel->defname, "delimiter") == 0 || strcmp(defel->defname, "delimiter_as") == 0 )
{
if (delim)
ereport(ERROR,
Expand All @@ -18389,7 +18389,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format
errOmitLocation(true)));
delim = strVal(defel->arg);
}
else if (strcmp(defel->defname, "null") == 0)
else if (strcmp(defel->defname, "null") == 0 || strcmp(defel->defname, "null_as") == 0)
{
if (null_print)
ereport(ERROR,
Expand All @@ -18398,7 +18398,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format
errOmitLocation(true)));
null_print = strVal(defel->arg);
}
else if (strcmp(defel->defname, "header") == 0)
else if (strcmp(defel->defname, "header") == 0 || strcmp(defel->defname, "header_as") == 0)
{
if (header_line)
ereport(ERROR,
Expand All @@ -18407,7 +18407,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format
errOmitLocation(true)));
header_line = intVal(defel->arg);
}
else if (strcmp(defel->defname, "quote") == 0)
else if (strcmp(defel->defname, "quote") == 0 || strcmp(defel->defname, "quote_as") == 0)
{
if (quote)
ereport(ERROR,
Expand All @@ -18416,7 +18416,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format
errOmitLocation(true)));
quote = strVal(defel->arg);
}
else if (strcmp(defel->defname, "escape") == 0)
else if (strcmp(defel->defname, "escape") == 0 || strcmp(defel->defname, "escape_as") == 0)
{
if (escape)
ereport(ERROR,
Expand All @@ -18425,7 +18425,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format
errOmitLocation(true)));
escape = strVal(defel->arg);
}
else if (strcmp(defel->defname, "force_notnull") == 0)
else if (strcmp(defel->defname, "force_notnull") == 0 || strcmp(defel->defname, "force_notnull_as") == 0)
{
if (force_notnull)
ereport(ERROR,
Expand All @@ -18435,7 +18435,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format

force_notnull = (List *) defel->arg;
}
else if (strcmp(defel->defname, "force_quote") == 0)
else if (strcmp(defel->defname, "force_quote") == 0 || strcmp(defel->defname, "force_quote_as") == 0)
{
if (force_quote)
ereport(ERROR,
Expand All @@ -18445,7 +18445,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format

force_quote = (List *) defel->arg;
}
else if (strcmp(defel->defname, "fill_missing_fields") == 0)
else if (strcmp(defel->defname, "fill_missing_fields") == 0 || strcmp(defel->defname, "fill_missing_fields_as") == 0)
{
if (fill_missing)
ereport(ERROR,
Expand All @@ -18454,7 +18454,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format
errOmitLocation(true)));
fill_missing = intVal(defel->arg);
}
else if (strcmp(defel->defname, "newline") == 0)
else if (strcmp(defel->defname, "newline") == 0 || strcmp(defel->defname, "newline_as") == 0)
{
if (eol_str)
ereport(ERROR,
Expand All @@ -18463,7 +18463,7 @@ static Datum transformFormatOpts(char formattype, char *formatname, char *format
errOmitLocation(true)));
eol_str = strVal(defel->arg);
}
else if (strcmp(defel->defname, "formatter") == 0)
else if (strcmp(defel->defname, "formatter") == 0 || strcmp(defel->defname, "formatter_as") == 0)
{
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
Expand Down
10 changes: 5 additions & 5 deletions src/backend/parser/analyze.c
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ enum PreDefinedFormatterOptionVALTYPE {
PREDEF_FMTOPT_VAL_COLNAMELIST
};

enum PreDefinedFormatterOptionID {
typedef enum PreDefinedFormatterOptionID {
PREDEF_FMT_OPT_ID_DELIMITER,
PREDEF_FMT_OPT_ID_NULL,
PREDEF_FMT_OPT_ID_HEADER,
Expand All @@ -2207,7 +2207,7 @@ enum PreDefinedFormatterOptionID {
PREDEF_FMT_OPT_ID_NEWLINE,
PREDEF_FMT_OPT_ID_UNPREDEFINED,
PREDEF_FMT_OPT_ID_ILLEGAL
};
}PreDefinedFormatterOptionID;

typedef struct PreDefinedFormatterOption {
char keyword[3][32];
Expand Down Expand Up @@ -2253,7 +2253,7 @@ enum PreDefinedFormatterOptionID MatchExternalRelationFormatterOption(
(options[i].valueType == PREDEF_FMTOPT_VAL_COLNAMELIST))) {
return options[i].optID; /* Got option having one value */
} else {
return PREDEF_FMT_OPT_ID_ILLEGAL; /* no expected value type */
return PREDEF_FMT_OPT_ID_UNPREDEFINED; /* no expected value type */
}
} else if (pdOpt->nKeyword == 2 && de2 != NULL &&
strcasecmp(pdOpt->keyword[0], ((Value *)(de1->arg))->val.str) ==
Expand All @@ -2274,7 +2274,7 @@ enum PreDefinedFormatterOptionID MatchExternalRelationFormatterOption(
(options[i].valueType == PREDEF_FMTOPT_VAL_COLNAMELIST))) {
return options[i].optID; /* Got option having one value */
} else {
return PREDEF_FMT_OPT_ID_ILLEGAL; /* no expected value type */
return PREDEF_FMT_OPT_ID_UNPREDEFINED; /* no expected value type */
}
} else if (pdOpt->nKeyword == 3 && de2 != NULL && de3 != NULL &&
strcasecmp(pdOpt->keyword[0], ((Value *)(de1->arg))->val.str) ==
Expand All @@ -2297,7 +2297,7 @@ enum PreDefinedFormatterOptionID MatchExternalRelationFormatterOption(
(options[i].valueType == PREDEF_FMTOPT_VAL_COLNAMELIST))) {
return options[i].optID; /* Got option having one value */
} else {
return PREDEF_FMT_OPT_ID_ILLEGAL; /* no expected value type */
return PREDEF_FMT_OPT_ID_UNPREDEFINED; /* no expected value type */
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/backend/utils/mmgr/mcxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,6 @@ MemoryContextStats(MemoryContext context)
*
* This is just a debugging utility, so it's not fancy.
*/
#ifdef MEMORY_CONTEXT_CHECKING
void
MemoryContextCheck(MemoryContext context)
{
Expand All @@ -840,7 +839,6 @@ MemoryContextCheck(MemoryContext context)
for (child = context->firstchild; child != NULL; child = child->nextchild)
MemoryContextCheck(child);
}
#endif

/*
* MemoryContextContains
Expand Down
2 changes: 0 additions & 2 deletions src/include/nodes/memnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ typedef struct MemoryContextMethods
void (*stats) (MemoryContext context, uint64 *nBlocks, uint64 *nChunks, uint64 *currentAvailable, uint64 *allAllocated, uint64 *allFreed, uint64 *maxHeld);
void (*release_accounting)(MemoryContext context);
void (*update_generation)(MemoryContext context);
#ifdef MEMORY_CONTEXT_CHECKING
void (*check) (MemoryContext context);
#endif
} MemoryContextMethods;


Expand Down

0 comments on commit da823d7

Please sign in to comment.