This is an automated email from the ASF dual-hosted git repository. okislal pushed a commit to branch madlib2-master in repository https://gitbox.apache.org/repos/asf/madlib.git
commit 395a81923864444c3a641187441bfdd0e022225f Author: Orhan Kislal <[email protected]> AuthorDate: Sat Sep 2 09:02:58 2023 +0300 Fix anyarray -> anycompatiblearray change for PG14 --- src/madpack/madpack.py | 5 +++-- src/ports/postgres/modules/crf/crf.sql_in | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/madpack/madpack.py b/src/madpack/madpack.py index 87df1c06..fc4c6537 100755 --- a/src/madpack/madpack.py +++ b/src/madpack/madpack.py @@ -188,7 +188,8 @@ def _run_m4_and_append(schema, maddir_mod_py, module, sqlfile, '-DMODULE_NAME=' + module, '-I' + maddir_madpack, sqlfile] - if (((portid == 'postgres') & (dbver == '15'))): + if ( (portid == 'postgres') & + (is_rev_gte(get_rev_num(dbver), get_rev_num('14.0'))) ): m4args = ['m4', '-P', '-DMADLIB_SCHEMA=' + schema, @@ -197,7 +198,7 @@ def _run_m4_and_append(schema, maddir_mod_py, module, sqlfile, '-DMODULE_PATHNAME=' + maddir_lib, '-DMADLIB_LIBRARY_PATH=' + madlib_library_path, '-DMODULE_NAME=' + module, - '-DIS_PG_15=TRUE', + '-DUSE_COMPATIBLE_ARRAY=TRUE', '-I' + maddir_madpack, sqlfile] diff --git a/src/ports/postgres/modules/crf/crf.sql_in b/src/ports/postgres/modules/crf/crf.sql_in index 302de8a4..9354fdac 100644 --- a/src/ports/postgres/modules/crf/crf.sql_in +++ b/src/ports/postgres/modules/crf/crf.sql_in @@ -719,13 +719,13 @@ CREATE AGGREGATE MADLIB_SCHEMA.lincrf_lbfgs_step( INITCOND='{0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}' ); -m4_ifdef(`IS_PG_15', +m4_ifdef(`USE_COMPATIBLE_ARRAY', `DROP AGGREGATE IF EXISTS MADLIB_SCHEMA.array_union(anycompatiblearray) CASCADE;', `DROP AGGREGATE IF EXISTS MADLIB_SCHEMA.array_union(anyarray) CASCADE;') CREATE m4_ifdef(`__POSTGRESQL__', `', m4_ifdef(`__HAS_ORDERED_AGGREGATES__', `ORDERED')) AGGREGATE -m4_ifdef(`IS_PG_15', +m4_ifdef(`USE_COMPATIBLE_ARRAY', `MADLIB_SCHEMA.array_union(anycompatiblearray) (SFUNC = array_cat, STYPE = anycompatiblearray);', `MADLIB_SCHEMA.array_union(anyarray) (SFUNC = array_cat, STYPE = anyarray);' )
