File: installcheck

package info (click to toggle)
postgresql-mysql-fdw 2.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,300 kB
  • sloc: ansic: 5,417; sql: 1,552; sh: 71; makefile: 42
file content (42 lines) | stat: -rwxr-xr-x 1,157 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

export LANG=en_US.UTF-8
unset LANGUAGE LC_ALL LC_CTYPE

MYSQL="mysql --defaults-file=/etc/mysql/debian.cnf -v mysql"

(
    set -eux

    service mariadb start || service mysql start || exit 77

    # work around bug in Ubuntu jammy (2022-03-02)
    test -d /var/run/mysqld && chmod -v 755 /var/run/mysqld

    # Create the MySQL test database and user.
    echo "== creating the MySQL test database"
    cat debian/tests/mysql.testschema.sql | $MYSQL
    ./mysql_init.sh

    for v in $(pg_buildext installed-versions); do
        case $v in 9*|10) ;;
            *) NO_JIT="-o jit=off" ;;
        esac

        # tun jit off (https://github.com/EnterpriseDB/mysql_fdw/pull/227)
        PG_VIRTUALENV_UNSHARE="" MYSQL_USER_NAME=edb MYSQL_PWD=edb pg_buildext ${NO_JIT:-} installcheck-$v
    done
)
status=$?

(
    # Cleanup the MySQL test database (even in case of an error above)
    echo "== dropping the MySQL test database"
    echo "DROP USER 'edb'@'localhost'" | $MYSQL
    echo "DROP DATABASE mysql_fdw_regress" | $MYSQL
    echo "DROP DATABASE mysql_fdw_regress1" | $MYSQL

    service mariadb stop || service mysql stop
)

exit $status