From c2c576acecc8facdbeeea604dfed92c8ce787000 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sun, 13 Sep 2020 12:05:10 +1000 Subject: [PATCH 1/9] travis: compile.sh - prepare for mysql native tests --- travis/compile.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/travis/compile.sh b/travis/compile.sh index 683e7012a4542..1976bff56dc1b 100755 --- a/travis/compile.sh +++ b/travis/compile.sh @@ -23,19 +23,29 @@ if [[ -z "$MAKE_LOG_FILE" ]]; then else MAKE_QUIET="" fi - +if [[ -z "$MYSQL_DIR" ]]; then + PDOMYSQL=mysqlnd + MYSQLI=mysqlnd +else + PDOMYSQL=${MYSQL_DIR} + [ -f ${MYSQL_DIR}/bin/mariadb_config ] && MYSQLI=${MYSQL_DIR}/bin/mariadb_config + [ -f ${MYSQL_DIR}/bin/mysql_config ] && MYSQLI=${MYSQL_DIR}/bin/mysql_config +fi MAKE_JOBS=${MAKE_JOBS:-2} -./buildconf --force -./configure \ +if [ ! -f ${TRAVIS_BUILD_DIR}/configure ]; then + (cd ${TRAVIS_BUILD_DIR} ; ./buildconf --force ) +fi + +${TRAVIS_BUILD_DIR}/configure \ --prefix="$HOME"/php-install \ $CONFIG_QUIET \ $DEBUG \ $TS \ --enable-phpdbg \ --enable-fpm \ ---with-pdo-mysql=mysqlnd \ ---with-mysqli=mysqlnd \ +--with-pdo-mysql=${PDOMYSQL} \ +--with-mysqli=${MYSQLI} \ --with-pgsql \ --with-pdo-pgsql \ --with-pdo-sqlite \ From 5d7bd9c48fe7fdfa86922548aff8586b6e200b86 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sun, 13 Sep 2020 12:19:55 +1000 Subject: [PATCH 2/9] travis: test with multiple libmysqlclient versions --- .travis.yml | 10 ++++++++++ travis/compile.sh | 13 ++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 363d38a0bf629..9d1de4869471f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,6 +50,16 @@ env: - ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0 - ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 +jobs: + include: + - env: LIBMYSQL=mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 + - env: LIBMYSQL=mysql-5.7.31-linux-glibc2.12-x86_64.tar.gz ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 + - env: LIBMYSQL=mysql-8.0.21-linux-glibc2.12-x86_64.tar.xz ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 + allow_failures: + - env: LIBMYSQL=mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 + - env: LIBMYSQL=mysql-5.7.31-linux-glibc2.12-x86_64.tar.gz ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 + - env: LIBMYSQL=mysql-8.0.21-linux-glibc2.12-x86_64.tar.xz ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 + before_script: - ccache --version - ccache --zero-stats diff --git a/travis/compile.sh b/travis/compile.sh index 1976bff56dc1b..3daf6295fc58c 100755 --- a/travis/compile.sh +++ b/travis/compile.sh @@ -23,12 +23,23 @@ if [[ -z "$MAKE_LOG_FILE" ]]; then else MAKE_QUIET="" fi +if [[ -n "$LIBMYSQL" ]]; then + case "$LIBMYSQL" in + *.gz) EXTRACT=zxf ;; + *.xz) EXTRACT=Jxf ;; + esac + MYSQL_BASE=${LIBMYSQL%%-linux-*} + MYSQL_VERSION=${MYSQL_BASE#*-} + MYSQL_DIR=$HOME/$MYSQL_BASE + mkdir -p $MYSQL_DIR + URL=https://cdn.mysql.com//Downloads/MySQL-${MYSQL_VERSION%.*}/$LIBMYSQL + wget $URL -O - | tar -${EXTRACT} - --strip-components=1 -C $MYSQL_DIR +fi if [[ -z "$MYSQL_DIR" ]]; then PDOMYSQL=mysqlnd MYSQLI=mysqlnd else PDOMYSQL=${MYSQL_DIR} - [ -f ${MYSQL_DIR}/bin/mariadb_config ] && MYSQLI=${MYSQL_DIR}/bin/mariadb_config [ -f ${MYSQL_DIR}/bin/mysql_config ] && MYSQLI=${MYSQL_DIR}/bin/mysql_config fi MAKE_JOBS=${MAKE_JOBS:-2} From c9e3559cdd9b9db78044f4fc62b831b10b492b9f Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sun, 13 Sep 2020 13:04:28 +1000 Subject: [PATCH 3/9] travis: show config.log on configure failure --- travis/compile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/compile.sh b/travis/compile.sh index 3daf6295fc58c..7eade748c4093 100755 --- a/travis/compile.sh +++ b/travis/compile.sh @@ -99,7 +99,7 @@ $TS \ --with-kerberos \ --enable-sysvmsg \ --enable-zend-test=shared \ -> "$CONFIG_LOG_FILE" +> "$CONFIG_LOG_FILE" || (cat config.log; exit 2) make "-j${MAKE_JOBS}" $MAKE_QUIET > "$MAKE_LOG_FILE" make install >> "$MAKE_LOG_FILE" From 9d65e9123c2eb3e8cdb6fa8287f1703a0e086ed0 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sun, 13 Sep 2020 17:35:35 +1000 Subject: [PATCH 4/9] travis: limit to mysqli/pdo tests when LIBMYSQL is specified --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9d1de4869471f..4f5c8ef8bb84e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,7 +77,8 @@ before_script: # Run PHPs run-tests.php script: - - ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120 + - if [ -n "$LIBMYSQL" ]; then TESTS="ext/mysqli/tests/*phpt ext/pdo_mysql/tests/*phpt" ; fi + - ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120 ${TESTS} - sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");' after_success: From 69bebf80a3b5ca5bd0b0076f48b242461e2ec660 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sun, 13 Sep 2020 14:09:49 +1000 Subject: [PATCH 5/9] pdo_mysql/mysqli (native) libmysqlclient_r no-longer used The mysqlclient_r library exists in mysql-5.6 for compatibility only. Later versions have it removed. --- ext/mysqli/config.m4 | 3 --- ext/pdo_mysql/config.m4 | 9 ++------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4 index 38a130f4cd92e..7c02546266ce0 100644 --- a/ext/mysqli/config.m4 +++ b/ext/mysqli/config.m4 @@ -57,9 +57,6 @@ elif test "$PHP_MYSQLI" != "no"; then MYSQL_LIB_CFG='--libmysqld-libs' dnl mysqlnd doesn't support embedded, so we have to add some extra stuff mysqli_extra_sources="mysqli_embedded.c" - elif test "$enable_maintainer_zts" = "yes"; then - MYSQL_LIB_CFG='--libs_r' - MYSQL_LIB_NAME='mysqlclient_r' else MYSQL_LIB_CFG='--libs' fi diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4 index 3e37a6adec777..7efa814c541e9 100755 --- a/ext/pdo_mysql/config.m4 +++ b/ext/pdo_mysql/config.m4 @@ -66,13 +66,8 @@ if test "$PHP_PDO_MYSQL" != "no"; then if test "x$SED" = "x"; then AC_PATH_PROG(SED, sed) fi - if test "$enable_maintainer_zts" = "yes"; then - PDO_MYSQL_LIBNAME=mysqlclient_r - PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs_r | $SED -e "s/'//g"` - else - PDO_MYSQL_LIBNAME=mysqlclient - PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"` - fi + PDO_MYSQL_LIBNAME=mysqlclient + PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"` PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"` elif test -n "$PDO_MYSQL_DIR"; then AC_MSG_RESULT([not found]) From a716ac2b9a765367a6c503838bca3caeeeabc0f4 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 15 Sep 2020 15:22:05 +1000 Subject: [PATCH 6/9] ftp_ssl_connect_error.phpt; backort from master to pass on bionic --- ext/ftp/tests/ftp_ssl_connect_error.phpt | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/ext/ftp/tests/ftp_ssl_connect_error.phpt b/ext/ftp/tests/ftp_ssl_connect_error.phpt index 85fcf76f79946..13c8f9e9c02cb 100644 --- a/ext/ftp/tests/ftp_ssl_connect_error.phpt +++ b/ext/ftp/tests/ftp_ssl_connect_error.phpt @@ -12,14 +12,6 @@ echo "*** Testing ftp_ssl_connect() function : error conditions ***\n"; echo "\n-- Testing ftp_ssl_connect() function on failure --\n"; var_dump(ftp_ssl_connect('totes.invalid')); -echo "\n-- Testing ftp_ssl_connect() function invalid argument type --\n"; -ftp_ssl_connect([]); -ftp_ssl_connect('totes.invalid', []); -ftp_ssl_connect('totes.invalid', 21, []); - -echo "\n-- Testing ftp_ssl_connect() function with more than expected no. of arguments --\n"; -ftp_ssl_connect('totes.invalid', 21, 1, []); - echo "\n-- Testing ftp_ssl_connect() function timeout warning for value 0 --\n"; ftp_ssl_connect('totes.invalid', 21, 0); @@ -29,21 +21,9 @@ echo "===DONE===\n"; -- Testing ftp_ssl_connect() function on failure -- -Warning: ftp_ssl_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in %s on line %d +Warning: ftp_ssl_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s on line %d bool(false) --- Testing ftp_ssl_connect() function invalid argument type -- - -Warning: ftp_ssl_connect() expects parameter 1 to be string, array given in %s on line %d - -Warning: ftp_ssl_connect() expects parameter 2 to be int, array given in %s on line %d - -Warning: ftp_ssl_connect() expects parameter 3 to be int, array given in %s on line %d - --- Testing ftp_ssl_connect() function with more than expected no. of arguments -- - -Warning: ftp_ssl_connect() expects at most 3 parameters, 4 given in %s on line %d - -- Testing ftp_ssl_connect() function timeout warning for value 0 -- Warning: ftp_ssl_connect(): Timeout has to be greater than 0 in %s on line %d From e311ff36cf5b29042219866ea2fd1a42dc618bf4 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 15 Sep 2020 15:23:55 +1000 Subject: [PATCH 7/9] mysqli-bug55283.phpt backport from master --- ext/mysqli/tests/bug55283.phpt | 43 ++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/ext/mysqli/tests/bug55283.phpt b/ext/mysqli/tests/bug55283.phpt index e7b16fdd13c2d..306a4af156a33 100644 --- a/ext/mysqli/tests/bug55283.phpt +++ b/ext/mysqli/tests/bug55283.phpt @@ -12,6 +12,9 @@ if ($IS_MYSQLND && !extension_loaded("openssl")) if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))) die(sprintf("skip Connect failed, [%d] %s", mysqli_connect_errno(), mysqli_connect_error())); +if (false === strpos($link->host_info, 'TCP/IP')) + die(sprintf("skip SSL only supported on TCP/IP")); + $row = NULL; if ($res = $link->query('SHOW VARIABLES LIKE "have_ssl"')) { $row = $res->fetch_row(); @@ -36,40 +39,40 @@ $link->close(); ?> --FILE-- query("SHOW STATUS LIKE 'Ssl_cipher'"); - var_dump($r->fetch_row()); - } + $link = mysqli_init(); + mysqli_ssl_set($link, null, null, null, null, "AES256-SHA"); + if (my_mysqli_real_connect($link, 'p:' . $host, $user, $passwd, $db, $port, null, $flags)) { + $r = $link->query("SHOW STATUS LIKE 'Ssl_cipher'"); + var_dump($r->fetch_row()); + } - /* non-persistent connection */ - $link2 = mysqli_init(); - mysqli_ssl_set($link2, null, null, null, null, "RC4-MD5"); - if (my_mysqli_real_connect($link2, $host, $user, $passwd, $db, $port, null, $flags)) { - $r2 = $link2->query("SHOW STATUS LIKE 'Ssl_cipher'"); - var_dump($r2->fetch_row()); - } + /* non-persistent connection */ + $link2 = mysqli_init(); + mysqli_ssl_set($link2, null, null, null, null, "AES256-SHA"); + if (my_mysqli_real_connect($link2, $host, $user, $passwd, $db, $port, null, $flags)) { + $r2 = $link2->query("SHOW STATUS LIKE 'Ssl_cipher'"); + var_dump($r2->fetch_row()); + } - echo "done\n"; + echo "done\n"; ?> ---EXPECT-- +--EXPECTF-- array(2) { [0]=> string(10) "Ssl_cipher" [1]=> - string(7) "RC4-MD5" + string(%d) "%rAES256-SHA|TLS_AES_256_GCM_SHA384%r" } array(2) { [0]=> string(10) "Ssl_cipher" [1]=> - string(7) "RC4-MD5" + string(%d) "%rAES256-SHA|TLS_AES_256_GCM_SHA384%r" } done From 121e023ba1ab2d88da3ad10f3bcb4b7df7413a9d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 4 Sep 2020 12:59:42 +0200 Subject: [PATCH 8/9] Make gethostbyname() test more liberal This returns 127.0.1.1 on travis bionic. --- ext/standard/tests/network/gethostbyname_basic003.phpt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/standard/tests/network/gethostbyname_basic003.phpt b/ext/standard/tests/network/gethostbyname_basic003.phpt index 6462126a0dbe0..da07e6b5d9046 100644 --- a/ext/standard/tests/network/gethostbyname_basic003.phpt +++ b/ext/standard/tests/network/gethostbyname_basic003.phpt @@ -11,8 +11,6 @@ echo "*** Testing gethostbyname() : basic functionality ***\n"; echo gethostbyname("localhost")."\n"; ?> -===DONE=== ---EXPECT-- +--EXPECTF-- *** Testing gethostbyname() : basic functionality *** -127.0.0.1 -===DONE=== +127.0.%d.1 From 82f1792efb9f5c59ef10c93ebbd562f4b29322db Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sun, 13 Sep 2020 12:09:02 +1000 Subject: [PATCH 9/9] travis: bump to bionic --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f5c8ef8bb84e..a9340f5d5613c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ git: quiet: true -dist: trusty +dist: bionic +services: + - mysql + - postgresql language: c sudo: required addons: @@ -19,7 +22,6 @@ addons: - librecode-dev - libsasl2-dev - libxpm-dev - - libt1-dev - libzip-dev notifications: