Semmle: Fix obvious issues (#3502)

Fixes some obvious issues found by the Semmle static analysis tool.

(cherry picked from commit 00d667c41d)
pull/3647/head
Jelte Fennema 2020-02-21 10:16:01 +01:00
parent e2d49c6122
commit b451c31c4c
3 changed files with 8 additions and 2 deletions

View File

@ -137,7 +137,7 @@ AppendAlterTypeStmt(StringInfo buf, AlterTableStmt *stmt)
stmt->relation->relname); stmt->relation->relname);
ListCell *cmdCell = NULL; ListCell *cmdCell = NULL;
Assert(stmt->relkind = OBJECT_TYPE); Assert(stmt->relkind == OBJECT_TYPE);
appendStringInfo(buf, "ALTER TYPE %s", identifier); appendStringInfo(buf, "ALTER TYPE %s", identifier);
foreach(cmdCell, stmt->cmds) foreach(cmdCell, stmt->cmds)

View File

@ -123,7 +123,7 @@ master_create_empty_shard(PG_FUNCTION_ARGS)
*/ */
if (relationKind == RELKIND_FOREIGN_TABLE) if (relationKind == RELKIND_FOREIGN_TABLE)
{ {
bool cstoreTable = cstoreTable = CStoreTable(relationId); bool cstoreTable = CStoreTable(relationId);
if (cstoreTable) if (cstoreTable)
{ {
storageType = SHARD_STORAGE_COLUMNAR; storageType = SHARD_STORAGE_COLUMNAR;

View File

@ -7,6 +7,10 @@
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#ifndef CITUS_FUNCTION_UTILS_H
#define CITUS_FUNCTION_UTILS_H
#include "postgres.h"
#include "nodes/execnodes.h" #include "nodes/execnodes.h"
@ -18,3 +22,5 @@ extern Oid FunctionOidExtended(const char *schemaName, const char *functionName,
argumentCount, bool missingOK); argumentCount, bool missingOK);
extern ReturnSetInfo * FunctionCallGetTupleStore1(PGFunction function, Oid functionId, extern ReturnSetInfo * FunctionCallGetTupleStore1(PGFunction function, Oid functionId,
Datum argument); Datum argument);
#endif /* CITUS_FUNCTION_UTILS_H */