From 5254c6f37284007efd17acedc2036a3b0f1d542e Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Wed, 9 Sep 2009 17:03:03 +0000 Subject: Next attempt to fix http://bugs.php.net/bug.php?id=48745. Patch by Andrey. --- ext/mysql/tests/mysql_fetch_field.phpt | 12 +++++++-- ext/mysql/tests/mysql_list_fields.phpt | 49 +++++++++++++++++++++++----------- 2 files changed, 44 insertions(+), 17 deletions(-) (limited to 'ext/mysql/tests') diff --git a/ext/mysql/tests/mysql_fetch_field.phpt b/ext/mysql/tests/mysql_fetch_field.phpt index f9767c82b7..65c44edc5e 100644 --- a/ext/mysql/tests/mysql_fetch_field.phpt +++ b/ext/mysql/tests/mysql_fetch_field.phpt @@ -124,9 +124,16 @@ require_once('skipifconnectfailure.inc'); printf("[017] [%d] %s\n", mysql_errno($link), mysql_error($link)); } $res = mysql_list_fields($db, 'test'); - while ($tmp = mysql_fetch_field($res)) - if ($tmp->name == 'id') + $found = false; + while ($tmp = mysql_fetch_field($res)) { + if ($tmp->name == 'id') { + printf("Fetch field from mysql_list_fields result set.\n"); + $found = true; var_dump($tmp); + } + } + if (!$found) + printf("[018] mysqli_list_fields result set processing has failed.\n"); mysql_free_result($res); @@ -227,6 +234,7 @@ object(stdClass)#%d (13) { [%u|b%"zerofill"]=> int(0) } +Fetch field from mysql_list_fields result set. object(stdClass)#%d (13) { [%u|b%"name"]=> %unicode|string%(2) "id" diff --git a/ext/mysql/tests/mysql_list_fields.phpt b/ext/mysql/tests/mysql_list_fields.phpt index dc3a3417d3..e0b3fd5e39 100644 --- a/ext/mysql/tests/mysql_list_fields.phpt +++ b/ext/mysql/tests/mysql_list_fields.phpt @@ -2,39 +2,46 @@ mysql_list_fields() --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- +[006] [%d] %s +bool(false) +Field Offset 0 +mysql_field_flags()%s +mysql_field_len(): 11 +mysql_field_name(): id +mysql_field_type(): int +Field Offset 1 +mysql_field_flags()%s +mysql_field_len(): 1 +mysql_field_name(): label +mysql_field_type(): string done! -- cgit v1.2.1