From 72c214a8e49247e73e64b9c896c04937fe136a3b Mon Sep 17 00:00:00 2001 From: Raul Marin Date: Wed, 25 Oct 2017 17:58:10 +0200 Subject: [PATCH] Fix regex for PARALLEL aggregations Worked in pg10, but it didn't in pg9.5 --- Makefile | 26 +++++++++++++------------- scripts-available/CDB_Math.sql | 4 ++-- scripts-available/CDB_Overviews.sql | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 130916d..8bc4c8d 100644 --- a/Makefile +++ b/Makefile @@ -123,7 +123,7 @@ $(EXTENSION)--$(EXTVERSION).sql: $(CDBSCRIPTS) cartodb_version.sql Makefile cat cartodb_version.sql >> $@ ifeq ($(PG_PARALLEL), 0) # Remove PARALLEL in aggregates and functions - $(SED) -e 's/PARALLEL \= [A-Z]*/''/g' \ + $(SED) -e 's/PARALLEL \= [A-Z]*,/''/g' \ -e 's/PARALLEL [A-Z]*/''/g' -i $@ endif @@ -153,18 +153,18 @@ legacy_regress: $(REGRESS_OLD) Makefile mkdir -p expected/test/ mkdir -p results/test/ for f in $(REGRESS_OLD); do \ - tn=`basename $${f} .sql`; \ - of=sql/test/$${tn}.sql; \ - echo '\set ECHO none' > $${of}; \ - echo '\a' >> $${of}; \ - echo '\t' >> $${of}; \ - echo '\set QUIET off' >> $${of}; \ - cat $${f} | \ - $(SED) -e 's/public\./cartodb./g' >> $${of}; \ - exp=expected/test/$${tn}.out; \ - echo '\set ECHO none' > $${exp}; \ - cat test/$${tn}_expect >> $${exp}; \ - done + tn=`basename $${f} .sql`; \ + of=sql/test/$${tn}.sql; \ + echo '\set ECHO none' > $${of}; \ + echo '\a' >> $${of}; \ + echo '\t' >> $${of}; \ + echo '\set QUIET off' >> $${of}; \ + cat $${f} | \ + $(SED) -e 's/public\./cartodb./g' >> $${of}; \ + exp=expected/test/$${tn}.out; \ + echo '\set ECHO none' > $${exp}; \ + cat test/$${tn}_expect >> $${exp}; \ + done test_organization: bash test/organization/test.sh diff --git a/scripts-available/CDB_Math.sql b/scripts-available/CDB_Math.sql index 17ac1ff..307838b 100644 --- a/scripts-available/CDB_Math.sql +++ b/scripts-available/CDB_Math.sql @@ -21,7 +21,7 @@ CREATE AGGREGATE cartodb.CDB_Math_Mode(anyelement) ( SFUNC=array_append, STYPE=anyarray, FINALFUNC=_CDB_Math_final_mode, - INITCOND='{}', - PARALLEL = SAFE + PARALLEL = SAFE, + INITCOND='{}' ); diff --git a/scripts-available/CDB_Overviews.sql b/scripts-available/CDB_Overviews.sql index 70a3a1d..02d9fc0 100644 --- a/scripts-available/CDB_Overviews.sql +++ b/scripts-available/CDB_Overviews.sql @@ -464,8 +464,8 @@ CREATE AGGREGATE _cdb_mode(anyelement) ( SFUNC=array_append, STYPE=anyarray, FINALFUNC=_cdb_mode_of_array, - INITCOND='{}', - PARALLEL = SAFE + PARALLEL = SAFE, + INITCOND='{}' ); -- SQL Aggregation expression for a datase attribute