diff --git a/config.m4 b/config.m4 index e96b9703..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 @@ -455,14 +458,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() 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)) { 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/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 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/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(); } 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 --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 b5544864..557b0f18 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@%S/?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@%S: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@%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://testuser:testpasswd@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://testuser:testpasswd@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://testuser:testpasswd@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://testuser:testpasswd@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://testuser:testpasswd@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://testuser:testpasswd@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://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@%S/?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@%S: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@%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://testuser:testpasswd@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://testuser:testpasswd@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://testuser:testpasswd@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://testuser:testpasswd@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://testuser:testpasswd@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://testuser:testpasswd@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 2ad54587..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://testuser:testpasswd@127.0.0.1:%d/?connect-timeout=4 +mysqlx://%s:%S@%S:%d/?connect-timeout=4 ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1:%d +mysqlx://%s:%S@%S:%d ---------------------- -mysqlx://testuser:testpasswd@127.0.0.1:%d/?connect-timeout=0 +mysqlx://%s:%S@%S:%d/?connect-timeout=0 ---------------------- -mysqlx://testuser:testpasswd@localhost:%d/?connect-timeout=7 +mysqlx://%s:%S@%S:%d/?connect-timeout=7 ---------------------- -mysqlx://testuser:testpasswd@localhost:%d +mysqlx://%s:%S@%S:%d ---------------------- -mysqlx://testuser:testpasswd@localhost:%d/?connect-timeout=0 +mysqlx://%s:%S@%S:%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; 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 diff --git a/tests/connection_test_uri_string.phpt b/tests/connection_test_uri_string.phpt index d47031c4..4a49a5f6 100644 --- a/tests/connection_test_uri_string.phpt +++ b/tests/connection_test_uri_string.phpt @@ -1,6 +1,10 @@ --TEST-- mysqlx connection test / URI string --SKIPIF-- + --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"; ?> 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(); } diff --git a/util/functions.cc b/util/functions.cc index cc9c52c3..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) @@ -252,7 +276,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) { 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. */ 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 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; } 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) {