From e7b03c16795c56644721e719d66432cbfd9ec966 Mon Sep 17 00:00:00 2001 From: Kirill Morozov Date: Thu, 30 Dec 2021 01:24:27 +0300 Subject: [PATCH 01/15] PHP 8.1 Compatibility Fixes Adapt code to mysqlnd changes in the PHP 8.1 code base. --- xmysqlnd/xmysqlnd_protocol_frame_codec.cc | 2 +- xmysqlnd/xmysqlnd_session.cc | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/xmysqlnd/xmysqlnd_protocol_frame_codec.cc b/xmysqlnd/xmysqlnd_protocol_frame_codec.cc index 07346dc6..9f890fe8 100644 --- a/xmysqlnd/xmysqlnd_protocol_frame_codec.cc +++ b/xmysqlnd/xmysqlnd_protocol_frame_codec.cc @@ -61,7 +61,7 @@ XMYSQLND_METHOD(xmysqlnd_pfc, send)(XMYSQLND_PFC * const pfc, size_t to_be_sent; DBG_ENTER("xmysqlnd_pfc::send"); - DBG_INF_FMT("count=" MYSQLND_SZ_T_SPEC, count); + DBG_INF_FMT("count=%zu", count); if (!vio || FALSE == vio->data->m.has_valid_stream(vio)) { DBG_RETURN(FAIL); } diff --git a/xmysqlnd/xmysqlnd_session.cc b/xmysqlnd/xmysqlnd_session.cc index b483dd1d..603b69d4 100644 --- a/xmysqlnd/xmysqlnd_session.cc +++ b/xmysqlnd/xmysqlnd_session.cc @@ -793,9 +793,7 @@ xmysqlnd_session_data::xmysqlnd_session_data( if (error_info) { error_info = mysqlnd_error_info? mysqlnd_error_info : &error_info_impl; } else { - if (FAIL == mysqlnd_error_info_init(&error_info_impl, persistent)) { - throw std::runtime_error("mysqlnd_error_info_init failed"); - } + mysqlnd_error_info_init(&error_info_impl, persistent); error_info = &error_info_impl; } From eb90df852e2898b3e850bcdae62e57a0799f977b Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Wed, 11 May 2022 13:03:22 +0200 Subject: [PATCH 02/15] config.m4: Better support for out-of-source builds. --- config.m4 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/config.m4 b/config.m4 index e96b9703..fdaecf84 100644 --- a/config.m4 +++ b/config.m4 @@ -455,14 +455,12 @@ if test "$PHP_MYSQL_XDEVAPI" != "no" || test "$PHP_MYSQL_XDEVAPI_ENABLED" == "ye PHP_ADD_INCLUDE([$ext_srcdir/xmysqlnd/cdkbase/include]) PHP_ADD_INCLUDE([$ext_srcdir/xmysqlnd/cdkbase/extra/rapidjson/include]) - PHP_ADD_BUILD_DIR([$ext_srcdir]) - PHP_ADD_BUILD_DIR([$ext_srcdir/util]) - PHP_ADD_BUILD_DIR([$ext_srcdir/xmysqlnd]) - PHP_ADD_BUILD_DIR([$ext_srcdir/xmysqlnd/crud_parsers]) - PHP_ADD_BUILD_DIR([$ext_srcdir/xmysqlnd/proto_gen]) - PHP_ADD_BUILD_DIR([$ext_srcdir/xmysqlnd/cdkbase/core]) - PHP_ADD_BUILD_DIR([$ext_srcdir/xmysqlnd/cdkbase/foundation]) - PHP_ADD_BUILD_DIR([$ext_srcdir/xmysqlnd/cdkbase/parser]) + PHP_ADD_BUILD_DIR([$ext_builddir/util]) + PHP_ADD_BUILD_DIR([$ext_builddir/xmysqlnd/crud_parsers]) + PHP_ADD_BUILD_DIR([$ext_builddir/xmysqlnd/proto_gen]) + PHP_ADD_BUILD_DIR([$ext_builddir/xmysqlnd/cdkbase/core]) + PHP_ADD_BUILD_DIR([$ext_builddir/xmysqlnd/cdkbase/foundation]) + PHP_ADD_BUILD_DIR([$ext_builddir/xmysqlnd/cdkbase/parser]) PHP_ADD_MAKEFILE_FRAGMENT() From a68a7d78feefa005a258945ce628aba46f1efd2b Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Wed, 22 Jun 2022 12:00:16 +0200 Subject: [PATCH 03/15] cdkbase: Disable c++17 deprecation warning. Note: the code should be fixed to not use deprecated template. --- .../cdkbase/include/mysql/cdk/foundation/string.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xmysqlnd/cdkbase/include/mysql/cdk/foundation/string.h b/xmysqlnd/cdkbase/include/mysql/cdk/foundation/string.h index a8c91d5d..985ad012 100644 --- a/xmysqlnd/cdkbase/include/mysql/cdk/foundation/string.h +++ b/xmysqlnd/cdkbase/include/mysql/cdk/foundation/string.h @@ -375,6 +375,14 @@ size_t str_encode( at a time (single character can be encoded using one or more code units). */ +// FIXME: std::iterator<> is deprecated in c++17 + +#ifndef _MSC_VER +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + + template class char_iterator_base : public std::iterator< @@ -559,6 +567,11 @@ class char_iterator_base }; // char_iterator_base +#ifndef _MSC_VER +#pragma GCC diagnostic pop +#endif + + /* String class using UTF16 for internal representation. */ From 2b2441983c18e61848755369cf1966cc4ed96c71 Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Wed, 22 Jun 2022 15:15:44 +0200 Subject: [PATCH 04/15] Fix compiler warnings. --- mysqlx_exception.cc | 2 +- xmysqlnd/xmysqlnd_wireprotocol.cc | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mysqlx_exception.cc b/mysqlx_exception.cc index 928f8c7c..54fee828 100644 --- a/mysqlx_exception.cc +++ b/mysqlx_exception.cc @@ -129,7 +129,7 @@ create_exception(int code, const util::string_view& sql_state, const util::strin { char* msg{nullptr}; DBG_ENTER("create_exception"); - mnd_sprintf(&msg, 0, "[%*s] %*s", sql_state.length(), sql_state.data(), message.length(), message.data()); + mnd_sprintf(&msg, 0, "[%*s] %*s", (int)sql_state.length(), sql_state.data(), message.length(), message.data()); if (msg) { zend_throw_exception(mysqlx_exception_class_entry, msg, code); mnd_efree(msg); diff --git a/xmysqlnd/xmysqlnd_wireprotocol.cc b/xmysqlnd/xmysqlnd_wireprotocol.cc index ce6e5b86..db07ba81 100644 --- a/xmysqlnd/xmysqlnd_wireprotocol.cc +++ b/xmysqlnd/xmysqlnd_wireprotocol.cc @@ -383,7 +383,13 @@ xmysqlnd_send_message( char stack_buffer[SIZE_OF_STACK_BUFFER]; void* payload = stack_buffer; - const size_t payload_size = message.ByteSize(); + const size_t payload_size = +#if GOOGLE_PROTOBUF_VERSION < 3006001 + message.ByteSize(); +#else + message.ByteSizeLong(); +#endif + if (payload_size > sizeof(stack_buffer)) { payload = payload_size? mnd_emalloc(payload_size) : nullptr; if (payload_size && !payload) { From 1b62f435f9c0c22975fb965df587c50e416e650d Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Tue, 28 Jun 2022 12:15:15 +0200 Subject: [PATCH 05/15] Update version to 8.0.30 --- package.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.xml b/package.xml index 0e994e14..f0817691 100644 --- a/package.xml +++ b/package.xml @@ -49,10 +49,10 @@ The X DevAPI introduces a new, modern and easy-to-learn way to work with your da mysqlre@php.net yes - 2022-04-26 + 2022-06-26 - 8.0.29 + 8.0.30 1.0.0 From 48feb5a723be7233c20cf7dc369312702c05d5b4 Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Tue, 28 Jun 2022 13:55:32 +0200 Subject: [PATCH 06/15] tests: Using the global user account for auth/timeout tests --- tests/auth/timeout/incorrect_timeout.phpt | 54 +++++++++---------- tests/auth/timeout/successful_no_timeout.phpt | 12 ++--- tests/auth/timeout/timeout_utils.inc | 5 +- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/tests/auth/timeout/incorrect_timeout.phpt b/tests/auth/timeout/incorrect_timeout.phpt index b5544864..516d34c8 100644 --- a/tests/auth/timeout/incorrect_timeout.phpt +++ b/tests/auth/timeout/incorrect_timeout.phpt @@ -32,85 +32,85 @@ print "done!\n"; clean_test_db(); ?> --EXPECTF-- -mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout=-5 +mysqlx://%s:%S@127.0.0.1/?connect-timeout=-5 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1:81/?connect-timeout=-10 +mysqlx://%s:%S@127.0.0.1:81/?connect-timeout=-10 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1:80/?connect-timeout=this_is_incorrect_timeout +mysqlx://%s:%S@127.0.0.1:80/?connect-timeout=this_is_incorrect_timeout [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'this_is_incorrect_timeout'. ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1:82/?connect-timeout=invalid-time-out +mysqlx://%s:%S@127.0.0.1:82/?connect-timeout=invalid-time-out [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'invalid-time-out'. ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout=-1.1 +mysqlx://%s:%S@127.0.0.1/?connect-timeout=-1.1 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1:83/?connect-timeout=-10.101 +mysqlx://%s:%S@127.0.0.1:83/?connect-timeout=-10.101 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout= , +mysqlx://%s:%S@127.0.0.1/?connect-timeout= , [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is ','. ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout=++-- +mysqlx://%s:%S@127.0.0.1/?connect-timeout=++-- [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is '++--'. ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1/?connect-timeout= +mysqlx://%s:%S@127.0.0.1/?connect-timeout= [10052][HY000] Invalid argument. The argument to connect-timeout cannot be empty. ---------------------- -mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout=-5 +mysqlx://%s:%S@198.51.100.255/?connect-timeout=-5 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@198.51.100.255:81/?connect-timeout=-10 +mysqlx://%s:%S@198.51.100.255:81/?connect-timeout=-10 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@198.51.100.255:80/?connect-timeout=this_is_incorrect_timeout +mysqlx://%s:%S@198.51.100.255:80/?connect-timeout=this_is_incorrect_timeout [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'this_is_incorrect_timeout'. ---------------------- -mysqlx://testuser:testpasswd@198.51.100.255:82/?connect-timeout=invalid-time-out +mysqlx://%s:%S@198.51.100.255:82/?connect-timeout=invalid-time-out [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'invalid-time-out'. ---------------------- -mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout=-1.1 +mysqlx://%s:%S@198.51.100.255/?connect-timeout=-1.1 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@198.51.100.255:83/?connect-timeout=-10.101 +mysqlx://%s:%S@198.51.100.255:83/?connect-timeout=-10.101 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout= , +mysqlx://%s:%S@198.51.100.255/?connect-timeout= , [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is ','. ---------------------- -mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout=++-- +mysqlx://%s:%S@198.51.100.255/?connect-timeout=++-- [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is '++--'. ---------------------- -mysqlx://testuser:testpasswd@198.51.100.255/?connect-timeout= +mysqlx://%s:%S@198.51.100.255/?connect-timeout= [10052][HY000] Invalid argument. The argument to connect-timeout cannot be empty. ---------------------- -mysqlx://testuser:testpasswd@localhost/?connect-timeout=-5 +mysqlx://%s:%S@localhost/?connect-timeout=-5 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@localhost:81/?connect-timeout=-10 +mysqlx://%s:%S@localhost:81/?connect-timeout=-10 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@localhost:80/?connect-timeout=this_is_incorrect_timeout +mysqlx://%s:%S@localhost:80/?connect-timeout=this_is_incorrect_timeout [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'this_is_incorrect_timeout'. ---------------------- -mysqlx://testuser:testpasswd@localhost:82/?connect-timeout=invalid-time-out +mysqlx://%s:%S@localhost:82/?connect-timeout=invalid-time-out [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'invalid-time-out'. ---------------------- -mysqlx://testuser:testpasswd@localhost/?connect-timeout=-1.1 +mysqlx://%s:%S@localhost/?connect-timeout=-1.1 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@localhost:83/?connect-timeout=-10.101 +mysqlx://%s:%S@localhost:83/?connect-timeout=-10.101 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://testuser:testpasswd@localhost/?connect-timeout= , +mysqlx://%s:%S@localhost/?connect-timeout= , [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is ','. ---------------------- -mysqlx://testuser:testpasswd@localhost/?connect-timeout=++-- +mysqlx://%s:%S@localhost/?connect-timeout=++-- [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is '++--'. ---------------------- -mysqlx://testuser:testpasswd@localhost/?connect-timeout= +mysqlx://%s:%S@localhost/?connect-timeout= [10052][HY000] Invalid argument. The argument to connect-timeout cannot be empty. ---------------------- done!%A diff --git a/tests/auth/timeout/successful_no_timeout.phpt b/tests/auth/timeout/successful_no_timeout.phpt index 2ad54587..75d48a34 100644 --- a/tests/auth/timeout/successful_no_timeout.phpt +++ b/tests/auth/timeout/successful_no_timeout.phpt @@ -25,16 +25,16 @@ print "done!\n"; clean_test_db(); ?> --EXPECTF-- -mysqlx://testuser:testpasswd@127.0.0.1:%d/?connect-timeout=4 +mysqlx://%s:%S@127.0.0.1:%d/?connect-timeout=4 ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1:%d +mysqlx://%s:%S@127.0.0.1:%d ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1:%d/?connect-timeout=0 +mysqlx://%s:%S@127.0.0.1:%d/?connect-timeout=0 ---------------------- -mysqlx://testuser:testpasswd@localhost:%d/?connect-timeout=7 +mysqlx://%s:%S@localhost:%d/?connect-timeout=7 ---------------------- -mysqlx://testuser:testpasswd@localhost:%d +mysqlx://%s:%S@localhost:%d ---------------------- -mysqlx://testuser:testpasswd@localhost:%d/?connect-timeout=0 +mysqlx://%s:%S@localhost:%d/?connect-timeout=0 ---------------------- done!%A diff --git a/tests/auth/timeout/timeout_utils.inc b/tests/auth/timeout/timeout_utils.inc index 3aa3caf2..90a32c17 100644 --- a/tests/auth/timeout/timeout_utils.inc +++ b/tests/auth/timeout/timeout_utils.inc @@ -3,8 +3,6 @@ require_once(__DIR__."/../auth_utils.inc"); const Default_connection_time_out = 10; -const Timeout_test_user = "testuser"; - const Envar_non_routable_host = "MYSQLX_TEST_NON_ROUTABLE_HOST"; const Envar_non_routable_host_port = "MYSQLX_TEST_NON_ROUTABLE_HOST_PORT"; @@ -43,7 +41,8 @@ $Non_routable_ports = [ function prepare_uri_with_timeout($host, $port, $timeout) { global $scheme; global $passwd; - $uri = $scheme . '://' . Timeout_test_user . ':' . $passwd . '@' . $host; + global $user; + $uri = $scheme . '://' . $user . ':' . $passwd . '@' . $host; if ($port !== null) $uri .= ':' . $port; if ($timeout !== null) $uri .= '/?connect-timeout=' . $timeout; return $uri; From b4120b3787b022c5f43ba9fe66283a220536bc1d Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Wed, 29 Jun 2022 09:26:04 +0200 Subject: [PATCH 07/15] bug#34332205 xdevapi: not accepting null when parsing #2 argume... --- mysqlx_client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqlx_client.cc b/mysqlx_client.cc index 44e00b6d..d1dfa06e 100644 --- a/mysqlx_client.cc +++ b/mysqlx_client.cc @@ -691,7 +691,7 @@ MYSQL_XDEVAPI_PHP_FUNCTION(mysql_xdevapi_getClient) RETVAL_NULL(); DBG_ENTER("mysql_xdevapi_getClient"); - if (FAILURE == util::get_function_arguments(execute_data, "s|s", + if (FAILURE == util::get_function_arguments(execute_data, "s|s!", &connection_uri.str, &connection_uri.len, &client_options_desc.str, &client_options_desc.len)) { From c6908cb9cbf998a5dd15ce481e0945880fa4b6bd Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Tue, 12 Jul 2022 12:19:09 +0200 Subject: [PATCH 08/15] tests: Make tests work also with non-local server. --- tests/auth/secure_native.phpt | 2 +- tests/auth/secure_sha256_mem.phpt | 8 ++--- tests/auth/sha256_mem.phpt | 12 +++---- tests/auth/timeout/incorrect_timeout.phpt | 36 +++++++++---------- tests/auth/timeout/successful_no_timeout.phpt | 16 ++++----- tests/auth/unsecure_native.phpt | 6 ++-- tests/auth/unsecure_sha256_mem.phpt | 12 +++---- tests/auth/warnings_secure_caching_sha2.phpt | 32 ++++++++--------- tests/auth/warnings_secure_native.phpt | 28 +++++++-------- .../auth/warnings_unsecure_caching_sha2.phpt | 36 +++++++++---------- tests/auth/warnings_unsecure_native.phpt | 20 +++++------ 11 files changed, 104 insertions(+), 104 deletions(-) diff --git a/tests/auth/secure_native.phpt b/tests/auth/secure_native.phpt index c7993ff1..4d7efb45 100644 --- a/tests/auth/secure_native.phpt +++ b/tests/auth/secure_native.phpt @@ -56,7 +56,7 @@ print "done!\n"; --EXPECTF-- [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism UNSUPPORTED -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism nonworking [1251][HY000] Invalid authentication method EXTERNAL diff --git a/tests/auth/secure_sha256_mem.phpt b/tests/auth/secure_sha256_mem.phpt index 3305e9d4..45c9e4ec 100644 --- a/tests/auth/secure_sha256_mem.phpt +++ b/tests/auth/secure_sha256_mem.phpt @@ -54,14 +54,14 @@ print "done!\n"; clean_test_db(); ?> --EXPECTF-- -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism UNSUPPORTED -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism nonworking -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism NonSupporteD done!%A diff --git a/tests/auth/sha256_mem.phpt b/tests/auth/sha256_mem.phpt index 632a29b5..5c741fea 100644 --- a/tests/auth/sha256_mem.phpt +++ b/tests/auth/sha256_mem.phpt @@ -53,11 +53,11 @@ print "done!\n"; --EXPECTF-- [10054][HY000] Authentication failure. Authentication failed using MYSQL41, SHA256_MEMORY. Check username and password or try a secure connection [1251][HY000] Invalid authentication method PLAIN -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) [10054][HY000] Authentication failure. Authentication failed using MYSQL41, SHA256_MEMORY. Check username and password or try a secure connection -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) done!%A diff --git a/tests/auth/timeout/incorrect_timeout.phpt b/tests/auth/timeout/incorrect_timeout.phpt index 516d34c8..557b0f18 100644 --- a/tests/auth/timeout/incorrect_timeout.phpt +++ b/tests/auth/timeout/incorrect_timeout.phpt @@ -32,31 +32,31 @@ print "done!\n"; clean_test_db(); ?> --EXPECTF-- -mysqlx://%s:%S@127.0.0.1/?connect-timeout=-5 +mysqlx://%s:%S@%S/?connect-timeout=-5 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://%s:%S@127.0.0.1:81/?connect-timeout=-10 +mysqlx://%s:%S@%S:81/?connect-timeout=-10 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://%s:%S@127.0.0.1:80/?connect-timeout=this_is_incorrect_timeout +mysqlx://%s:%S@%S:80/?connect-timeout=this_is_incorrect_timeout [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'this_is_incorrect_timeout'. ---------------------- -mysqlx://%s:%S@127.0.0.1:82/?connect-timeout=invalid-time-out +mysqlx://%s:%S@%S:82/?connect-timeout=invalid-time-out [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'invalid-time-out'. ---------------------- -mysqlx://%s:%S@127.0.0.1/?connect-timeout=-1.1 +mysqlx://%s:%S@%S/?connect-timeout=-1.1 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://%s:%S@127.0.0.1:83/?connect-timeout=-10.101 +mysqlx://%s:%S@%S:83/?connect-timeout=-10.101 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://%s:%S@127.0.0.1/?connect-timeout= , +mysqlx://%s:%S@%S/?connect-timeout= , [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is ','. ---------------------- -mysqlx://%s:%S@127.0.0.1/?connect-timeout=++-- +mysqlx://%s:%S@%S/?connect-timeout=++-- [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is '++--'. ---------------------- -mysqlx://%s:%S@127.0.0.1/?connect-timeout= +mysqlx://%s:%S@%S/?connect-timeout= [10052][HY000] Invalid argument. The argument to connect-timeout cannot be empty. ---------------------- mysqlx://%s:%S@198.51.100.255/?connect-timeout=-5 @@ -86,31 +86,31 @@ mysqlx://%s:%S@198.51.100.255/?connect-timeout=++-- mysqlx://%s:%S@198.51.100.255/?connect-timeout= [10052][HY000] Invalid argument. The argument to connect-timeout cannot be empty. ---------------------- -mysqlx://%s:%S@localhost/?connect-timeout=-5 +mysqlx://%s:%S@%S/?connect-timeout=-5 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://%s:%S@localhost:81/?connect-timeout=-10 +mysqlx://%s:%S@%S:81/?connect-timeout=-10 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://%s:%S@localhost:80/?connect-timeout=this_is_incorrect_timeout +mysqlx://%s:%S@%S:80/?connect-timeout=this_is_incorrect_timeout [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'this_is_incorrect_timeout'. ---------------------- -mysqlx://%s:%S@localhost:82/?connect-timeout=invalid-time-out +mysqlx://%s:%S@%S:82/?connect-timeout=invalid-time-out [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is 'invalid-time-out'. ---------------------- -mysqlx://%s:%S@localhost/?connect-timeout=-1.1 +mysqlx://%s:%S@%S/?connect-timeout=-1.1 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://%s:%S@localhost:83/?connect-timeout=-10.101 +mysqlx://%s:%S@%S:83/?connect-timeout=-10.101 [10050][HY000] TypeError: The connection timeout value must be a positive integer (including 0). ---------------------- -mysqlx://%s:%S@localhost/?connect-timeout= , +mysqlx://%s:%S@%S/?connect-timeout= , [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is ','. ---------------------- -mysqlx://%s:%S@localhost/?connect-timeout=++-- +mysqlx://%s:%S@%S/?connect-timeout=++-- [10052][HY000] Invalid argument. The argument to connect-timeout must be an integer, but it is '++--'. ---------------------- -mysqlx://%s:%S@localhost/?connect-timeout= +mysqlx://%s:%S@%S/?connect-timeout= [10052][HY000] Invalid argument. The argument to connect-timeout cannot be empty. ---------------------- done!%A diff --git a/tests/auth/timeout/successful_no_timeout.phpt b/tests/auth/timeout/successful_no_timeout.phpt index 75d48a34..afeb3353 100644 --- a/tests/auth/timeout/successful_no_timeout.phpt +++ b/tests/auth/timeout/successful_no_timeout.phpt @@ -13,8 +13,8 @@ function test_successful_not_elapsed_timeouts($host, $timeout) { test_successful_not_elapsed_timeout($host, 0); } -test_successful_not_elapsed_timeouts("127.0.0.1", 4); -test_successful_not_elapsed_timeouts("localhost", 7); +test_successful_not_elapsed_timeouts($host, 4); +test_successful_not_elapsed_timeouts($host, 7); verify_expectations(); print "done!\n"; @@ -25,16 +25,16 @@ print "done!\n"; clean_test_db(); ?> --EXPECTF-- -mysqlx://%s:%S@127.0.0.1:%d/?connect-timeout=4 +mysqlx://%s:%S@%S:%d/?connect-timeout=4 ---------------------- -mysqlx://%s:%S@127.0.0.1:%d +mysqlx://%s:%S@%S:%d ---------------------- -mysqlx://%s:%S@127.0.0.1:%d/?connect-timeout=0 +mysqlx://%s:%S@%S:%d/?connect-timeout=0 ---------------------- -mysqlx://%s:%S@localhost:%d/?connect-timeout=7 +mysqlx://%s:%S@%S:%d/?connect-timeout=7 ---------------------- -mysqlx://%s:%S@localhost:%d +mysqlx://%s:%S@%S:%d ---------------------- -mysqlx://%s:%S@localhost:%d/?connect-timeout=0 +mysqlx://%s:%S@%S:%d/?connect-timeout=0 ---------------------- done!%A diff --git a/tests/auth/unsecure_native.phpt b/tests/auth/unsecure_native.phpt index 6fb7db5e..f9313bed 100644 --- a/tests/auth/unsecure_native.phpt +++ b/tests/auth/unsecure_native.phpt @@ -49,15 +49,15 @@ print "done!\n"; ?> --EXPECTF-- [1251][HY000] Invalid authentication method PLAIN -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism WRONG [1251][HY000] Invalid authentication method PLAIN -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism non-existent [1251][HY000] Invalid authentication method PLAIN -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism InCorrect done!%A diff --git a/tests/auth/unsecure_sha256_mem.phpt b/tests/auth/unsecure_sha256_mem.phpt index 1d42389b..7b871de9 100644 --- a/tests/auth/unsecure_sha256_mem.phpt +++ b/tests/auth/unsecure_sha256_mem.phpt @@ -63,21 +63,21 @@ print "done!\n"; ?> --EXPECTF-- [10054][HY000] Authentication failure. Authentication failed using MYSQL41, SHA256_MEMORY. Check username and password or try a secure connection -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) [1251][HY000] Invalid authentication method PLAIN -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism UNSUPPORTED -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) [1251][HY000] Invalid authentication method PLAIN -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism nonworking [10046][HY000] Invalid authentication mechanism MyqQl41 [1251][HY000] Invalid authentication method PLAIN -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) [1251][HY000] Invalid authentication method EXTERNAL [10046][HY000] Invalid authentication mechanism imProper [10054][HY000] Authentication failure. Authentication failed using MYSQL41, SHA256_MEMORY. Check username and password or try a secure connection -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) done!%A diff --git a/tests/auth/warnings_secure_caching_sha2.phpt b/tests/auth/warnings_secure_caching_sha2.phpt index f40bfc74..8c08afb3 100644 --- a/tests/auth/warnings_secure_caching_sha2.phpt +++ b/tests/auth/warnings_secure_caching_sha2.phpt @@ -36,36 +36,36 @@ print "done!\n"; clean_test_db(); ?> --EXPECTF-- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-key=%s&auth=MYSQL41 +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-key=%s&auth=MYSQL41 -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) in %s -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) in %s +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-key=%s&auth=SHA256_MEMORY +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-key=%s&auth=SHA256_MEMORY -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) in %s -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) in %s +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-key=%s&auth=EXTERNAL +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-key=%s&auth=EXTERNAL Warning: mysql_xdevapi\getSession(): [1251][HY000] Invalid authentication method EXTERNAL in %s %A [1251][HY000] Invalid authentication method EXTERNAL ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-key=%s&auth=UNKNOWN +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-key=%s&auth=UNKNOWN [10046][HY000] Invalid authentication mechanism UNKNOWN ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-key=%s&auth=SHA256_MEMORY +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-key=%s&auth=SHA256_MEMORY ---------------------- -mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@localhost:%s/?ssl-key=%s&auth=SHA256_MEMORY +mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@%S:%s/?ssl-key=%s&auth=SHA256_MEMORY -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) in %s -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) in %s +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-key=%s&auth=sha256_memory +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-key=%s&auth=sha256_memory ---------------------- -mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@localhost:%s/?ssl-key=%s&auth=sha256_memory +mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@%S:%s/?ssl-key=%s&auth=sha256_memory -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) in %s -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) in %s +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) ---------------------- done!%A diff --git a/tests/auth/warnings_secure_native.phpt b/tests/auth/warnings_secure_native.phpt index 92801bfd..45b3f92b 100644 --- a/tests/auth/warnings_secure_native.phpt +++ b/tests/auth/warnings_secure_native.phpt @@ -30,30 +30,30 @@ print "done!\n"; clean_test_db(); ?> --EXPECTF-- -mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@localhost:%s/?ssl-key=%s&auth=sha256_memory +mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@%S:%s/?ssl-key=%s&auth=sha256_memory -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'localhost' (using password: YES) in %s -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'%S' (using password: YES) in %s +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@localhost:%s/?ssl-key=%s&auth=unknown +mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@%S:%s/?ssl-key=%s&auth=unknown [10046][HY000] Invalid authentication mechanism unknown ---------------------- -mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@localhost:%s/?ssl-key=%s +mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@%S:%s/?ssl-key=%s -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) in %s -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) in %s +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@localhost:%s/?ssl-key=%s&auth=mysql41 +mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@%S:%s/?ssl-key=%s&auth=mysql41 -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) in %s -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) in %s +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@localhost:%s/?ssl-key=%s&auth=plain +mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@%S:%s/?ssl-key=%s&auth=plain -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) in %s -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) in %s +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@localhost:%s/?ssl-key=%s&auth=external +mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@%S:%s/?ssl-key=%s&auth=external Warning: mysql_xdevapi\getSession(): [1251][HY000] Invalid authentication method EXTERNAL in %s %A [1251][HY000] Invalid authentication method EXTERNAL diff --git a/tests/auth/warnings_unsecure_caching_sha2.phpt b/tests/auth/warnings_unsecure_caching_sha2.phpt index 1e9f622e..1a295e25 100644 --- a/tests/auth/warnings_unsecure_caching_sha2.phpt +++ b/tests/auth/warnings_unsecure_caching_sha2.phpt @@ -38,46 +38,46 @@ print "done!\n"; clean_test_db(); ?> --EXPECTF-- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-mode=disabled +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-mode=disabled Warning: mysql_xdevapi\getSession(): [10054][HY000] Authentication failure. Authentication failed using MYSQL41, SHA256_MEMORY. Check username and password or try a secure connection in %s on line %d [10054][HY000] Authentication failure. Authentication failed using MYSQL41, SHA256_MEMORY. Check username and password or try a secure connection ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-mode=disabled&auth=MYSQL41 +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-mode=disabled&auth=MYSQL41 -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) in %s on line %d -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) in %s on line %d +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-mode=disabled&auth=SHA256_MEMORY +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-mode=disabled&auth=SHA256_MEMORY -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) in %s on line %d -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) in %s on line %d +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_sha2'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-mode=disabled&auth=PLAIN +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-mode=disabled&auth=PLAIN Warning: mysql_xdevapi\getSession(): [1251][HY000] Invalid authentication method PLAIN in %s on line %d [1251][HY000] Invalid authentication method PLAIN ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-mode=disabled&auth=EXTERNAL +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-mode=disabled&auth=EXTERNAL Warning: mysql_xdevapi\getSession(): [1251][HY000] Invalid authentication method EXTERNAL in %s on line %d [1251][HY000] Invalid authentication method EXTERNAL ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-mode=disabled&auth=UNSUPPORTED +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-mode=disabled&auth=UNSUPPORTED [10046][HY000] Invalid authentication mechanism UNSUPPORTED ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-mode=disabled&auth=SHA256_MEMORY +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-mode=disabled&auth=SHA256_MEMORY ---------------------- -mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@localhost:%s/?ssl-mode=disabled&auth=SHA256_MEMORY +mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@%S:%s/?ssl-mode=disabled&auth=SHA256_MEMORY -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) in %s on line %d -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) in %s on line %d +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@localhost:%s/?ssl-mode=disabled&auth=sha256_memory +mysqlx://mysql_xdevapi_test_user_sha2:mysql_xdevapi_test_user_sha2_password@%S:%s/?ssl-mode=disabled&auth=sha256_memory ---------------------- -mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@localhost:%s/?ssl-mode=disabled&auth=sha256_memory +mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@%S:%s/?ssl-mode=disabled&auth=sha256_memory -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) in %s on line %d -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) in %s on line %d +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) ---------------------- done!%A diff --git a/tests/auth/warnings_unsecure_native.phpt b/tests/auth/warnings_unsecure_native.phpt index 29a230fa..8090e34b 100644 --- a/tests/auth/warnings_unsecure_native.phpt +++ b/tests/auth/warnings_unsecure_native.phpt @@ -29,32 +29,32 @@ print "done!\n"; clean_test_db(); ?> --EXPECTF-- -mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@localhost:%s/?ssl-mode=disabled&auth=sha256_memory +mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@%S:%s/?ssl-mode=disabled&auth=sha256_memory -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'localhost' (using password: YES) in %s on line %d -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'%S' (using password: YES) in %s on line %d +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_native'@'%S' (using password: YES) ---------------------- -mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@localhost:%s/?ssl-mode=disabled&auth=plain +mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@%S:%s/?ssl-mode=disabled&auth=plain Warning: mysql_xdevapi\getSession(): [1251][HY000] Invalid authentication method PLAIN in %s on line %d [1251][HY000] Invalid authentication method PLAIN ---------------------- -mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@localhost:%s/?ssl-mode=disabled&auth=external +mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@%S:%s/?ssl-mode=disabled&auth=external Warning: mysql_xdevapi\getSession(): [1251][HY000] Invalid authentication method EXTERNAL in %s on line %d [1251][HY000] Invalid authentication method EXTERNAL ---------------------- -mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@localhost:%s/?ssl-mode=disabled&auth=unsupported +mysqlx://mysql_xdevapi_test_user_native:mysql_xdevapi_test_user_native_password@%S:%s/?ssl-mode=disabled&auth=unsupported [10046][HY000] Invalid authentication mechanism unsupported ---------------------- -mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@localhost:%s/?ssl-mode=disabled +mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@%S:%s/?ssl-mode=disabled Warning: mysql_xdevapi\getSession(): [10054][HY000] Authentication failure. Authentication failed using MYSQL41, SHA256_MEMORY. Check username and password or try a secure connection in %s on line %d [10054][HY000] Authentication failure. Authentication failed using MYSQL41, SHA256_MEMORY. Check username and password or try a secure connection ---------------------- -mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@localhost:%s/?ssl-mode=disabled&auth=mysql41 +mysqlx://mysql_xdevapi_test_user_unknown:mysql_xdevapi_test_user_unknown_password@%S:%s/?ssl-mode=disabled&auth=mysql41 -Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) in %s on line %d -[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'localhost' (using password: YES) +Warning: mysql_xdevapi\getSession(): [1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) in %s on line %d +[1045][HY000] Access denied for user 'mysql_xdevapi_test_user_unknown'@'%S' (using password: YES) ---------------------- done!%A From 3da439e6d20e18ce38dfe16618ac0e30c5edacd1 Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Tue, 12 Jul 2022 12:21:21 +0200 Subject: [PATCH 09/15] tests: Avoid loading already loaded plugins for workers. If the PHP used to run workes has a dynamic plugin loaded (because of its configuration) the old code would still append `-d extension=...` options and made the worker instance generate warnings which confuses communitcation with the worker. --- tests/worker_utils.inc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/worker_utils.inc b/tests/worker_utils.inc index 411d0182..1ee56e5f 100644 --- a/tests/worker_utils.inc +++ b/tests/worker_utils.inc @@ -62,10 +62,19 @@ function prepare_worker_cmdline($worker_path) { } $worker_cmd .= " -d extension_dir=".resolve_extension_dir(); - if (!is_mysql_xdevapi_builtin()) { + + /* + Note: Here we use the fact that PHP binary used to run the worker + is the same as PHP that runs this test (and with the same + configuration). Hence if one of the plugins is loaded into this + PHP instance it should be also loaded in the instance running the + worker. + */ + + if (!extension_loaded('mysql_xdevapi')) { $worker_cmd .= " -d extension=".prepare_mysql_xdevapi_ext_filename(); } - if (!is_openssl_builtin()) { + if (!extension_loaded('openssl')) { $worker_cmd .= " -d extension=".prepare_openssl_ext_filename(); } From 12ef3d7cfdfc5f645b0dece76390fc20ca276f10 Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Tue, 12 Jul 2022 12:25:23 +0200 Subject: [PATCH 10/15] tests: Fix test user creation. The IP of the host of connecting user seen by the server can be different from the one on the host where tests are run. For example, this is the case when the test server runs inside a container. Therefore we create test user with generic host pattern `%` . --- tests/auth/auth_utils.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auth/auth_utils.inc b/tests/auth/auth_utils.inc index c4733049..614d1c95 100644 --- a/tests/auth/auth_utils.inc +++ b/tests/auth/auth_utils.inc @@ -13,7 +13,7 @@ function get_test_user_passwd($user) { function drop_test_user($user) { global $host; $session = create_test_session(); - $query = "DROP USER IF EXISTS '$user'@'$host'"; + $query = "DROP USER IF EXISTS '$user'@'%'"; $session->sql($query)->execute(); } @@ -21,7 +21,7 @@ function create_test_user($user, $auth_plugin) { global $host; $session = create_test_session(); $password = get_test_user_passwd($user); - $query = "CREATE USER '$user'@'$host' IDENTIFIED WITH '$auth_plugin' BY '$password'"; + $query = "CREATE USER '$user'@'%' IDENTIFIED WITH '$auth_plugin' BY '$password'"; $session->sql($query)->execute(); } From 8cc9a136d9e9b8276ff5505e5ee9d546e698784e Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Tue, 12 Jul 2022 12:29:44 +0200 Subject: [PATCH 11/15] tests: Disable failing tests that need to be fixed. --- tests/auth/secure_connection_options.phpt | 9 +++++++++ tests/connection_test_uri_string.phpt | 4 ++++ tests/simple_ssl.phpt | 5 ++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/auth/secure_connection_options.phpt b/tests/auth/secure_connection_options.phpt index 88ca147f..e45dcdd1 100644 --- a/tests/auth/secure_connection_options.phpt +++ b/tests/auth/secure_connection_options.phpt @@ -8,6 +8,15 @@ default_socket_timeout=4 --INI-- error_reporting=0 default_socket_timeout=1 diff --git a/tests/simple_ssl.phpt b/tests/simple_ssl.phpt index 35bc56b7..8f6b8215 100644 --- a/tests/simple_ssl.phpt +++ b/tests/simple_ssl.phpt @@ -28,7 +28,10 @@ mysqlx simple SSL connection $res = $session->sql('SELECT USER()')->execute(); $userdata = $res->fetchOne(); - expect_eq($userdata['USER()'], $user.'@'.$host); + // FIXME: + // - fails when DNS hostname is converted to IP address + // - fails when test server runs inside docker + // expect_eq($userdata['USER()'], $user.'@'.$host); verify_expectations(); print "done!\n"; ?> From 6f0091931d8a0a497fa8d48312f3fca78bae7405 Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Thu, 14 Jul 2022 09:45:27 +0200 Subject: [PATCH 12/15] bug#34332205 - follow up Update function parameter checks that are performed when building in dev-mode to accept "!" in type specifications. --- util/functions.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/functions.cc b/util/functions.cc index cc9c52c3..e045ddf2 100644 --- a/util/functions.cc +++ b/util/functions.cc @@ -252,7 +252,7 @@ void Verify_call_parameters::validate_type_spec(const Type_spec& type_specificat / next param gets separated if not reference ! Next param returns NULL if param type IS_NULL */ - const util::string allowed_types{ "ldbahoOsz" }; + const util::string allowed_types{ "ldbahoOsz!" }; const std::size_t disallowed_type_idx{ type_specification.args.find_first_not_of(allowed_types) }; if (disallowed_type_idx != util::string::npos) { From 6cdca18cb2eeb3f46ab5efce01208303a59affbb Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Thu, 14 Jul 2022 11:46:43 +0200 Subject: [PATCH 13/15] bug#34332205 - follow up #2 Turns out that verifying type specs that include "!" requires more changes to the code. For now disabling checks if type spec contains "!". --- util/functions.cc | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/util/functions.cc b/util/functions.cc index e045ddf2..a1e90e08 100644 --- a/util/functions.cc +++ b/util/functions.cc @@ -115,7 +115,7 @@ class Verify_call_parameters void run(); private: - void extract_type_spec_fragments( + bool extract_type_spec_fragments( util::string* required_args, util::string* optional_args); Type_spec create_type_spec(const util::string& raw_args); @@ -160,7 +160,16 @@ void Verify_call_parameters::run() { util::string required_args; util::string optional_args; - extract_type_spec_fragments(&required_args, &optional_args); + + /* + Skip verification if extract_type_spec_fragments() detects a type + specification that we can not handle (yet). + + FIXME: We should be able to handle all type specifications. + */ + + if (!extract_type_spec_fragments(&required_args, &optional_args)) + return; Type_spec type_spec_required_args{ create_type_spec(required_args) }; validate_type_spec(type_spec_required_args); @@ -174,13 +183,26 @@ void Verify_call_parameters::run() verify_optional_args_count(type_spec_optional_args); } -void Verify_call_parameters::extract_type_spec_fragments( +/* + Returns false if type specification can not be handled by our checker. For + now this is the case when type specification contains nullable parameters. + + FIXME: Correctly handle nullable parameters (bug#34384368) +*/ + +bool Verify_call_parameters::extract_type_spec_fragments( util::string* required_args, util::string* optional_args) { bool separator_found{ false }; const char Optional_args_separator{ '|' }; + const char Nullable_arg_specifier{ '!' }; + for( size_t i { 0 } ; i < type_spec.size(); ++i ) { + + if( type_spec[i] == Nullable_arg_specifier) + return false; + if( type_spec[i] == Optional_args_separator ) { if( separator_found ) { throw verify_error("only one optional args block is allowed"); @@ -193,6 +215,8 @@ void Verify_call_parameters::extract_type_spec_fragments( if( !separator_found ) { *required_args = type_spec; } + + return true; } Type_spec Verify_call_parameters::create_type_spec(const util::string& raw_args) From b1375af988ffd2fbf104155b53bf0c4d8d77d0f5 Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Thu, 14 Jul 2022 13:03:48 +0200 Subject: [PATCH 14/15] Update version to 8.0.30 - missing bits --- php_mysql_xdevapi.h | 4 ++-- xmysqlnd/xmysqlnd.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/php_mysql_xdevapi.h b/php_mysql_xdevapi.h index dc570cad..56a01ac9 100644 --- a/php_mysql_xdevapi.h +++ b/php_mysql_xdevapi.h @@ -18,8 +18,8 @@ #ifndef PHP_MYSQL_XDEVAPI_H #define PHP_MYSQL_XDEVAPI_H -#define PHP_MYSQL_XDEVAPI_VERSION "8.0.29" -#define MYSQL_XDEVAPI_VERSION_ID 80029 +#define PHP_MYSQL_XDEVAPI_VERSION "8.0.30" +#define MYSQL_XDEVAPI_VERSION_ID 80030 #define PHP_MYSQL_XDEVAPI_LICENSE "PHP License, version 3.01" #define PHP_MYSQL_XDEVAPI_NAME "mysql-connector-php" diff --git a/xmysqlnd/xmysqlnd.h b/xmysqlnd/xmysqlnd.h index 7eaa4bd0..b7e5d7c9 100644 --- a/xmysqlnd/xmysqlnd.h +++ b/xmysqlnd/xmysqlnd.h @@ -18,8 +18,8 @@ #ifndef XMYSQLND_H #define XMYSQLND_H -#define PHP_XMYSQLND_VERSION "mysql_xdevapi 8.0.29" -#define XMYSQLND_VERSION_ID 80029 +#define PHP_XMYSQLND_VERSION "mysql_xdevapi 8.0.30" +#define XMYSQLND_VERSION_ID 80030 #if PHP_DEBUG #define MYSQLND_DBG_ENABLED 1 From 41f52fbca6acce68780b66efca4a75815b548661 Mon Sep 17 00:00:00 2001 From: Rafal Somla Date: Tue, 19 Jul 2022 15:22:02 +0200 Subject: [PATCH 15/15] config.m4: Force c++17 also for aoutoconf checks Without this checks for, e.g., boost headers were failing on macOS (could be specific to clang which is used on macOS). --- config.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.m4 b/config.m4 index fdaecf84..56129b39 100644 --- a/config.m4 +++ b/config.m4 @@ -332,7 +332,10 @@ if test "$PHP_MYSQL_XDEVAPI" != "no" || test "$PHP_MYSQL_XDEVAPI_ENABLED" == "ye PHP_REQUIRE_CXX AC_LANG([C++]) - MYSQL_XDEVAPI_CXXFLAGS="-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -std=c++17 \ + dnl Note: we need to enable c++17 also for autoconf tests etc. + CXX="$CXX --std=c++17" + + MYSQL_XDEVAPI_CXXFLAGS="-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 \ -Wall -Wno-unused-function -Wformat-security -Wformat-extra-args" if test "$PHP_DEV_MODE" == "yes" || test "$PHP_DEV_MODE_ENABLED" == "yes"; then