diff options
| author | Georg Richter <georg@php.net> | 2004-12-27 15:39:35 +0000 |
|---|---|---|
| committer | Georg Richter <georg@php.net> | 2004-12-27 15:39:35 +0000 |
| commit | dc63cb7feb4dd85542f86c5cfd458edcce202107 (patch) | |
| tree | cf37d6b4ab4cbd76395baa4ae1452220774b2233 /ext/mysqli | |
| parent | 7be33a225e49057b671fd80d1f815c7d8c16492b (diff) | |
| download | php-git-dc63cb7feb4dd85542f86c5cfd458edcce202107.tar.gz | |
fixed testcase 047
fixed windows compile error
Diffstat (limited to 'ext/mysqli')
| -rw-r--r-- | ext/mysqli/mysqli_api.c | 3 | ||||
| -rw-r--r-- | ext/mysqli/tests/047.phpt | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index ee10849470..3c1be87314 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -982,6 +982,7 @@ PHP_FUNCTION(mysqli_info) Initialize mysqli and return a resource for use with mysql_real_connect */ PHP_FUNCTION(mysqli_init) { + MYSQLI_RESOURCE *mysqli_resource; MY_MYSQL *mysql = (MY_MYSQL *)calloc(1, sizeof(MY_MYSQL)); if (!(mysql->mysql = mysql_init(NULL))) { @@ -989,7 +990,7 @@ PHP_FUNCTION(mysqli_init) RETURN_FALSE; } - MYSQLI_RESOURCE *mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); + mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); mysqli_resource->ptr = (void *)mysql; MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry); } diff --git a/ext/mysqli/tests/047.phpt b/ext/mysqli/tests/047.phpt index 56acddd688..d6ccb0df37 100644 --- a/ext/mysqli/tests/047.phpt +++ b/ext/mysqli/tests/047.phpt @@ -12,7 +12,7 @@ mysqli_get_metadata mysqli_select_db($link, "test"); mysqli_query($link, "DROP TABLE IF EXISTS test_affected"); - mysqli_query($link, "CREATE TABLE test_affected (foo int, bar varchar(10))"); + mysqli_query($link, "CREATE TABLE test_affected (foo int, bar varchar(10) character set latin1)"); mysqli_query($link, "INSERT INTO test_affected VALUES (1, 'Zak'),(2, 'Greant')"); @@ -31,7 +31,7 @@ mysqli_get_metadata --EXPECTF-- array(2) { [0]=> - object(stdClass)#%d (9) { + object(stdClass)#4 (11) { ["name"]=> string(3) "foo" ["orgname"]=> @@ -44,6 +44,10 @@ array(2) { string(0) "" ["max_length"]=> int(0) + ["length"]=> + int(11) + ["charsetnr"]=> + int(63) ["flags"]=> int(32768) ["type"]=> @@ -52,7 +56,7 @@ array(2) { int(0) } [1]=> - object(stdClass)#%d (9) { + object(stdClass)#5 (11) { ["name"]=> string(3) "bar" ["orgname"]=> @@ -65,6 +69,10 @@ array(2) { string(0) "" ["max_length"]=> int(0) + ["length"]=> + int(10) + ["charsetnr"]=> + int(8) ["flags"]=> int(0) ["type"]=> |
