diff options
author | Dharman <tekiela246@gmail.com> | 2021-03-12 22:02:36 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-15 10:24:42 +0100 |
commit | 321e0d451dbe35de292e0884e9015a18f5a98741 (patch) | |
tree | cb3acbbb1e4d61c824f34c2bc55480390cf31b89 | |
parent | d4530f807a78d50c2f5fd66114632480e7651d31 (diff) | |
download | php-git-321e0d451dbe35de292e0884e9015a18f5a98741.tar.gz |
client_info is a constant and doesn't need a connection
Closes GH-6767.
-rw-r--r-- | ext/mysqli/mysqli_prop.c | 1 | ||||
-rw-r--r-- | ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt | 18 | ||||
-rw-r--r-- | ext/mysqli/tests/mysqli_real_connect.phpt | 2 |
3 files changed, 9 insertions, 12 deletions
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index f1ed103001..a00346ffcd 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -119,7 +119,6 @@ static int link_client_version_read(mysqli_object *obj, zval *retval, bool quiet /* {{{ property link_client_info_read */ static int link_client_info_read(mysqli_object *obj, zval *retval, bool quiet) { - CHECK_STATUS(MYSQLI_STATUS_INITIALIZED, quiet); ZVAL_STRING(retval, MYSQL_SERVER_VERSION); return SUCCESS; diff --git a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt index 651520b70a..d44b349557 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt @@ -45,11 +45,7 @@ require_once('skipifconnectfailure.inc'); echo $exception->getMessage() . "\n"; } - try { - $mysqli->client_info; - } catch (Error $exception) { - echo $exception->getMessage() . "\n"; - } + printf("mysqli->client_info = '%s'/%s\n", $mysqli->client_info, gettype($mysqli->client_info)); printf("mysqli->client_version = '%s'/%s\n", $mysqli->client_version, gettype($mysqli->client_version)); @@ -242,7 +238,7 @@ Without RS Class variables: Property access is not allowed yet -Property access is not allowed yet +client_info = '%s' client_version = '%s' connect_errno = '%s' connect_error = ''%s' @@ -262,7 +258,7 @@ mysqli object is already closed Object variables: Property access is not allowed yet -Property access is not allowed yet +client_info = '%s' client_version = '%s' connect_errno = '%s' connect_error = ''%s' @@ -283,7 +279,7 @@ mysqli object is already closed Magic, magic properties: mysqli object is already closed Property access is not allowed yet -Property access is not allowed yet +mysqli->client_info = '%s'/string mysqli->client_version = '%d'/integer mysqli object is already closed mysqli object is already closed @@ -324,7 +320,7 @@ mysqli object is already closed Class variables: Property access is not allowed yet -Property access is not allowed yet +client_info = '%s' client_version = '%s' connect_errno = '%s' connect_error = '%s' @@ -344,7 +340,7 @@ mysqli object is already closed Object variables: Property access is not allowed yet -Property access is not allowed yet +client_info = '%s' client_version = '%s' connect_errno = '%s' connect_error = '%s' @@ -365,7 +361,7 @@ mysqli object is already closed Magic, magic properties: mysqli object is already closed Property access is not allowed yet -Property access is not allowed yet +mysqli->client_info = '%s'/string mysqli->client_version = '%d'/integer mysqli object is already closed mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_real_connect.phpt b/ext/mysqli/tests/mysqli_real_connect.phpt index f580037844..5a16863780 100644 --- a/ext/mysqli/tests/mysqli_real_connect.phpt +++ b/ext/mysqli/tests/mysqli_real_connect.phpt @@ -154,6 +154,8 @@ mysqli.allow_local_infile=1 --EXPECTF-- Warning: mysqli_real_connect(): (%s/%d): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d object(mysqli)#%d (%d) { + ["client_info"]=> + string(%d) "%s" ["client_version"]=> int(%d) ["connect_errno"]=> |