Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 914f48c

Browse files
committed
Merge commit '20d8d0c63de6d5eb280b9c37d9d52548259916c4' into PGPROEE10_pg_shardman
2 parents b7ac62b + 20d8d0c commit 914f48c

File tree

8 files changed

+494
-223
lines changed

8 files changed

+494
-223
lines changed

contrib/pg_shardman/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ bin/setup.sh
55

66
*.pyc
77
__pycache__
8+
9+
env/
10+
venv/

contrib/pg_shardman/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,9 @@ include $(top_builddir)/src/Makefile.global
5656
include $(top_srcdir)/contrib/contrib-global.mk
5757
endif
5858

59+
PYTHON = python3
5960
python_tests:
60-
$(MAKE) -C tests/python
61+
$(MAKE) -C tests/python PYTHON=$(PYTHON)
62+
63+
# Special rule for PostgresPro
64+
testgres_check: python_tests

contrib/pg_shardman/pg_shardman.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ pq_conninfo_parse(PG_FUNCTION_ARGS)
564564
char *conninfo = text_to_cstring(PG_GETARG_TEXT_PP(0));
565565
PQconninfoOption *opts = PQconninfoParse(conninfo, &pqerrmsg);
566566
PQconninfoOption *opt;
567+
HeapTuple res_heap_tuple;
567568

568569
if (pqerrmsg != NULL)
569570
{
@@ -634,7 +635,8 @@ pq_conninfo_parse(PG_FUNCTION_ARGS)
634635
BlessTupleDesc(tupdesc); /* Inshallah */
635636

636637
PQconninfoFree(opts);
637-
PG_RETURN_DATUM(HeapTupleGetDatum(heap_form_tuple(tupdesc, values, nulls)));
638+
res_heap_tuple = heap_form_tuple(tupdesc, values, nulls);
639+
PG_RETURN_DATUM(HeapTupleGetDatum(res_heap_tuple));
638640
}
639641

640642
Datum
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
ignore = E501
3+
exclude = __pycache__
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
logs/
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# we need to cd into dir with tests.py, otherwise unittest won't find it
2-
# dir containing this makefile
3-
mkfile_dir := $(shell dirname $(shell readlink -f $(abspath $(lastword $(MAKEFILE_LIST)))))
1+
# User should be able to override PYTHON
2+
PYTHON = python3
43

54
all:
6-
cd $(mkfile_dir) && python3 tests.py
5+
$(PYTHON) tests.py
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
DIR=$(dirname $0)
4+
5+
yapf -i "$DIR"/*.py
6+
flake8 "$DIR"

0 commit comments

Comments
 (0)