Author: ahristov
Date: 2007-03-21 14:28:26 +0100 (Wed, 21 Mar 2007)
New Revision: 235
Modified:
trunk/ext/mysqli/tests/mysqli_stmt_bind_result.phpt
Log:
Fix test in unicode mode
Modified: trunk/ext/mysqli/tests/mysqli_stmt_bind_result.phpt
===================================================================
--- trunk/ext/mysqli/tests/mysqli_stmt_bind_result.phpt 2007-03-21 13:02:37 UTC (rev 234)
+++ trunk/ext/mysqli/tests/mysqli_stmt_bind_result.phpt 2007-03-21 13:28:26 UTC (rev 235)
@@ -6,7 +6,9 @@
--FILE--
<?php
include "connect.inc";
-
+
+ $hint_str_or_unicode = ini_get("unicode.semantics")? "unicode":"string";
+
$tmp = NULL;
$link = NULL;
@@ -229,17 +231,17 @@
$string255 = func_mysqli_stmt_bind_make_string(255);
- func_mysqli_stmt_bind_result($link, $engine, "s", "CHAR(1)", "a", 1110);
- func_mysqli_stmt_bind_result($link, $engine, "s", "CHAR(255)", $string255, 1120);
- func_mysqli_stmt_bind_result($link, $engine, "s", "CHAR(1) NOT NULL", "a", 1140);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "CHAR(1)", "a", 1110,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "CHAR(255)", $string255, 1120,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "CHAR(1) NOT NULL", "a", 1140,
$hint_str_or_unicode);
func_mysqli_stmt_bind_result($link, $engine, "s", "CHAR(1)", NULL, 1160);
$string65k = func_mysqli_stmt_bind_make_string(65535);
- func_mysqli_stmt_bind_result($link, $engine, "s", "VARCHAR(1)", "a", 1180);
- func_mysqli_stmt_bind_result($link, $engine, "s", "VARCHAR(255)", $string255, 1200);
- func_mysqli_stmt_bind_result($link, $engine, "s", "VARCHAR(65635)", $string65k,
1220);
- func_mysqli_stmt_bind_result($link, $engine, "s", "VARCHAR(1) NOT NULL", "a", 1240);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "VARCHAR(1)", "a", 1180,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "VARCHAR(255)", $string255, 1200,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "VARCHAR(65635)", $string65k, 1220,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "VARCHAR(1) NOT NULL", "a", 1240,
$hint_str_or_unicode);
func_mysqli_stmt_bind_result($link, $engine, "s", "VARCHAR(1)", NULL, 1260);
func_mysqli_stmt_bind_result($link, $engine, "s", "BINARY(1)", "a", 1280);
@@ -257,25 +259,25 @@
func_mysqli_stmt_bind_result($link, $engine, "s", "TINYBLOB NOT NULL", "b", 1480);
func_mysqli_stmt_bind_result($link, $engine, "s", "TINYBLOB", NULL, 1500);
- func_mysqli_stmt_bind_result($link, $engine, "s", "TINYTEXT", "a", 1520);
- func_mysqli_stmt_bind_result($link, $engine, "s", "TINYTEXT NOT NULL", "a", 1540);
- func_mysqli_stmt_bind_result($link, $engine, "s", "TINYTEXT", NULL, 1560);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "TINYTEXT", "a", 1520,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "TINYTEXT NOT NULL", "a", 1540,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "TINYTEXT", NULL, 1560,
$hint_str_or_unicode);
// Note: you cannot insert any blob values this way. But you can check the API at
least partly this way
// Extra BLOB tests are in mysqli_stmt_send_long()
- func_mysqli_stmt_bind_result($link, $engine, "b", "BLOB", "", 1580);
- func_mysqli_stmt_bind_result($link, $engine, "b", "TEXT", "", 1600);
- func_mysqli_stmt_bind_result($link, $engine, "b", "MEDIUMBLOB", "", 1620);
- func_mysqli_stmt_bind_result($link, $engine, "b", "MEDIUMTEXT", "", 1640);
+ func_mysqli_stmt_bind_result($link, $engine, "b", "BLOB", b"", 1580);
+ func_mysqli_stmt_bind_result($link, $engine, "b", "TEXT", "", 1600,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "b", "MEDIUMBLOB", b"", 1620);
+ func_mysqli_stmt_bind_result($link, $engine, "b", "MEDIUMTEXT", "", 1640,
$hint_str_or_unicode);
/* test disabled
func_mysqli_stmt_bind_result($link, $engine, "b", "LONGBLOB", "", 1660);
- func_mysqli_stmt_bind_result($link, $engine, "b", "LONGTEXT", "", 1680);
+ func_mysqli_stmt_bind_result($link, $engine, "b", "LONGTEXT", "", 1680,
$hint_str_or_unicode);
*/
- func_mysqli_stmt_bind_result($link, $engine, "s", "ENUM('a', 'b')", "a", 1700);
- func_mysqli_stmt_bind_result($link, $engine, "s", "ENUM('a', 'b')", NULL, 1720);
- func_mysqli_stmt_bind_result($link, $engine, "s", "SET('a', 'b')", "a", 1740);
- func_mysqli_stmt_bind_result($link, $engine, "s", "SET('a', 'b')", NULL, 1760);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "ENUM('a', 'b')", "a", 1700,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "ENUM('a', 'b')", NULL, 1720,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "SET('a', 'b')", "a", 1740,
$hint_str_or_unicode);
+ func_mysqli_stmt_bind_result($link, $engine, "s", "SET('a', 'b')", NULL, 1760,
$hint_str_or_unicode);
// mysqli_stmt_close($stmt);
mysqli_close($link);
@@ -291,3 +293,13 @@
int(1)
%s(1) "a"
done!
+--UEXPECTF--
+Warning: mysqli_stmt_bind_result(): invalid object or resource mysqli_stmt
+ in %s on line %d
+
+Warning: mysqli_stmt_bind_result(): Number of bind variables doesn't match number of
fields in prepared statement in %s on line %d
+
+Warning: mysqli_stmt_bind_result(): Number of bind variables doesn't match number of
fields in prepared statement in %s on line %d
+int(1)
+unicode(1) "a"
+done!
| Thread |
|---|
| • PHP mysqlnd svn commit: r235 - trunk/ext/mysqli/tests | ahristov | 21 Mar |