]> granicus.if.org Git - php/commitdiff
MFT: Added 'db' and 'catalog' keys to the field fetching functions (FR #39847)
authorKalle Sommer Nielsen <kalle@php.net>
Mon, 17 Jan 2011 11:20:54 +0000 (11:20 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Mon, 17 Jan 2011 11:20:54 +0000 (11:20 +0000)
12 files changed:
NEWS
ext/mysqli/mysqli_api.c
ext/mysqli/tests/047.phpt
ext/mysqli/tests/mysqli_fetch_field.phpt
ext/mysqli/tests/mysqli_fetch_field_direct.phpt
ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt
ext/mysqli/tests/mysqli_fetch_field_oo.phpt
ext/mysqli/tests/mysqli_fetch_fields.phpt
ext/mysqli/tests/mysqli_field_seek.phpt
ext/mysqli/tests/mysqli_field_tell.phpt
ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt
ext/mysqli/tests/mysqli_stmt_result_metadata.phpt

diff --git a/NEWS b/NEWS
index c1fce02078779c7549a067b74031f6c7693d0e76..3925767bbc08f0a28c5c784a9b34c8ef9da2696b 100644 (file)
--- a/NEWS
+++ b/NEWS
     (Stas).
 
 - MySQL Improved extension:
+  . Added 'db' and 'catalog' keys to the field fetching functions (FR #39847). 
+    (Kalle)
   . Fixed bug #53503 (mysqli::query returns false after successful LOAD DATA 
     query). (Kalle, Andrey)
   . Fixed bug #53425 (mysqli_real_connect() ignores client flags when built to 
     call libmysql). (Kalle, tre-php-net at crushedhat dot com)
   . Fixed buggy counting of affected rows when using the text protocol. The
-    collected statistics were wrong when multi_query was used with mysqlnd.
-       (Andrey)
+    collected statistics were wrong when multi_query was used with mysqlnd
+    (Andrey)
 
 - OpenSSL extension:
   . Implemented FR #53447 (Cannot disable SessionTicket extension for servers
index 5c8507c4a598030b662b37caefd3224c5977a6f5..7e28cce2691ec8fef80809246fcd251558e2ae1b 100644 (file)
@@ -1052,6 +1052,8 @@ static void php_add_field_properties(zval *value, const MYSQL_FIELD *field TSRML
        add_property_string(value, "table", (char *) (field->table ? field->table : ""), 1);
        add_property_string(value, "orgtable", (char *) (field->org_table ? field->org_table : ""), 1);
        add_property_string(value, "def", (field->def ? field->def : ""), 1);
+       add_property_string(value, "db", (field->db ? field->db : ""), 1);
+       add_property_string(value, "catalog", (field->catalog ? field->catalog : ""), 1);
 
        add_property_long(value, "max_length", field->max_length);
        add_property_long(value, "length", field->length);
index 65c951c0802713872dbe5f658a53d14af719ab95..3e48f0e343f6c25e2b0b6c0369073ff7fb23ab00 100644 (file)
@@ -60,7 +60,7 @@ mysqli_close($link);
 === fetch_fields ===
 array(2) {
   [0]=>
-  object(stdClass)#5 (11) {
+  object(stdClass)#5 (13) {
     [%u|b%"name"]=>
     %unicode|string%(3) "foo"
     [%u|b%"orgname"]=>
@@ -71,6 +71,10 @@ array(2) {
     %unicode|string%(13) "test_affected"
     [%u|b%"def"]=>
     %unicode|string%(0) ""
+    [%u|b%"db"]=>
+    %unicode|string%(4) "test"
+    [%u|b%"catalog"]=>
+    %unicode|string%(3) "def"
     [%u|b%"max_length"]=>
     int(0)
     [%u|b%"length"]=>
@@ -85,7 +89,7 @@ array(2) {
     int(0)
   }
   [1]=>
-  object(stdClass)#6 (11) {
+  object(stdClass)#6 (13) {
     [%u|b%"name"]=>
     %unicode|string%(3) "bar"
     [%u|b%"orgname"]=>
@@ -96,6 +100,10 @@ array(2) {
     %unicode|string%(13) "test_affected"
     [%u|b%"def"]=>
     %unicode|string%(0) ""
+    [%u|b%"db"]=>
+    %unicode|string%(4) "test"
+    [%u|b%"catalog"]=>
+    %unicode|string%(3) "def"
     [%u|b%"max_length"]=>
     int(0)
     [%u|b%"length"]=>
@@ -112,7 +120,7 @@ array(2) {
 }
 
 === fetch_field_direct ===
-object(stdClass)#6 (11) {
+object(stdClass)#6 (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "foo"
   [%u|b%"orgname"]=>
@@ -123,6 +131,10 @@ object(stdClass)#6 (11) {
   %unicode|string%(13) "test_affected"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
@@ -136,7 +148,7 @@ object(stdClass)#6 (11) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#6 (11) {
+object(stdClass)#6 (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "bar"
   [%u|b%"orgname"]=>
@@ -147,6 +159,10 @@ object(stdClass)#6 (11) {
   %unicode|string%(13) "test_affected"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
@@ -162,7 +178,7 @@ object(stdClass)#6 (11) {
 }
 
 === fetch_field ===
-object(stdClass)#6 (11) {
+object(stdClass)#6 (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "foo"
   [%u|b%"orgname"]=>
@@ -173,6 +189,10 @@ object(stdClass)#6 (11) {
   %unicode|string%(13) "test_affected"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
@@ -186,7 +206,7 @@ object(stdClass)#6 (11) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#5 (11) {
+object(stdClass)#5 (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "bar"
   [%u|b%"orgname"]=>
@@ -197,6 +217,10 @@ object(stdClass)#5 (11) {
   %unicode|string%(13) "test_affected"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
index 4dde6c9aaf33632944f920a420bd3696447abc9d..92c1e648aa985731f1f87ea9cf254c4e43eb31b8 100644 (file)
@@ -79,7 +79,7 @@ require_once('skipifconnectfailure.inc');
        require_once("clean_table.inc");
 ?>
 --EXPECTF--
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -90,6 +90,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(1)
   [%u|b%"length"]=>
@@ -103,7 +107,7 @@ object(stdClass)#%d (11) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -114,6 +118,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(%d)
   [%u|b%"length"]=>
@@ -134,7 +142,7 @@ array(1) {
   [%u|b%"_default_test"]=>
   %unicode|string%(1) "2"
 }
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(13) "_default_test"
   [%u|b%"orgname"]=>
@@ -145,6 +153,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(1)
   [%u|b%"length"]=>
index 33c5a0cf30837a8bdd28927bd967bc304dc3f00b..bfccea657c12b15a92849c26d21ac75c7e54fb9a 100644 (file)
@@ -47,7 +47,7 @@ require_once('skipifconnectfailure.inc');
 --EXPECTF--
 Warning: mysqli_fetch_field_direct(): Field offset is invalid for resultset in %s on line %d
 bool(false)
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -58,6 +58,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(%d)
   [%u|b%"length"]=>
index 23d46f3092245cf8e38aac979659dd47d841cc35..b52401b66d93ac36c6eb8d43319a1bcf6a1ecbb9 100644 (file)
@@ -56,7 +56,7 @@ require_once('skipifconnectfailure.inc');
 --EXPECTF--
 Warning: mysqli_result::fetch_field_direct(): Field offset is invalid for resultset in %s on line %d
 bool(false)
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -67,6 +67,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(%d)
   [%u|b%"length"]=>
index 0130f0e7f28e9b082a32af69d6ec5d8529ec2f40..ad13d46816947674dcff3024cb750c5a5f363141 100644 (file)
@@ -63,7 +63,7 @@ require_once('skipifconnectfailure.inc');
        require_once("clean_table.inc");
 ?>
 --EXPECTF--
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -74,6 +74,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(1)
   [%u|b%"length"]=>
@@ -87,7 +91,7 @@ object(stdClass)#%d (11) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -98,6 +102,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(%d)
   [%u|b%"length"]=>
index 885c7338b57cf63bb64f742b52be58b12297519a..1426bb325f10cc191c32d98534ef7322c78e4648 100644 (file)
@@ -60,7 +60,7 @@ require_once('skipifconnectfailure.inc');
        require_once("clean_table.inc");
 ?>
 --EXPECTF--
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -71,6 +71,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(1)
   [%u|b%"length"]=>
@@ -84,7 +88,7 @@ object(stdClass)#%d (11) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -95,6 +99,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(1)
   [%u|b%"length"]=>
index 1da42c28336c66a5f26ef9f7848272fdc3d2a232..ee6e11cff9603427fe226b928872c2c1f863f1cf 100644 (file)
@@ -122,7 +122,7 @@ require_once('skipifconnectfailure.inc');
 --EXPECTF--
 Warning: mysqli_field_seek(): Invalid field offset in %s on line %d
 bool(false)
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -133,6 +133,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
@@ -147,7 +151,7 @@ object(stdClass)#%d (11) {
   int(0)
 }
 bool(true)
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -158,6 +162,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
@@ -172,7 +180,7 @@ object(stdClass)#%d (11) {
   int(0)
 }
 bool(true)
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -183,6 +191,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(%d)
   [%u|b%"length"]=>
@@ -205,7 +217,7 @@ bool(false)
 Warning: mysqli_field_seek(): Invalid field offset in %s on line %d
 bool(false)
 bool(true)
-object(stdClass)#3 (11) {
+object(stdClass)#3 (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "_null"
   [%u|b%"orgname"]=>
@@ -216,6 +228,10 @@ object(stdClass)#3 (11) {
   %unicode|string%(0) ""
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(0) ""
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
index f1e43c4912af6fb649a79e7e485c60cacd903aa0..a31b93529a33ddc96d87083f5b7e8cfaf1447b5b 100644 (file)
@@ -64,7 +64,7 @@ int(0)
 Warning: mysqli_field_seek() expects exactly 2 parameters, 1 given in %s on line %d
 NULL
 int(0)
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -75,6 +75,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
index 23d045a22beadfc53974656a4d4ad57c437ba076..1c2b49d1694830ac829bf942fe48689fdf9b6c6f 100644 (file)
@@ -61,7 +61,7 @@ if (!function_exists('mysqli_stmt_get_result'))
        require_once("clean_table.inc");
 ?>
 --EXPECTF--
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -72,6 +72,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
@@ -85,7 +89,7 @@ object(stdClass)#%d (11) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -96,6 +100,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(%d)
   [%u|b%"length"]=>
@@ -109,7 +117,7 @@ object(stdClass)#%d (11) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "_id"
   [%u|b%"orgname"]=>
@@ -120,6 +128,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(0) ""
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(0) ""
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>
@@ -133,7 +145,7 @@ object(stdClass)#%d (11) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (11) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(8) "___label"
   [%u|b%"orgname"]=>
@@ -144,6 +156,10 @@ object(stdClass)#%d (11) {
   %unicode|string%(0) ""
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(0) ""
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(%d)
   [%u|b%"length"]=>
index f9fd3cf3caf1589287e66de0f3dbe6ca0624f280..bd742a2163f3a7181016b864093e5f7d7fc576ff 100644 (file)
@@ -101,7 +101,7 @@ require_once('skipifconnectfailure.inc');
 
 Warning: mysqli_stmt_result_metadata(): invalid object or resource mysqli_stmt
  in %s on line %d
-object(stdClass)#5 (%d) {
+object(stdClass)#5 (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -112,6 +112,10 @@ object(stdClass)#5 (%d) {
   %unicode|string%(4) "test"
   [%u|b%"def"]=>
   %unicode|string%(0) ""
+  [%u|b%"db"]=>
+  %unicode|string%(4) "test"
+  [%u|b%"catalog"]=>
+  %unicode|string%(3) "def"
   [%u|b%"max_length"]=>
   int(0)
   [%u|b%"length"]=>