Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Small fixes

  • Loading branch information...
commit 7ebe794fd50b2a8dc4a3cf81f05445aebd2d8ba6 1 parent d17352c
@theirix authored
Showing with 2 additions and 8 deletions.
  1. +1 −2  Makefile
  2. +1 −6 src/json_accessors.c
View
3  Makefile
@@ -1,6 +1,5 @@
EXTENSION = json_accessors
-EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
- sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
+EXTVERSION = 1.3.2
MODULE_big = json_accessors
OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
View
7 src/json_accessors.c
@@ -189,7 +189,6 @@ ArrayType* construct_typed_array(Datum *elems, int nelems, Oid elmtype)
*/
Datum json_object_get_generic(text *argJson, text *argKey, int json_type, pextract_type_from_json extractor)
{
- bool status = false;
Datum result;
char *strJson, *strKey;
cJSON *root, *sel;
@@ -205,11 +204,7 @@ Datum json_object_get_generic(text *argJson, text *argKey, int json_type, pextra
{
if (json_type == CJSON_TYPE_ANY || match_json_types(json_type, sel->type))
{
- if (extractor(sel, &result))
- {
- status = true;
- }
- else
+ if (!extractor(sel, &result))
{
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
Please sign in to comment.
Something went wrong with that request. Please try again.