Skip to content

Commit

Permalink
pgindent run and update changelog for last msvc commit.
Browse files Browse the repository at this point in the history
Also update typedefs.list
  • Loading branch information
rjuju committed Jun 16, 2019
1 parent 3f89878 commit b3a84ff
Show file tree
Hide file tree
Showing 8 changed files with 978 additions and 300 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Changelog
=========

WIP version 1.1.3:
------------------

**Miscellaneous**

- Use a dedicated MemoryContext to store hypothetical objects
- Fix compatibility on Windows (Godwottery)

**Bug fixed**

- Call previous explain_get_index_name_hook if it was setup
- add hypopg_reset_index() SQL function

2018-05-30 version 1.1.2:
-------------------------

Expand Down
56 changes: 28 additions & 28 deletions hypopg.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,49 +25,49 @@ PG_MODULE_MAGIC;

/*--- Variables exported ---*/

bool isExplain;
bool hypo_is_enabled;
bool isExplain;
bool hypo_is_enabled;
MemoryContext HypoMemoryContext;

/*--- Functions --- */

PGDLLEXPORT void _PG_init(void);
PGDLLEXPORT void _PG_fini(void);
PGDLLEXPORT void _PG_init(void);
PGDLLEXPORT void _PG_fini(void);

PGDLLEXPORT Datum hypopg_reset(PG_FUNCTION_ARGS);
PGDLLEXPORT Datum hypopg_reset(PG_FUNCTION_ARGS);

PG_FUNCTION_INFO_V1(hypopg_reset);

static void
hypo_utility_hook(
hypo_utility_hook(
#if PG_VERSION_NUM >= 100000
PlannedStmt *pstmt,
PlannedStmt *pstmt,
#else
Node *parsetree,
Node *parsetree,
#endif
const char *queryString,
const char *queryString,
#if PG_VERSION_NUM >= 90300
ProcessUtilityContext context,
ProcessUtilityContext context,
#endif
ParamListInfo params,
ParamListInfo params,
#if PG_VERSION_NUM >= 100000
QueryEnvironment *queryEnv,
QueryEnvironment *queryEnv,
#endif
#if PG_VERSION_NUM < 90300
bool isTopLevel,
bool isTopLevel,
#endif
DestReceiver *dest,
char *completionTag);
DestReceiver *dest,
char *completionTag);
static ProcessUtility_hook_type prev_utility_hook = NULL;

static void hypo_executorEnd_hook(QueryDesc *queryDesc);
static ExecutorEnd_hook_type prev_ExecutorEnd_hook = NULL;


static void hypo_get_relation_info_hook(PlannerInfo *root,
Oid relationObjectId,
bool inhparent,
RelOptInfo *rel);
Oid relationObjectId,
bool inhparent,
RelOptInfo *rel);
static get_relation_info_hook_type prev_get_relation_info_hook = NULL;

static bool hypo_query_walker(Node *node);
Expand All @@ -92,15 +92,15 @@ _PG_init(void)
hypoIndexes = NIL;

HypoMemoryContext = AllocSetContextCreate(TopMemoryContext,
"HypoPG context",
"HypoPG context",
#if PG_VERSION_NUM >= 90600
ALLOCSET_DEFAULT_SIZES
ALLOCSET_DEFAULT_SIZES
#else
ALLOCSET_DEFAULT_MINSIZE,
ALLOCSET_DEFAULT_INITSIZE,
ALLOCSET_DEFAULT_MAXSIZE
ALLOCSET_DEFAULT_MINSIZE,
ALLOCSET_DEFAULT_INITSIZE,
ALLOCSET_DEFAULT_MAXSIZE
#endif
);
);

DefineCustomBoolVariable("hypopg.enabled",
"Enable / Disable hypopg",
Expand Down Expand Up @@ -225,7 +225,7 @@ hypo_utility_hook(
#endif
params,
#if PG_VERSION_NUM >= 100000
queryEnv,
queryEnv,
#endif
#if PG_VERSION_NUM < 90300
isTopLevel,
Expand Down Expand Up @@ -301,9 +301,9 @@ hypo_get_relation_info_hook(PlannerInfo *root,

if (relation->rd_rel->relkind == RELKIND_RELATION
#if PG_VERSION_NUM >= 90300
|| relation->rd_rel->relkind == RELKIND_MATVIEW
|| relation->rd_rel->relkind == RELKIND_MATVIEW
#endif
)
)
{
ListCell *lc;

Expand All @@ -318,7 +318,7 @@ hypo_get_relation_info_hook(PlannerInfo *root,
* indextlist
*/
hypo_injectHypotheticalIndex(root, relationObjectId,
inhparent, rel, relation, entry);
inhparent, rel, relation, entry);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions hypopg_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ build_index_tlist(PlannerInfo *root, IndexOptInfo *index,

if (indexkey < 0)
att_tup = SystemAttributeDefinition(indexkey,
heapRelation->rd_rel->relhasoids);
heapRelation->rd_rel->relhasoids);
else
#if PG_VERSION_NUM >= 110000
att_tup = TupleDescAttr(heapRelation->rd_att, indexkey - 1);
Expand Down Expand Up @@ -210,7 +210,7 @@ GetIndexOpClass(List *opclass, Oid attrType,
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("operator class \"%s\" does not accept data type %s",
NameListToString(opclass), format_type_be(attrType))));
NameListToString(opclass), format_type_be(attrType))));

ReleaseSysCache(tuple);

Expand Down Expand Up @@ -244,7 +244,7 @@ CheckPredicate(Expr *predicate)
if (CheckMutability(predicate))
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("functions in index predicate must be marked IMMUTABLE")));
errmsg("functions in index predicate must be marked IMMUTABLE")));
}

/*
Expand Down
Loading

0 comments on commit b3a84ff

Please sign in to comment.