Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Babelfish 1.1 / Pg 13.5 distribution #2

Open
wants to merge 129 commits into
base: BABEL_1_X_DEV__PG_13_5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
ab37888
Fix instability in 026_overwrite_contrecord.pl test.
tglsfdc Nov 9, 2021
8b71870
Doc: improve protocol spec for logical replication Type messages.
tglsfdc Nov 10, 2021
682297f
Clean up compilation warnings coming from PL/Perl with clang-12~
michaelpq Nov 11, 2021
8ce1703
Fix buffer overrun in unicode string normalization with empty input
michaelpq Nov 11, 2021
5efcf30
Report any XLogReadRecord() error in XlogReadTwoPhaseData().
nmisch Nov 12, 2021
a3f761a
Fix memory overrun when querying pg_stat_slru
michaelpq Nov 12, 2021
f602f07
Make psql's \password default to CURRENT_USER, not PQuser(conn).
tglsfdc Nov 12, 2021
8c40c4d
Invalidate relcache when changing REPLICA IDENTITY index.
Nov 16, 2021
cd93fb5
Doc: add see-also references to CREATE PUBLICATION.
danielgustafsson Nov 17, 2021
c0b8f89
Handle close() failures more robustly in pg_dump and pg_basebackup.
tglsfdc Nov 17, 2021
9f78a1e
Clean up error handling in pg_basebackup's walmethods.c.
tglsfdc Nov 17, 2021
27843ad
Add table to regression tests for binary-compatibility checks in pg_u…
michaelpq Nov 18, 2021
df4236d
Fix quoting of ACL item in table for upgrade binary compatibility checks
michaelpq Nov 18, 2021
11cce39
Use appropriate -Wno-warning switches when compiling bitcode.
tglsfdc Nov 18, 2021
75a21eb
Fix parallel operations that prevent oldest xmin from advancing.
Nov 19, 2021
5bbcdc2
pg_receivewal, pg_recvlogical: allow canceling initial password prompt.
tglsfdc Nov 21, 2021
739ad4b
Probe $PROVE not $PERL while checking for modules needed by TAP tests.
tglsfdc Nov 22, 2021
5abb572
Fix pg_dump --inserts mode for generated columns with dropped columns.
tglsfdc Nov 22, 2021
05327d1
Pacify perlcritic.
tglsfdc Nov 22, 2021
71142e1
Adjust pg_dump's priority ordering for casts.
tglsfdc Nov 22, 2021
7dd3e22
Add support for Visual Studio 2022 in build scripts
michaelpq Nov 24, 2021
7a810d8
Fix missing space in docs.
hlinnaka Nov 24, 2021
606c9c8
Doc: improve documentation about nextval()/setval().
tglsfdc Nov 24, 2021
92bbefe
Block ALTER TABLE .. DROP NOT NULL on columns in replica identity index
michaelpq Nov 25, 2021
7645fec
Remove unneeded Python includes
petere Nov 25, 2021
87455ee
Fix determination of broken LSN in OVERWRITTEN_CONTRECORD
alvherre Nov 26, 2021
1739a70
Document units for max_slot_wal_keep_size
alvherre Nov 26, 2021
1334102
Harden be-gssapi-common.h for headerscheck
alvherre Nov 26, 2021
31146ad
Doc: improve documentation about ORDER BY in matviews.
tglsfdc Nov 29, 2021
a58224b
Doc: Add "Attach Partition" limitation during logical replication.
Dec 1, 2021
33e2973
Avoid leaking memory during large-scale REASSIGN OWNED BY operations.
tglsfdc Dec 1, 2021
dcbd8a7
Move into separate file all the SQL queries used in pg_upgrade tests
michaelpq Dec 2, 2021
c565da0
On Windows, close the client socket explicitly during backend shutdown.
tglsfdc Dec 2, 2021
bf20502
postgres_fdw: Fix unexpected reporting of empty message.
MasaoFujii Dec 3, 2021
332158e
Doc: Fix misleading wording of CRL parameters
danielgustafsson Dec 3, 2021
9023c3f
On Windows, also call shutdown() while closing the client socket.
tglsfdc Dec 7, 2021
14846d4
Enable settings used in TAP tests for MSVC builds
adunstan Dec 7, 2021
5f67653
Fix corruption of toast indexes with REINDEX CONCURRENTLY
michaelpq Dec 8, 2021
75e93fd
Doc: improve xfunc-c-type-table.
tglsfdc Dec 8, 2021
b71e693
Fix double publish of child table's data.
Dec 9, 2021
3830ca2
isolationtester: append session name to application_name.
anarazel Dec 13, 2021
672eb9c
Doc: de-document unimplemented geometric operators.
tglsfdc Dec 13, 2021
87f0acf
Remove assertion for replication origins in PREPARE TRANSACTION
michaelpq Dec 14, 2021
1bb86bf
Fix datatype confusion in logtape.c's right_offset().
tglsfdc Dec 14, 2021
9be2180
Adjust behavior of some env settings for the TAP tests of MSVC
michaelpq Dec 15, 2021
3dc6338
Ensure casting to typmod -1 generates a RelabelType.
tglsfdc Dec 16, 2021
82fbd7b
Correct comment and some documentation about REPLICA_IDENTITY_INDEX
michaelpq Dec 22, 2021
006a2b4
doc: clarify when expression indexes evaluate their expressions
bmomjian Dec 22, 2021
ba12b91
Fix overly generic name in with.sql test.
macdice Dec 30, 2021
c85aa82
Fix index-only scan plans when not all index columns can be returned.
tglsfdc Jan 1, 2022
8146204
Fix typo
mhagander Jan 2, 2022
fe77818
Fix index-only scan plans, take 2.
tglsfdc Jan 3, 2022
930f9eb
Allow special SKIP LOCKED condition in Assert()
alvherre Jan 4, 2022
259f620
Fix silly mistake in Assert
alvherre Jan 4, 2022
53fa028
Reduce relcache access in WAL sender streaming logical changes
michaelpq Jan 5, 2022
56d5cc3
doc: Remove link to JSON support in the SQL specification
michaelpq Jan 6, 2022
b396f12
Prevent altering partitioned table's rowtype, if it's used elsewhere.
tglsfdc Jan 6, 2022
dafe75d
Allow MSVC .bat wrappers to be called from anywhere
adunstan Jan 7, 2022
84e2c0e
Update copyright for 2022
bmomjian Jan 8, 2022
09f8f3a
Fix results of index-only scans on btree_gist char(N) indexes.
tglsfdc Jan 8, 2022
46c33df
Avoid warning about uninitialized value in MSVC python3 tests
adunstan Jan 10, 2022
a56e08b
Doc: fix bogus example about ambiguous timestamps.
tglsfdc Jan 10, 2022
c6c35f8
Fix ruleutils.c's dumping of whole-row Vars in more contexts.
tglsfdc Jan 13, 2022
c4a386c
Ignore extended statistics for inheritance trees
tvondra Jan 15, 2022
259cf1e
Build inherited extended stats on partitioned tables
tvondra Jan 15, 2022
4023e13
Fix psql's tab-completion of enum label values.
tglsfdc Jan 16, 2022
a9344df
Avoid calling strerror[_r] in PQcancel().
tglsfdc Jan 17, 2022
7b150b8
Avoid calling gettext() in signal handlers.
tglsfdc Jan 17, 2022
eeece8c
Fix psql \d's query for identifying parent triggers.
tglsfdc Jan 18, 2022
f5986b9
Try to stabilize the reloptions test.
macdice Jan 18, 2022
3b96687
doc: Fix description of pg_replication_origin_oid() in error case
michaelpq Jan 19, 2022
e7b5b9b
TAP tests: check for postmaster.pid anyway when "pg_ctl start" fails.
tglsfdc Jan 19, 2022
f0fe616
doc: Mention the level of locks taken on objects in COMMENT
michaelpq Jan 20, 2022
fba52ec
Try to stabilize reloptions test, again.
macdice Jan 20, 2022
2c98dc9
Allow clean.bat to be run from anywhere
adunstan Jan 20, 2022
04d31ae
Tighten TAP tests' tracking of postmaster state some more.
tglsfdc Jan 20, 2022
18a8019
Fix one-off bug causing missing commit timestamps for subtransactions
michaelpq Jan 21, 2022
5373d53
fsync pg_logical/mappings in CheckPointLogicalRewriteHeap().
anarazel Jan 21, 2022
89466c3
Fix race condition in gettext() initialization in libpq and ecpglib.
tglsfdc Jan 21, 2022
e73810f
Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING INDEX.
tglsfdc Jan 22, 2022
8f6abed
Check syscache result in AlterStatistics
tvondra Jan 23, 2022
b42e8b8
Correct type of front_pathkey to PathKey
tvondra Jan 23, 2022
7713cf4
Suppress variable-set-but-not-used warning from clang 13.
tglsfdc Jan 23, 2022
03aa623
Remember to reset yy_start state when firing up repl_scanner.l.
tglsfdc Jan 24, 2022
dee7deb
Fix limitations on what SQL commands can be issued to a walsender.
tglsfdc Jan 24, 2022
c370c24
doc: Fix some grammar
michaelpq Jan 25, 2022
4badff7
Consider parallel awareness when removing single-child Appends
david-rowley Jan 25, 2022
b80f7e2
Revert "graceful shutdown" changes for Windows, in back branches only.
tglsfdc Jan 25, 2022
819bd00
Fix pg_hba_file_rules for authentication method cert
mhagander Jan 26, 2022
8e66a74
On sparc64+ext4, suppress test failures from known WAL read failure.
nmisch Jan 27, 2022
2848dfe
Fix ordering of XIDs in ProcArrayApplyRecoveryInfo
tvondra Jan 27, 2022
fae5510
Fix failure to validate the result of select_common_type().
tglsfdc Jan 29, 2022
4445f75
plperl: windows: Use Perl_setlocale on 5.28+, fixing compile failure.
anarazel Jan 30, 2022
4cd2a03
plperl: Fix breakage of c89f409749c in back branches.
anarazel Jan 31, 2022
868d242
plperl: update ppport.h to Perl 5.34.0.
tglsfdc Jan 31, 2022
53890dc
Revert "plperl: Fix breakage of c89f409749c in back branches."
tglsfdc Jan 31, 2022
10dfa9f
Replace use of deprecated Python module distutils.sysconfig, take 2.
tglsfdc Feb 2, 2022
ed69f64
doc: Fix mistake in PL/Python documentation
petere Feb 2, 2022
7bae1be
doc: clarify syntax notation, particularly parentheses
bmomjian Feb 3, 2022
cc4585c
Test, don't just Assert, that mergejoin's inputs are in order.
tglsfdc Feb 5, 2022
a2a4af0
Doc: be clearer that foreign-table partitions need user-added constra…
tglsfdc Feb 5, 2022
aa2a5c5
Release notes for 14.2, 13.6, 12.10, 11.15, 10.20.
tglsfdc Feb 6, 2022
9a7d1a2
Translation updates
petere Feb 7, 2022
9409b39
Stamp 13.6.
tglsfdc Feb 7, 2022
2effc43
Better error message for function-not-found if there is a function ha…
thephantomthief Feb 9, 2022
1b5cdfe
Padded strings return the wrong result in LIKE clauses
KushaalShroff Feb 9, 2022
4688a2f
Invalidate Babelfish catalogs properly in syscache
thephantomthief Feb 9, 2022
419da9c
Preserve the case of column names in SELECT relation.*
thephantomthief Feb 9, 2022
723ec4a
Move the code that calls func_select_candidate_hook() to earlier
xhfanhe Feb 9, 2022
88989c9
Fix the issue where the coalesce function returns incorrect typmod fo…
xhfanhe Feb 10, 2022
118e000
Crash in exec_stmt_iterative due to trigger with error handling
Deepesh125 Feb 10, 2022
9aa5278
COLLATE clause is ignored for computed columns
Deepesh125 Feb 10, 2022
2cda714
Add functional changes for ROWVERSION datatype
xhfanhe Feb 10, 2022
07dedf8
Support sys.dm_exec_sessions and sys.dm_exec_connections dynamic mana…
xhfanhe Feb 11, 2022
90ba872
Modify post_transform_insert_row_hook to pass relation oid
thephantomthief Feb 11, 2022
8775cc5
Further support for empty string or spaces-only string in numeric con…
KushaalShroff Feb 15, 2022
a7c5214
Part 1: Support inserted transition table for INSTEAD OF INSERT
xhfanhe Feb 15, 2022
21b413a
Support CHECKSUM(*) and CHECKSUM(c1, c2, ...)
xhfanhe Feb 15, 2022
c48b70b
Support inserted/deleted transition table in INSTEAD OF TRIGGERS
xhfanhe Feb 16, 2022
1274c35
Fix Babelfish references to transition table in after/instead of trig…
thephantomthief Feb 17, 2022
433d0b0
Added support for ISJSON(), JSON_VALUE(), and JSON_QUERY()
thephantomthief Feb 17, 2022
841c948
Part 3: Support INSTEAD OF trigger in deleted/inserted table
Deepesh125 Feb 18, 2022
23ebaed
Remove unused variable (datefirst)
Deepesh125 Feb 18, 2022
bdb4362
Support implicit and explicit transaction support inside an INSTEAD O…
rishabhtanwar29 Mar 1, 2022
40b5884
Pass input input datatype to func_select_candidate_hook()
xhfanhe Mar 1, 2022
48fcf4b
Handle ROWVERSION/TIMESTAMP columns for Postgres Logical Replication
KushaalShroff Mar 2, 2022
e87a3f2
Preserve case for table names in TSQL information_schema
KushaalShroff Mar 3, 2022
f50b413
Building Babelfish distribution
Mar 20, 2022
45a83d6
Merge branch 'babelfish-for-postgresql:BABEL_1_X_DEV__PG_13_6' into B…
3manuek Mar 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
155 changes: 155 additions & 0 deletions .github/workflows/jdbc_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: JDBC Unit Tests
on:
push:
branches:
- BABEL_1_X_DEV__PG_13_5
pull_request:
branches:
- BABEL_1_X_DEV__PG_13_5

env:
ANTLR4_VERSION: 4.9.3

jobs:
extension-tests:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Requirements
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - && \
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update && sudo apt install -y --no-install-recommends \
build-essential flex libxml2-dev libxml2-utils \
libxslt-dev libssl-dev \
libreadline-dev zlib1g-dev libldap2-dev libpam0g-dev gettext \
uuid uuid-dev cmake lld apt-utils \
libossp-uuid-dev gnulib bison \
xsltproc icu-devtools libicu66 libicu-dev gawk curl \
openjdk-8-jre openssl g++ \
libssl-dev python-dev libpq-dev \
pkg-config unzip libutfcpp-dev gnupg mssql-tools unixodbc-dev
export PATH=/opt/mssql-tools/bin:$PATH
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
check-latest: true
- name: Copy ANTLR jar file
run: |
cd contrib/babelfishpg_tsql/antlr/thirdparty/antlr/
sudo cp antlr-${ANTLR4_VERSION}-complete.jar /usr/local/lib
- name: Compile ANTLR
run: |
cd ..
wget http://www.antlr.org/download/antlr4-cpp-runtime-${ANTLR4_VERSION}-source.zip
unzip -d antlr4 antlr4-cpp-runtime-${ANTLR4_VERSION}-source.zip
cd antlr4
mkdir build && cd build
cmake .. -D ANTLR_JAR_LOCATION=/usr/local/lib/antlr-${ANTLR4_VERSION}-complete.jar -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_DEMO=True
make -j 4
sudo make install
# cp /usr/local/lib/libantlr4-runtime.so.${ANTLR4_VERSION} ~/postgres/lib/
- name: Build, and binary installation
run: |
# CFLAGS="${CFLAGS:--Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic}"
./configure CFLAGS="-ggdb" \
--prefix=$HOME/postgres/ \
--enable-debug \
--with-ldap \
--with-libxml \
--with-pam \
--with-uuid=ossp \
--enable-nls \
--with-libxslt \
--with-icu \
--with-extra-version=" Babelfish for PostgreSQL"
# ./configure --prefix=$HOME/postgres/ --with-python PYTHON=/usr/bin/python2.7 --enable-debug CFLAGS="-ggdb" --with-libxml --with-uuid=ossp --with-icu
make clean && make DESTDIR=~/postgres/ -j 4 2>error.txt
# make check
sudo make install
- name: Build antlr
run: |
export ANTLR4_JAVA_BIN=/usr/bin/java
export ANTLR4_RUNTIME_LIBRARIES=/usr/include/antlr4-runtime
export ANTLR_EXECUTABLE=/usr/local/lib/antlr-${ANTLR4_VERSION}-complete.jar
export ANTLR_RUNTIME=../antlr4
#PG_SRC=~/work/postgresql_modified_for_babelfish
export PG_SRC=/home/runner/work/postgresql_modified_for_babelfish/postgresql_modified_for_babelfish/
export PG_CONFIG=~/postgres/bin/pg_config
cmake=$(which cmake)

# Copy runtime in Postgres lib
sudo cp /usr/local/lib/libantlr4-runtime.so.${ANTLR4_VERSION} ~/postgres/lib

cd ${PG_SRC}/contrib/babelfishpg_tsql/antlr
cmake -Wno-dev .
- name: Compile and Install Extensions
run: |
export ANTLR4_JAVA_BIN=/usr/bin/java
export ANTLR4_RUNTIME_LIBRARIES=/usr/include/antlr4-runtime
export ANTLR_EXECUTABLE=/usr/local/lib/antlr-${ANTLR4_VERSION}-complete.jar
export ANTLR_RUNTIME=../antlr4
export PG_SRC=/home/runner/work/postgresql_modified_for_babelfish/postgresql_modified_for_babelfish/
export PG_CONFIG=~/postgres/bin/pg_config
cmake=$(which cmake)

cd $PG_SRC/contrib/ && make && sudo make install
- name: Install extensions
run: |
cd ~
sudo chown -R runner: ~/postgres
~/postgres/bin/initdb -D ~/postgres/data/ -E "UTF8"
~/postgres/bin/pg_ctl -D ~/postgres/data/ -l logfile start
cd postgres/data
sudo sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" postgresql.conf
sudo sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'babelfishpg_tds'/g" postgresql.conf
ipaddress=$(ifconfig eth0 | grep 'inet ' | cut -d: -f2 | awk '{ print $2}')
sudo echo "host all all $ipaddress/32 trust" >> pg_hba.conf
~/postgres/bin/pg_ctl -D ~/postgres/data/ -l logfile restart
sudo ~/postgres/bin/psql -d postgres -U runner -c "CREATE USER jdbc_user WITH SUPERUSER CREATEDB CREATEROLE PASSWORD '12345678' INHERIT;"
sudo ~/postgres/bin/psql -d postgres -U runner -c "DROP DATABASE IF EXISTS jdbc_testdb;"
sudo ~/postgres/bin/psql -d postgres -U runner -c "CREATE DATABASE jdbc_testdb OWNER jdbc_user;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "set allow_system_table_mods = on;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "CREATE EXTENSION IF NOT EXISTS "babelfishpg_tds" CASCADE;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "GRANT ALL ON SCHEMA sys to jdbc_user;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "ALTER USER jdbc_user CREATEDB;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "ALTER SYSTEM SET babelfishpg_tsql.database_name = 'jdbc_testdb';"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "ALTER SYSTEM SET babelfishpg_tds.set_db_session_property = true;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "SELECT pg_reload_conf();"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "CALL sys.initialize_babelfish('jdbc_user');"
sqlcmd -S localhost -U jdbc_user -P 12345678 -Q "SELECT @@version GO"
- name: Run JDBC test framework
timeout-minutes: 15
run: |
cd contrib/test/JDBC/
mvn test
- name: Upload log
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: postgres-log
path: ~/postgres/data/logfile
# The test summary files contain paths with ':' characters, which is not allowed with the upload-artifact actions
- name: Rename test summary files
if: ${{ failure() }}
run: |
cd contrib/test/JDBC/Info
timestamp=`ls -Art | tail -n 1`
cd $timestamp
mv $timestamp.diff ../output-diff.diff
mv "$timestamp"_runSummary.log ../run-summary.log
- name: Upload run summary
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: run-summary.log
path: contrib/test/JDBC/Info/run-summary.log
- name: Upload output diff
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: output-diff.diff
path: contrib/test/JDBC/Info/output-diff.diff
34 changes: 0 additions & 34 deletions .github/workflows/main.yml

This file was deleted.

2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PostgreSQL Database Management System
(formerly known as Postgres, then as Postgres95)

Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group

Portions Copyright (c) 1994, The Regents of the University of California

Expand Down
112 changes: 112 additions & 0 deletions INSTALLING
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Babelfish distribution compilation and installation

### NOTE: these directions assume you are running from the directory that you
### uncompressed the Babelfish source code into.
### By default that would be babel_1.1.0__pg_13.5

export MAX_JOBS=2 # Or any other value suitable for your CPU capacity

export PREFIX=/opt/target/babelfishpg
export ANTLR4_VERSION=4.9.3

export PG_CONFIG=${PREFIX}/bin/pg_config
export PG_SRC=$(pwd)

export ANTLR4_RUNTIME_INCLUDE_DIR=/usr/local/include/antlr4-runtime/

export ANTLR4_JAVA_BIN=/usr/bin/java


## Prerequisites

apt update

apt install -y --no-install-recommends \
build-essential flex libxml2-dev libxml2-utils\
libxslt-dev libssl-dev \
libreadline-dev zlib1g-dev libldap2-dev libpam0g-dev gettext \
uuid uuid-dev cmake lld apt-utils pkg-config libossp-uuid-dev gnulib bison git

apt install -y --no-install-recommends \
xsltproc icu-devtools libicu66 libicu-dev gawk curl

apt install -y openjdk-8-jre openssl \
libssl-dev python-dev libpq-dev \
pkgconf unzip libutfcpp-dev gnupg

## Antlr compilation

Compiling and installing antlr runtime

ANTLR_EXECUTABLE=/usr/local/lib/antlr-${ANTLR4_VERSION}-complete.jar

curl https://www.antlr.org/download/antlr-${ANTLR4_VERSION}-complete.jar \
--output ${ANTLR_EXECUTABLE} && chmod +x ${ANTLR_EXECUTABLE}

mkdir -p antlr_runtime

curl https://www.antlr.org/download/antlr4-cpp-runtime-${ANTLR4_VERSION}-source.zip \
--output /opt/antlr4-cpp-runtime-${ANTLR4_VERSION}-source.zip && \
unzip -d antlr_runtime /opt/antlr4-cpp-runtime-${ANTLR4_VERSION}-source.zip

cd antlr_runtime
mkdir build && cd build && \
cmake .. -D ANTLR_JAR_LOCATION=${ANTLR_EXECUTABLE} \
-DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_DEMO=True && \
make && make install

## Compiling Babelfish


./configure CFLAGS="${CFLAGS:--Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic}" \
--prefix=${PREFIX} \
--enable-debug \
--with-ldap \
--with-libxml \
--with-pam \
--with-uuid=ossp \
--enable-nls \
--with-libxslt \
--with-icu \
--with-extra-version=" Babelfish for PostgreSQL"

# Compilation

make clean && make DESTDIR=${PREFIX} -j ${MAX_JOBS}

#world-bin

# Install core

make install

# Compile ANTLR shared object

cp /usr/local/lib/libantlr4-runtime.so.${ANTLR4_VERSION} ${PREFIX}/lib

cmake=$(which cmake) ANTLR4_RUNTIME_LIBRARIES=/usr/include/antlr4-runtime
cd contrib/babelfishpg_tsql/antlr
cmake .

# Build all the extensions
cd ../.. && make && make install && cd ..



## Starting Babelfish

### For starting and initiating Babelfish, follow up the instructions at
### https://babelfishpg.org/docs/installation/compiling-babelfish-from-source/#additional-installation-steps).


## Clients

### SQL Server Tooling dependencies
# Reference: https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-ver15#ubuntu
# mssql-cli on arm currently isn't supported https://github.com/dbcli/mssql-cli/issues/152#issuecomment-446311124
# For arm platform, you may find useful: pip install --upgrade mssql-cli
curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl -L https://packages.microsoft.com/config/ubuntu/20.04/prod.list | tee /etc/apt/sources.list.d/msprod.list && \
apt update && ACCEPT_EULA=Y apt install -y mssql-tools unixodbc-dev

PATH="${PREFIX}/bin:/opt/mssql-tools/bin/:${PATH}"
1 change: 0 additions & 1 deletion aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
dnl aclocal.m4
m4_include([config/ac_func_accept_argtypes.m4])
m4_include([config/ax_prog_perl_modules.m4])
m4_include([config/ax_pthread.m4])
m4_include([config/c-compiler.m4])
m4_include([config/c-library.m4])
Expand Down
77 changes: 0 additions & 77 deletions config/ax_prog_perl_modules.m4

This file was deleted.

Loading