]> granicus.if.org Git - php/commitdiff
client_info is a constant and doesn't need a connection
authorDharman <tekiela246@gmail.com>
Fri, 12 Mar 2021 22:02:36 +0000 (22:02 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 15 Mar 2021 09:24:42 +0000 (10:24 +0100)
Closes GH-6767.

ext/mysqli/mysqli_prop.c
ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt
ext/mysqli/tests/mysqli_real_connect.phpt

index f1ed103001daa91258571fe9d1d000a069729d9f..a00346ffcd9a70a858cfa16f4cc3f178f3fda057 100644 (file)
@@ -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;
index 651520b70a5987b85d2fe879c481e8ca2f976ddc..d44b34955799603ce2d0da323315227a5ef996dc 100644 (file)
@@ -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
index f58003784411fc19336ed77477d2f54f7316b2ab..5a1686378036946080df2638ace421eaff1dca8d 100644 (file)
@@ -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"]=>