diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2019-05-02 23:24:29 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2019-05-02 23:25:27 +0200 |
commit | 847cda38601e5d7332dd7de23469bc6ca830241f (patch) | |
tree | 7c345cdabc6658ffa61c9ebfb3c285f02f974606 /community/postgresql-plpgsql_check | |
parent | ae682577fc1fcdc3607f7dbd4d52ee038efca151 (diff) | |
download | aports-847cda38601e5d7332dd7de23469bc6ca830241f.tar.bz2 aports-847cda38601e5d7332dd7de23469bc6ca830241f.tar.xz |
community/postgresql-plpgsql_check: upgrade to 1.7.1
Diffstat (limited to 'community/postgresql-plpgsql_check')
-rw-r--r-- | community/postgresql-plpgsql_check/APKBUILD | 11 | ||||
-rw-r--r-- | community/postgresql-plpgsql_check/fix-for-postgresql-11-and-12.patch | 126 |
2 files changed, 4 insertions, 133 deletions
diff --git a/community/postgresql-plpgsql_check/APKBUILD b/community/postgresql-plpgsql_check/APKBUILD index 19c6e6c8cd..686c3d1f69 100644 --- a/community/postgresql-plpgsql_check/APKBUILD +++ b/community/postgresql-plpgsql_check/APKBUILD @@ -2,17 +2,15 @@ # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=postgresql-plpgsql_check _pkgname=plpgsql_check -pkgver=1.2.3 -pkgrel=1 +pkgver=1.7.1 +pkgrel=0 pkgdesc="Additional tools for plpgsql functions validation" url="https://github.com/okbob/plpgsql_check" arch="all" license="BSD" depends="postgresql" makedepends="postgresql-dev" -source="$_pkgname-$pkgver.tar.gz::https://github.com/okbob/$_pkgname/archive/v$pkgver.tar.gz - fix-for-postgresql-11-and-12.patch - " +source="$_pkgname-$pkgver.tar.gz::https://github.com/okbob/$_pkgname/archive/v$pkgver.tar.gz" builddir="$srcdir/$_pkgname-$pkgver" options="!check" # XXX: installcheck requires running PostgreSQL @@ -26,5 +24,4 @@ package() { make USE_PGXS=1 DESTDIR="$pkgdir" install } -sha512sums="73c178f19540923394333404612779b692f932f9748085f9a41bd51535d19c15e87b04874f90f387aa197cf2f179e318b202203abd39f6e33e111fe2903e7998 plpgsql_check-1.2.3.tar.gz -7ee1624175549783e15872d9b3469b959f45d882a830b94b39da069c58d5aa9e75c49c9f52c3a5254ad1854777e9518465b456fcae090a8a5b4f999b32e5ecf0 fix-for-postgresql-11-and-12.patch" +sha512sums="437dc67ed3a4c8eba938d2109ede08b8cb385d8b362942803682a97e9d5d609ecb110bb8bc1818d415488e38555ec9268daf5f08ef9d84a2c7c45c20d30c266a plpgsql_check-1.7.1.tar.gz" diff --git a/community/postgresql-plpgsql_check/fix-for-postgresql-11-and-12.patch b/community/postgresql-plpgsql_check/fix-for-postgresql-11-and-12.patch deleted file mode 100644 index 843d9fe834..0000000000 --- a/community/postgresql-plpgsql_check/fix-for-postgresql-11-and-12.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 5dbcd9779ae6b5d5008aaddfa62677adf05dd5e5 Mon Sep 17 00:00:00 2001 -From: Pavel Stehule <pavel.stehule@gmail.com> -Date: Wed, 10 Oct 2018 16:27:07 +0200 -Subject: [PATCH] fix for PostgreSQL 11,12 - -Patch-Source: https://github.com/okbob/plpgsql_check/commit/5dbcd9779ae6b5d5008aaddfa62677adf05dd5e5 ---- - plpgsql_check.c | 43 +++++++++++++++++++++++++++++++++++++------ - 1 file changed, 37 insertions(+), 6 deletions(-) - -diff --git a/plpgsql_check.c b/plpgsql_check.c -index 8a83b06..b95adf1 100644 ---- a/plpgsql_check.c -+++ b/plpgsql_check.c -@@ -308,6 +308,8 @@ static int possibly_closed(int c); - static Query *ExprGetQuery(PLpgSQL_checkstate *cstate, PLpgSQL_expr *query); - static char *ExprGetString(PLpgSQL_checkstate *cstate, PLpgSQL_expr *query, bool *IsConst); - static bool exception_matches_conditions(int err_code, PLpgSQL_condition *cond); -+static bool is_internal_variable(PLpgSQL_variable *var); -+ - - #if PG_VERSION_NUM >= 110000 - -@@ -3398,9 +3400,17 @@ is_internal(char *refname, int lineno) - return true; - if (strcmp(refname, "*internal*") == 0) - return true; -+ if (strcmp(refname, "(unnamed row)") == 0) -+ return true; - return false; - } - -+static bool -+is_internal_variable(PLpgSQL_variable *var) -+{ -+ return is_internal(var->refname, var->lineno); -+} -+ - - /* - * Returns true if dno is explicitly declared. It should not be used -@@ -3635,7 +3645,7 @@ report_unused_variables(PLpgSQL_checkstate *cstate) - int varno = func->out_param_varno; - PLpgSQL_variable *var = (PLpgSQL_variable *) estate->datums[varno]; - -- if (var->dtype == PLPGSQL_DTYPE_ROW && var->refname == NULL) -+ if (var->dtype == PLPGSQL_DTYPE_ROW && is_internal_variable(var)) - { - /* this function has more OUT parameters */ - PLpgSQL_row *row = (PLpgSQL_row*) var; -@@ -5682,25 +5692,46 @@ check_fishy_qual(PLpgSQL_checkstate *cstate, PLpgSQL_expr *query) - } - - /* -- * returns refname of PLpgSQL_datum -+ * returns refname of PLpgSQL_datum. When refname is generated, -+ * then return null too, although refname is not null. - */ - static char * - datum_get_refname(PLpgSQL_datum *d) - { -+ char *refname; -+ int lineno; -+ - switch (d->dtype) - { - case PLPGSQL_DTYPE_VAR: -- return ((PLpgSQL_var *) d)->refname; -+ refname = ((PLpgSQL_var *) d)->refname; -+ lineno = ((PLpgSQL_var *) d)->lineno; -+ break; - - case PLPGSQL_DTYPE_ROW: -- return ((PLpgSQL_row *) d)->refname; -+ refname = ((PLpgSQL_row *) d)->refname; -+ lineno = ((PLpgSQL_row *) d)->lineno; -+ break; - - case PLPGSQL_DTYPE_REC: -- return ((PLpgSQL_rec *) d)->refname; -+ refname = ((PLpgSQL_rec *) d)->refname; -+ lineno = ((PLpgSQL_rec *) d)->lineno; -+ break; - - default: -- return NULL; -+ refname = NULL; -+ lineno = -1; - } -+ -+ /* -+ * PostgreSQL 12 started use "(unnamed row)" name for internal -+ * variables. Hide this name too (lineno is -1). -+ */ -+ if (strcmp(refname, "(unnamed row)") == 0 -+ && lineno == -1) -+ return NULL; -+ -+ return refname; - } - - /**************************************************************************************** -From b9564b563f99630fcc1fe19d74fb466d899090b8 Mon Sep 17 00:00:00 2001 -From: Pavel Stehule <pavel.stehule@gmail.com> -Date: Wed, 10 Oct 2018 16:32:56 +0200 -Subject: [PATCH] minor change - -Patch-Source: https://github.com/okbob/plpgsql_check/commit/b9564b563f99630fcc1fe19d74fb466d899090b8 ---- - plpgsql_check.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/plpgsql_check.c b/plpgsql_check.c -index b95adf1..f9f4e1b 100644 ---- a/plpgsql_check.c -+++ b/plpgsql_check.c -@@ -5727,8 +5727,7 @@ datum_get_refname(PLpgSQL_datum *d) - * PostgreSQL 12 started use "(unnamed row)" name for internal - * variables. Hide this name too (lineno is -1). - */ -- if (strcmp(refname, "(unnamed row)") == 0 -- && lineno == -1) -+ if (is_internal(refname, lineno)) - return NULL; - - return refname; |