]> granicus.if.org Git - php/commitdiff
Added 'catalog' to the field fetching functions in mysqli (Thanks to Johannes for...
authorKalle Sommer Nielsen <kalle@php.net>
Mon, 17 Jan 2011 10:43:53 +0000 (10:43 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Mon, 17 Jan 2011 10:43:53 +0000 (10:43 +0000)
13 files changed:
NEWS
UPGRADING
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 d3c77e733bdded483402b9911e7b82ad14316c59..21e21001944c496302ee0d18376291aec4b6391b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -162,8 +162,6 @@ PHP                                                                        NEWS
   . mysqlnd: Added named pipes support. FR #48082. (Andrey)
   . MySQLi: Added iterator support in MySQLi. mysqli_result implements 
     Traversable. (Andrey, Johannes)
-  . MySQLi: Implemented FR #39847 (mysqli_fetch_[field|fields|field_direct] 
-    need to return db). (Kalle)
   . PDO_mysql: Removed support for linking with MySQL client libraries older
     than 4.1. (Johannes)
 
index ed510094e05fe07ee3b8b34c6e4f5812c9e34570..4cd1749b0fcce42cd365393a460ef03b4f2ac3e1 100755 (executable)
--- a/UPGRADING
+++ b/UPGRADING
@@ -161,8 +161,6 @@ UPGRADE NOTES - PHP X.Y
   strings. This breaks code that iterated the resulting stream array using a
   numeric index, but makes easier to identify which of the passed streams are
   present in the result.
-- mysqli_fetch_[field|fields|field_direct] now returns an additional property 
-  named 'db' that contains the database name of the associated result.
  
 
 ===================================
index 724c1e0ab247b921ec21d5a8506291c5b2912991..e5fc756a3778aec48c005e8aceb04f44b52416dd 100644 (file)
@@ -1057,6 +1057,7 @@ static void php_add_field_properties(zval *value, const MYSQL_FIELD *field TSRML
        add_property_string(value, "orgtable",(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 e6dce51863c4716a3b4b81688b66c9fa422eb7b0..3e48f0e343f6c25e2b0b6c0369073ff7fb23ab00 100644 (file)
@@ -60,7 +60,7 @@ mysqli_close($link);
 === fetch_fields ===
 array(2) {
   [0]=>
-  object(stdClass)#5 (12) {
+  object(stdClass)#5 (13) {
     [%u|b%"name"]=>
     %unicode|string%(3) "foo"
     [%u|b%"orgname"]=>
@@ -73,6 +73,8 @@ array(2) {
     %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"]=>
@@ -87,7 +89,7 @@ array(2) {
     int(0)
   }
   [1]=>
-  object(stdClass)#6 (12) {
+  object(stdClass)#6 (13) {
     [%u|b%"name"]=>
     %unicode|string%(3) "bar"
     [%u|b%"orgname"]=>
@@ -100,6 +102,8 @@ array(2) {
     %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"]=>
@@ -116,7 +120,7 @@ array(2) {
 }
 
 === fetch_field_direct ===
-object(stdClass)#6 (12) {
+object(stdClass)#6 (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "foo"
   [%u|b%"orgname"]=>
@@ -129,6 +133,8 @@ object(stdClass)#6 (12) {
   %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"]=>
@@ -142,7 +148,7 @@ object(stdClass)#6 (12) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#6 (12) {
+object(stdClass)#6 (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "bar"
   [%u|b%"orgname"]=>
@@ -155,6 +161,8 @@ object(stdClass)#6 (12) {
   %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"]=>
@@ -170,7 +178,7 @@ object(stdClass)#6 (12) {
 }
 
 === fetch_field ===
-object(stdClass)#6 (12) {
+object(stdClass)#6 (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "foo"
   [%u|b%"orgname"]=>
@@ -183,6 +191,8 @@ object(stdClass)#6 (12) {
   %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"]=>
@@ -196,7 +206,7 @@ object(stdClass)#6 (12) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#5 (12) {
+object(stdClass)#5 (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "bar"
   [%u|b%"orgname"]=>
@@ -209,6 +219,8 @@ object(stdClass)#5 (12) {
   %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 571a28b7a589e95b7a7c5251ee7c38c93c70ba3d..92c1e648aa985731f1f87ea9cf254c4e43eb31b8 100644 (file)
@@ -79,7 +79,7 @@ require_once('skipifconnectfailure.inc');
        require_once("clean_table.inc");
 ?>
 --EXPECTF--
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -92,6 +92,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -105,7 +107,7 @@ object(stdClass)#%d (12) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -118,6 +120,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -138,7 +142,7 @@ array(1) {
   [%u|b%"_default_test"]=>
   %unicode|string%(1) "2"
 }
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(13) "_default_test"
   [%u|b%"orgname"]=>
@@ -151,6 +155,8 @@ object(stdClass)#%d (12) {
   %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 7eaa4b672e8dc6fa3f07a5193c75f2abaa6bff8d..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 (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -60,6 +60,8 @@ object(stdClass)#%d (12) {
   %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 082ecbcc274dfae68212d5b39d4cdf171f969a46..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 (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -69,6 +69,8 @@ object(stdClass)#%d (12) {
   %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 2b347e279ef442a49ccf5af98e2d7c8db0152259..ad13d46816947674dcff3024cb750c5a5f363141 100644 (file)
@@ -63,7 +63,7 @@ require_once('skipifconnectfailure.inc');
        require_once("clean_table.inc");
 ?>
 --EXPECTF--
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -76,6 +76,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -89,7 +91,7 @@ object(stdClass)#%d (12) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -102,6 +104,8 @@ object(stdClass)#%d (12) {
   %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 1d27936d16a58186f60d33eae7231acf7ae54ba3..1426bb325f10cc191c32d98534ef7322c78e4648 100644 (file)
@@ -60,7 +60,7 @@ require_once('skipifconnectfailure.inc');
        require_once("clean_table.inc");
 ?>
 --EXPECTF--
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "ID"
   [%u|b%"orgname"]=>
@@ -73,6 +73,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -86,7 +88,7 @@ object(stdClass)#%d (12) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -99,6 +101,8 @@ object(stdClass)#%d (12) {
   %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 00b463de9bd1bdee77a8ece6309c3677db5d904b..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 (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -135,6 +135,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -149,7 +151,7 @@ object(stdClass)#%d (12) {
   int(0)
 }
 bool(true)
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -162,6 +164,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -176,7 +180,7 @@ object(stdClass)#%d (12) {
   int(0)
 }
 bool(true)
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -189,6 +193,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -211,7 +217,7 @@ bool(false)
 Warning: mysqli_field_seek(): Invalid field offset in %s on line %d
 bool(false)
 bool(true)
-object(stdClass)#3 (12) {
+object(stdClass)#3 (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "_null"
   [%u|b%"orgname"]=>
@@ -224,6 +230,8 @@ object(stdClass)#3 (12) {
   %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 aeeac3510e29ae5a1fedfa1ab61891e59def8995..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 (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -77,6 +77,8 @@ object(stdClass)#%d (12) {
   %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 c225cf421404796c547f9e814dc04677822742e7..1c2b49d1694830ac829bf942fe48689fdf9b6c6f 100644 (file)
@@ -61,7 +61,7 @@ if (!function_exists('mysqli_stmt_get_result'))
        require_once("clean_table.inc");
 ?>
 --EXPECTF--
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -74,6 +74,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -87,7 +89,7 @@ object(stdClass)#%d (12) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(5) "label"
   [%u|b%"orgname"]=>
@@ -100,6 +102,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -113,7 +117,7 @@ object(stdClass)#%d (12) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(3) "_id"
   [%u|b%"orgname"]=>
@@ -126,6 +130,8 @@ object(stdClass)#%d (12) {
   %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"]=>
@@ -139,7 +145,7 @@ object(stdClass)#%d (12) {
   [%u|b%"decimals"]=>
   int(0)
 }
-object(stdClass)#%d (12) {
+object(stdClass)#%d (13) {
   [%u|b%"name"]=>
   %unicode|string%(8) "___label"
   [%u|b%"orgname"]=>
@@ -152,6 +158,8 @@ object(stdClass)#%d (12) {
   %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 43ece75e37cfce4b83b63b8473f2fbae315bf5a1..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 (12) {
+object(stdClass)#5 (13) {
   [%u|b%"name"]=>
   %unicode|string%(2) "id"
   [%u|b%"orgname"]=>
@@ -114,6 +114,8 @@ object(stdClass)#5 (12) {
   %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"]=>