kalle Mon, 17 Jan 2011 10:43:53 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=307532
Log: Added 'catalog' to the field fetching functions in mysqli (Thanks to Johannes for the headsup) Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/UPGRADING U php/php-src/trunk/ext/mysqli/mysqli_api.c U php/php-src/trunk/ext/mysqli/tests/047.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_direct.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_oo.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_fields.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_field_seek.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_field_tell.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt U php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt
Modified: php/php-src/trunk/NEWS =================================================================== --- php/php-src/trunk/NEWS 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/NEWS 2011-01-17 10:43:53 UTC (rev 307532) @@ -162,8 +162,6 @@ . 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) Modified: php/php-src/trunk/UPGRADING =================================================================== --- php/php-src/trunk/UPGRADING 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/UPGRADING 2011-01-17 10:43:53 UTC (rev 307532) @@ -161,8 +161,6 @@ 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. =================================== Modified: php/php-src/trunk/ext/mysqli/mysqli_api.c =================================================================== --- php/php-src/trunk/ext/mysqli/mysqli_api.c 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/mysqli_api.c 2011-01-17 10:43:53 UTC (rev 307532) @@ -1057,6 +1057,7 @@ 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); Modified: php/php-src/trunk/ext/mysqli/tests/047.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/047.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/047.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -60,7 +60,7 @@ === 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 @@ %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 @@ 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 @@ %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 @@ } === 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 @@ %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 @@ [%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 @@ %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 @@ } === fetch_field === -object(stdClass)#6 (12) { +object(stdClass)#6 (13) { [%u|b%"name"]=> %unicode|string%(3) "foo" [%u|b%"orgname"]=> @@ -183,6 +191,8 @@ %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 @@ [%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 @@ %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"]=> Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -79,7 +79,7 @@ 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 @@ %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 @@ [%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 @@ %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 @@ [%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 @@ %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"]=> Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_direct.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_direct.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_direct.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -47,7 +47,7 @@ --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 @@ %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"]=> Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -56,7 +56,7 @@ --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 @@ %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"]=> Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_oo.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_oo.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_field_oo.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -63,7 +63,7 @@ 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 @@ %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 @@ [%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 @@ %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"]=> Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_fields.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_fields.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_fetch_fields.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -60,7 +60,7 @@ 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 @@ %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 @@ [%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 @@ %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"]=> Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_field_seek.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/mysqli_field_seek.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_field_seek.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -122,7 +122,7 @@ --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 @@ %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 @@ 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 @@ %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 @@ 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 @@ %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 @@ 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 @@ %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"]=> Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_field_tell.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/mysqli_field_tell.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_field_tell.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -64,7 +64,7 @@ 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 @@ %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"]=> Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -61,7 +61,7 @@ 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 @@ %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 @@ [%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 @@ %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 @@ [%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 @@ %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 @@ [%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 @@ %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"]=> Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt =================================================================== --- php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt 2011-01-17 09:59:07 UTC (rev 307531) +++ php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt 2011-01-17 10:43:53 UTC (rev 307532) @@ -101,7 +101,7 @@ 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 @@ %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"]=>
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php