]> granicus.if.org Git - php/commitdiff
enabled set_charset for MySQL Versions >= 5.0.6
authorGeorg Richter <georg@php.net>
Sat, 21 May 2005 08:46:46 +0000 (08:46 +0000)
committerGeorg Richter <georg@php.net>
Sat, 21 May 2005 08:46:46 +0000 (08:46 +0000)
added testcase for bug #33090

ext/mysqli/php_mysqli.h
ext/mysqli/tests/bug33090.phpt [new file with mode: 0644]

index 3d2cdffb7323f8fd00f08ffd619956398c9041a6..4531bcd4ded8e67ee756d81cc5ea95f820f9c7b5 100644 (file)
@@ -103,7 +103,7 @@ typedef struct {
 #define PHP_MYSQLI_API
 #endif
 
-#if MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000
+#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
 #define HAVE_MYSQLI_SET_CHARSET
 #endif
 
diff --git a/ext/mysqli/tests/bug33090.phpt b/ext/mysqli/tests/bug33090.phpt
new file mode 100644 (file)
index 0000000..5c1cba9
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+Bug #33090
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+       include ("connect.inc");
+
+       /*** test mysqli_connect 127.0.0.1 ***/
+       $link = mysqli_connect($host, $user, $passwd);
+       mysqli_select_db($link, "test");
+
+       if (!($link->prepare("this makes no sense"))) {
+               printf("%d\n", $link->errno);
+               printf("%s\n", $link->sqlstate);
+       }       
+       $link->close();
+?>
+--EXPECT--
+1064
+42000