diff options
| author | Ulf Wendel <uw@php.net> | 2009-07-02 07:42:34 +0000 |
|---|---|---|
| committer | Ulf Wendel <uw@php.net> | 2009-07-02 07:42:34 +0000 |
| commit | 2bca33e0d7bf9776f7093dc047d311fe23a18d60 (patch) | |
| tree | 00a6b193ece645640161ba880c71ab26c150cda5 | |
| parent | 81a0fda92b933dc77faa7f86dc5f66e0d9644ce5 (diff) | |
| download | php-git-2bca33e0d7bf9776f7093dc047d311fe23a18d60.tar.gz | |
Test for bug #48754
| -rw-r--r-- | ext/mysql/tests/mysql_list_fields.phpt | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/ext/mysql/tests/mysql_list_fields.phpt b/ext/mysql/tests/mysql_list_fields.phpt index 87b3cf6b89..3ee7751191 100644 --- a/ext/mysql/tests/mysql_list_fields.phpt +++ b/ext/mysql/tests/mysql_list_fields.phpt @@ -1,8 +1,8 @@ --TEST-- mysql_list_fields() --SKIPIF-- -<?php -require_once('skipif.inc'); +<?php +require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); ?> --FILE-- @@ -21,8 +21,20 @@ require('table.inc'); if (!$res = mysql_list_fields($db, 'test', $link)) printf("[003] [%d] %s\n", mysql_errno($link), mysql_error($link)); -if (!($num = mysql_num_fields($res))) - printf("[004] Empty field list? [%d] %s\n", mysql_errno($link), mysql_error($link)); +if (2 !== ($num = mysql_num_fields($res))) + printf("[004] Expecting two fields, got %d. [%d] %s\n", $num, mysql_errno($link), mysql_error($link)); + +mysql_free_result($res); + +if (!mysql_query("DROP TABLE IF EXISTS test2", $link) || + !mysql_query("CREATE TABLE test2(id INT)", $link)) + printf("[005] [%d] %s\n", mysql_errno($link), mysql_error($link)); + +if (!$res = mysql_list_fields($db, 'test%', $link)) + printf("[006] [%d] %s\n", mysql_errno($link), mysql_error($link)); + +if (3 !== ($num = mysql_num_fields($res))) + printf("[007] Expecting 3 fields from test and test2, got %d. [%d] %s\n", $num, mysql_errno($link), mysql_error($link)); mysql_free_result($res); mysql_close($link); |
