From 3b6c1bc7d6d2b3ff7a4be9881df906a70d7c8539 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Fri, 7 Jun 2024 14:51:13 +0200 Subject: [PATCH] Make it possible to run with informix --- ci/build.sh | 2 ++ ci/database-start.sh | 2 ++ docker_db.sh | 52 +++++++++++++++++++++++++++++++++++++++ gradle/databases.gradle | 2 +- gradle/java-module.gradle | 3 +++ settings.gradle | 2 +- 6 files changed, 61 insertions(+), 2 deletions(-) diff --git a/ci/build.sh b/ci/build.sh index 019f6dbf08..3bfa653f1c 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -76,6 +76,8 @@ elif [ "$RDBMS" == "cockroachdb" ]; then goal="-Pdb=cockroachdb" elif [ "$RDBMS" == "altibase" ]; then goal="-Pdb=altibase" +elif [ "$RDBMS" == "informix" ]; then + goal="-Pdb=informix" fi # Only run checkstyle in the H2 build, diff --git a/ci/database-start.sh b/ci/database-start.sh index 525b5f8984..da8f3a3e78 100755 --- a/ci/database-start.sh +++ b/ci/database-start.sh @@ -32,4 +32,6 @@ elif [ "$RDBMS" == 'cockroachdb' ]; then bash $DIR/../docker_db.sh cockroachdb elif [ "$RDBMS" == 'hana' ]; then bash $DIR/../docker_db.sh hana +elif [ "$RDBMS" == 'informix' ]; then + bash $DIR/../docker_db.sh informix fi \ No newline at end of file diff --git a/docker_db.sh b/docker_db.sh index f48994c981..88d75eaecc 100755 --- a/docker_db.sh +++ b/docker_db.sh @@ -946,6 +946,58 @@ tidb_5_4() { fi } +informix() { + informix_14_10 +} + +informix_14_10() { + $PRIVILEGED_CLI $CONTAINER_CLI rm -f informix || true + $PRIVILEGED_CLI $CONTAINER_CLI run --name informix --privileged -p 9088:9088 -e LICENSE=accept -d icr.io/informix/informix-developer-database:14.10.FC9W1DE + echo "Starting Informix. This can take a few minutes" + # Give the container some time to start + OUTPUT= + n=0 + until [ "$n" -ge 10 ] + do + OUTPUT=$($CONTAINER_CLI logs informix 2>&1) + if [[ $OUTPUT == *"Server Started"* ]]; then + break; + fi + n=$((n+1)) + echo "Waiting for Informix to start..." + sleep 30 + done + if [ "$n" -ge 5 ]; then + echo "Informix failed to start and configure after 5 minutes" + else + echo "Informix successfully started" + fi +} + +informix_12_10() { + $PRIVILEGED_CLI $CONTAINER_CLI rm -f informix || true + $PRIVILEGED_CLI $CONTAINER_CLI run --name informix --privileged -p 9088:9088 -e LICENSE=accept -d ibmcom/informix-developer-database:12.10.FC12W1DE + echo "Starting Informix. This can take a few minutes" + # Give the container some time to start + OUTPUT= + n=0 + until [ "$n" -ge 10 ] + do + OUTPUT=$($CONTAINER_CLI logs informix 2>&1) + if [[ $OUTPUT == *"login Information"* ]]; then + break; + fi + n=$((n+1)) + echo "Waiting for Informix to start..." + sleep 30 + done + if [ "$n" -ge 5 ]; then + echo "Informix failed to start and configure after 5 minutes" + else + echo "Informix successfully started" + fi +} + if [ -z ${1} ]; then echo "No db name provided" echo "Provide one of:" diff --git a/gradle/databases.gradle b/gradle/databases.gradle index f767766995..0823daef7e 100644 --- a/gradle/databases.gradle +++ b/gradle/databases.gradle @@ -291,7 +291,7 @@ ext { 'connection.init_sql' : '' ], informix : [ - 'db.dialect' : 'org.hibernate.dialect.InformixDialect', + 'db.dialect' : 'org.hibernate.community.dialect.InformixDialect', 'jdbc.driver': 'com.informix.jdbc.IfxDriver', 'jdbc.user' : 'informix', 'jdbc.pass' : 'in4mix', diff --git a/gradle/java-module.gradle b/gradle/java-module.gradle index df79d191ab..e3c6383cdf 100644 --- a/gradle/java-module.gradle +++ b/gradle/java-module.gradle @@ -131,6 +131,9 @@ dependencies { else if ( db.startsWith( 'altibase' ) ) { testRuntimeOnly dbLibs.altibase } + else if ( db.startsWith( 'informix' ) ) { + testRuntimeOnly dbLibs.informix + } annotationProcessor libs.loggingProcessor annotationProcessor libs.logging diff --git a/settings.gradle b/settings.gradle index 7901e2386b..f5952bf219 100644 --- a/settings.gradle +++ b/settings.gradle @@ -231,7 +231,7 @@ dependencyResolutionManagement { def hanaVersion = version "hana", "2.19.11" def h2gisVersion = version "h2gis", overrideableVersion( "gradle.libs.versions.h2gis", "2.2.0" ) def hsqldbVersion = version "hsqldb", overrideableVersion( "gradle.libs.versions.hsqldb", "2.7.2" ) - def informixVersion = version "informix", "4.10.12" + def informixVersion = version "informix", "4.50.10.1" def mariadbVersion = version "mariadb", "3.3.1" def mssqlVersion = version "mssql", "12.4.2.jre11" def mysqlVersion = version "mysql", "8.2.0"