summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_mysql')
-rwxr-xr-xext/pdo_mysql/config.m471
-rwxr-xr-xext/pdo_mysql/mysql_driver.c10
-rwxr-xr-xext/pdo_mysql/mysql_statement.c10
-rwxr-xr-xext/pdo_mysql/pdo_mysql.c55
-rwxr-xr-xext/pdo_mysql/php_pdo_mysql.h4
-rwxr-xr-xext/pdo_mysql/php_pdo_mysql_int.h16
-rw-r--r--ext/pdo_mysql/tests/bug44327.phpt24
-rw-r--r--ext/pdo_mysql/tests/bug46292.phpt21
-rw-r--r--ext/pdo_mysql/tests/bug_33689.phpt9
-rw-r--r--ext/pdo_mysql/tests/bug_37445.phpt1
-rw-r--r--ext/pdo_mysql/tests/bug_39858.phpt22
-rw-r--r--ext/pdo_mysql/tests/bug_41125.phpt7
-rw-r--r--ext/pdo_mysql/tests/bug_41698.phpt10
-rw-r--r--ext/pdo_mysql/tests/bug_41997.phpt14
-rw-r--r--ext/pdo_mysql/tests/bug_42499.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug_44454.phpt8
-rw-r--r--ext/pdo_mysql/tests/bug_44707.phpt10
-rw-r--r--ext/pdo_mysql/tests/bug_45120.phpt2
-rw-r--r--ext/pdo_mysql/tests/bug_50323.phpt61
-rw-r--r--ext/pdo_mysql/tests/bug_pecl_12925.phpt10
-rw-r--r--ext/pdo_mysql/tests/bug_pecl_7976.phpt25
-rw-r--r--ext/pdo_mysql/tests/mysql_pdo_test.inc9
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt2
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt14
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt1
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt131
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt1
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt1
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt3
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt9
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt3
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt41
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt1
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt25
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt29
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_bit.phpt15
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_commit.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt18
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt10
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt18
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt1
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt75
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt15
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt9
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_rollback.phpt10
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt11
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt7
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt8
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt5
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt2
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt27
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt25
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt16
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt22
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt166
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt54
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt1
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_subclass.phpt14
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_types.phpt6
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt6
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5200.phpt8
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5780.phpt15
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5802.phpt21
91 files changed, 892 insertions, 560 deletions
diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4
index aa5efd899..0b0de12bd 100755
--- a/ext/pdo_mysql/config.m4
+++ b/ext/pdo_mysql/config.m4
@@ -1,4 +1,4 @@
-dnl $Id: config.m4 287424 2009-08-17 17:57:40Z jani $
+dnl $Id: config.m4 291501 2009-11-30 15:11:29Z jani $
dnl config.m4 for extension pdo_mysql
dnl vim: se ts=2 sw=2 et:
@@ -28,46 +28,42 @@ if test "$PHP_PDO_MYSQL" != "no"; then
done
])
+ if test -f $PHP_PDO_MYSQL && test -x $PHP_PDO_MYSQL ; then
+ PDO_MYSQL_CONFIG=$PHP_PDO_MYSQL
+ elif test "$PHP_PDO_MYSQL" != "yes"; then
+ if test -d "$PHP_PDO_MYSQL" ; then
+ if test -x "$PHP_PDO_MYSQL/bin/mysql_config" ; then
+ PDO_MYSQL_CONFIG="$PHP_PDO_MYSQL/bin/mysql_config"
+ else
+ PDO_MYSQL_DIR="$PHP_PDO_MYSQL"
+ fi
+ fi
+ else
+ for i in /usr/local /usr ; do
+ if test -x "$i/bin/mysql_config" ; then
+ PDO_MYSQL_CONFIG="$i/bin/mysql_config"
+ break;
+ fi
+ if test -r $i/include/mysql/mysql.h || test -r $i/include/mysql.h ; then
+ PDO_MYSQL_DIR="$i"
+ break;
+ fi
+ done
+ fi
+
if test "$PHP_PDO_MYSQL" = "mysqlnd"; then
dnl enables build of mysqnd library
PHP_MYSQLND_ENABLED=yes
AC_DEFINE([PDO_USE_MYSQLND], 1, [Whether pdo_mysql uses mysqlnd])
else
AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
- AC_MSG_CHECKING([for mysql_config])
- if test -f $PHP_PDO_MYSQL && test -x $PHP_PDO_MYSQL ; then
- PDO_MYSQL_CONFIG=$PHP_PDO_MYSQL
- elif test "$PHP_PDO_MYSQL" != "yes"; then
- if test -d "$PHP_PDO_MYSQL" ; then
- if test -x "$PHP_PDO_MYSQL/bin/mysql_config" ; then
- PDO_MYSQL_CONFIG="$PHP_PDO_MYSQL/bin/mysql_config"
- else
- PDO_MYSQL_DIR="$PHP_PDO_MYSQL"
- fi
- else
- AC_MSG_RESULT([$PHP_PDO_MYSQL is not a directory])
- AC_MSG_ERROR([can not find mysql under the "$PHP_PDO_MYSQL" that you specified])
- fi
- else
- for i in /usr/local /usr ; do
- if test -x "$i/bin/mysql_config" ; then
- PDO_MYSQL_CONFIG="$i/bin/mysql_config"
- break;
- fi
- if test -r $i/include/mysql/mysql.h || test -r $i/include/mysql.h ; then
- PDO_MYSQL_DIR="$i"
- break;
- fi
- done
- fi
-
- if test -n "$PDO_MYSQL_CONFIG" && test -x "$PDO_MYSQL_CONFIG" ; then
+ AC_MSG_CHECKING([for mysql_config])
+ if test -n "$PDO_MYSQL_CONFIG"; then
AC_MSG_RESULT($PDO_MYSQL_CONFIG)
if test "x$SED" = "x"; then
AC_PATH_PROG(SED, sed)
fi
-
if test "$enable_maintainer_zts" = "yes"; then
PDO_MYSQL_LIBNAME=mysqlclient_r
PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs_r | $SED -e "s/'//g"`
@@ -76,11 +72,7 @@ if test "$PHP_PDO_MYSQL" != "no"; then
PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"`
fi
PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"`
- PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket`
- elif test -z "$PDO_MYSQL_DIR"; then
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([Cannot find MySQL header files under $PDO_MYSQL_DIR])
- else
+ elif test -n "$PDO_MYSQL_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_CHECKING([for mysql install under $PDO_MYSQL_DIR])
if test -r $PDO_MYSQL_DIR/include/mysql; then
@@ -103,10 +95,11 @@ if test "$PHP_PDO_MYSQL" != "no"; then
PHP_ADD_INCLUDE($PDO_MYSQL_INC_DIR)
PDO_MYSQL_INCLUDE=-I$PDO_MYSQL_INC_DIR
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Unable to find your mysql installation])
fi
- AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ])
-
PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_query,
[
PHP_EVAL_INCLINE($PDO_MYSQL_INCLUDE)
@@ -159,6 +152,10 @@ if test "$PHP_PDO_MYSQL" != "no"; then
AC_MSG_RESULT($pdo_inc_path)
])
+ if test -n "$PDO_MYSQL_CONFIG"; then
+ PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket`
+ AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ])
+ fi
dnl fix after renaming to pdo_mysql
PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path -I)
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 1b4b227e4..37a67e56e 100755
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2009 The PHP Group |
+ | Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysql_driver.c 289630 2009-10-14 13:51:25Z johannes $ */
+/* $Id: mysql_driver.c 294543 2010-02-04 20:28:55Z johannes $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -127,7 +127,7 @@ int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int lin
if (!dbh->methods) {
PDO_DBG_INF("Throwing exception");
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
*pdo_err, einfo->errcode, einfo->errmsg);
}
@@ -462,7 +462,7 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value
case PDO_ATTR_SERVER_INFO: {
char *tmp;
#if PDO_USE_MYSQLND
- int tmp_len;
+ unsigned int tmp_len;
if (mysqlnd_stat(H->server, &tmp, &tmp_len) == PASS) {
ZVAL_STRINGL(return_value, tmp, tmp_len, 0);
@@ -731,7 +731,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
if (mysqlnd_connect(H->server, host, dbh->username, dbh->password, password_len, dbname, dbname_len,
- port, unix_socket, connect_opts, PDO_MYSQL_G(mysqlnd_thd_zval_cache) TSRMLS_CC) == NULL) {
+ port, unix_socket, connect_opts TSRMLS_CC) == NULL) {
#else
if (mysql_real_connect(H->server, host, dbh->username, dbh->password, dbname, port, unix_socket, connect_opts) == NULL) {
#endif
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 6899dd77a..074e9fbb2 100755
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2009 The PHP Group |
+ | Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysql_statement.c 280838 2009-05-20 08:30:12Z kalle $ */
+/* $Id: mysql_statement.c 294543 2010-02-04 20:28:55Z johannes $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -120,7 +120,7 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt) /* {{{ */
+static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
{
long row_count;
pdo_mysql_stmt *S = stmt->driver_data;
@@ -237,7 +237,7 @@ static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt TSRMLS_DC)
}
}
- pdo_mysql_stmt_set_row_count(stmt);
+ pdo_mysql_stmt_set_row_count(stmt TSRMLS_CC);
PDO_DBG_RETURN(1);
}
/* }}} */
@@ -280,7 +280,7 @@ static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt TSRMLS_DC) /
}
}
- pdo_mysql_stmt_set_row_count(stmt);
+ pdo_mysql_stmt_set_row_count(stmt TSRMLS_CC);
PDO_DBG_RETURN(1);
}
/* }}} */
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
index 44719fd79..158c033b0 100755
--- a/ext/pdo_mysql/pdo_mysql.c
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2009 The PHP Group |
+ | Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_mysql.c 289630 2009-10-14 13:51:25Z johannes $ */
+/* $Id: pdo_mysql.c 294514 2010-02-04 09:37:38Z pajoye $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -35,43 +35,37 @@
ZEND_GET_MODULE(pdo_mysql)
#endif
-#if PDO_USE_MYSQLND
ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql);
#ifndef PHP_WIN32
# ifndef PDO_MYSQL_UNIX_ADDR
-# define PDO_MYSQL_UNIX_ADDR "/tmp/mysql.sock"
+# ifdef PHP_MYSQL_UNIX_SOCK_ADDR
+# define PDO_MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR
+# else
+# define PDO_MYSQL_UNIX_ADDR "/tmp/mysql.sock"
+# endif
# endif
#endif
-
/* {{{ PHP_INI_BEGIN
*/
PHP_INI_BEGIN()
#ifndef PHP_WIN32
- STD_PHP_INI_ENTRY("pdo_mysql.default_socket", PDO_MYSQL_UNIX_ADDR, PHP_INI_SYSTEM, OnUpdateString, default_socket, zend_pdo_mysql_globals, pdo_mysql_globals)
+ STD_PHP_INI_ENTRY("pdo_mysql.default_socket", PDO_MYSQL_UNIX_ADDR, PHP_INI_SYSTEM, OnUpdateStringUnempty, default_socket, zend_pdo_mysql_globals, pdo_mysql_globals)
#endif
#if PDO_DBG_ENABLED
STD_PHP_INI_ENTRY("pdo_mysql.debug", NULL, PHP_INI_SYSTEM, OnUpdateString, debug, zend_pdo_mysql_globals, pdo_mysql_globals)
#endif
- STD_PHP_INI_ENTRY("pdo_mysql.cache_size", "2000", PHP_INI_SYSTEM, OnUpdateLong, cache_size, zend_pdo_mysql_globals, pdo_mysql_globals)
PHP_INI_END()
/* }}} */
-#endif
-/* true global environment */
-#ifdef PDO_USE_MYSQLND
-static MYSQLND_ZVAL_PCACHE *pdo_mysqlnd_zval_cache;
-#endif
-
+/* true global environment */
/* {{{ PHP_MINIT_FUNCTION
*/
static PHP_MINIT_FUNCTION(pdo_mysql)
{
-#if PDO_USE_MYSQLND
REGISTER_INI_ENTRIES();
-#endif
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_USE_BUFFERED_QUERY", (long)PDO_MYSQL_ATTR_USE_BUFFERED_QUERY);
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_LOCAL_INFILE", (long)PDO_MYSQL_ATTR_LOCAL_INFILE);
@@ -86,10 +80,6 @@ static PHP_MINIT_FUNCTION(pdo_mysql)
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_FOUND_ROWS", (long)PDO_MYSQL_ATTR_FOUND_ROWS);
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_IGNORE_SPACE", (long)PDO_MYSQL_ATTR_IGNORE_SPACE);
-#ifdef PDO_USE_MYSQLND
- pdo_mysqlnd_zval_cache = mysqlnd_palloc_init_cache(PDO_MYSQL_G(cache_size));
-#endif
-
return php_pdo_register_driver(&pdo_mysql_driver);
}
/* }}} */
@@ -100,7 +90,6 @@ static PHP_MSHUTDOWN_FUNCTION(pdo_mysql)
{
php_pdo_unregister_driver(&pdo_mysql_driver);
#if PDO_USE_MYSQLND
- mysqlnd_palloc_free_cache(pdo_mysqlnd_zval_cache);
UNREGISTER_INI_ENTRIES();
#endif
@@ -117,20 +106,6 @@ static PHP_MINFO_FUNCTION(pdo_mysql)
php_info_print_table_header(2, "PDO Driver for MySQL", "enabled");
php_info_print_table_row(2, "Client API version", mysql_get_client_info());
-#ifdef PDO_USE_MYSQLND
- {
- zval values;
-
- php_info_print_table_header(2, "Persistent cache", pdo_mysqlnd_zval_cache ? "enabled":"disabled");
-
- if (pdo_mysqlnd_zval_cache) {
- /* Now report cache status */
- mysqlnd_palloc_stats(pdo_mysqlnd_zval_cache, &values);
- mysqlnd_minfo_print_hash(&values);
- zval_dtor(&values);
- }
- }
-#endif
php_info_print_table_end();
#ifdef PDO_USE_MYSQLND
@@ -144,12 +119,10 @@ static PHP_MINFO_FUNCTION(pdo_mysql)
/* {{{ PHP_RINIT_FUNCTION
*/
static PHP_RINIT_FUNCTION(pdo_mysql)
-{
- PDO_MYSQL_G(mysqlnd_thd_zval_cache) = mysqlnd_palloc_rinit(pdo_mysqlnd_zval_cache);
-
+{
#if PDO_DBG_ENABLED
if (PDO_MYSQL_G(debug)) {
- MYSQLND_DEBUG *dbg = mysqlnd_debug_init(TSRMLS_C);
+ MYSQLND_DEBUG *dbg = mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
if (!dbg) {
return FAILURE;
}
@@ -167,8 +140,6 @@ static PHP_RINIT_FUNCTION(pdo_mysql)
*/
static PHP_RSHUTDOWN_FUNCTION(pdo_mysql)
{
- mysqlnd_palloc_rshutdown(PDO_MYSQL_G(mysqlnd_thd_zval_cache));
-
#if PDO_DBG_ENABLED
MYSQLND_DEBUG *dbg = PDO_MYSQL_G(dbg);
PDO_DBG_ENTER("RSHUTDOWN");
@@ -187,8 +158,6 @@ static PHP_RSHUTDOWN_FUNCTION(pdo_mysql)
*/
static PHP_GINIT_FUNCTION(pdo_mysql)
{
- pdo_mysql_globals->mysqlnd_thd_zval_cache = NULL; /* zval cache */
- pdo_mysql_globals->cache_size = 0;
#ifndef PHP_WIN32
pdo_mysql_globals->default_socket = NULL;
#endif
@@ -227,7 +196,7 @@ zend_module_entry pdo_mysql_module_entry = {
pdo_mysql_functions,
PHP_MINIT(pdo_mysql),
PHP_MSHUTDOWN(pdo_mysql),
-#if PDO_USE_MYSQLND
+#if PDO_USE_MYSQLND && PDO_DBG_ENABLED
PHP_RINIT(pdo_mysql),
PHP_RSHUTDOWN(pdo_mysql),
#else
diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h
index 6adfbf095..202c2a23d 100755
--- a/ext/pdo_mysql/php_pdo_mysql.h
+++ b/ext/pdo_mysql/php_pdo_mysql.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2009 The PHP Group |
+ | Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pdo_mysql.h 272370 2008-12-31 11:15:49Z sebastian $ */
+/* $Id: php_pdo_mysql.h 293036 2010-01-03 09:23:27Z sebastian $ */
#ifndef PHP_PDO_MYSQL_H
#define PHP_PDO_MYSQL_H
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
index ac0a97394..51e5e5591 100755
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2009 The PHP Group |
+ | Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pdo_mysql_int.h 289630 2009-10-14 13:51:25Z johannes $ */
+/* $Id: php_pdo_mysql_int.h 294514 2010-02-04 09:37:38Z pajoye $ */
#ifndef PHP_PDO_MYSQL_INT_H
#define PHP_PDO_MYSQL_INT_H
@@ -61,10 +61,7 @@ static inline void PDO_DBG_ENTER(char *func_name) {}
#include "ext/mysqlnd/mysqlnd_debug.h"
#endif
-#ifdef PDO_USE_MYSQLND
ZEND_BEGIN_MODULE_GLOBALS(pdo_mysql)
- MYSQLND_THD_ZVAL_PCACHE *mysqlnd_thd_zval_cache;
- long cache_size;
#ifndef PHP_WIN32
char *default_socket;
#endif
@@ -72,10 +69,15 @@ ZEND_BEGIN_MODULE_GLOBALS(pdo_mysql)
char *debug; /* The actual string */
MYSQLND_DEBUG *dbg; /* The DBG object */
#endif
+#if defined(PHP_WIN32) && !PDO_DBG_ENABLED
+ /* dummy member so we get at least one member in the struct
+ * and avoids build errors.
+ */
+ void *dummymemmber;
+#endif
ZEND_END_MODULE_GLOBALS(pdo_mysql)
-ZEND_EXTERN_MODULE_GLOBALS(pdo_mysql);
-#endif
+ZEND_EXTERN_MODULE_GLOBALS(pdo_mysql)
#ifdef ZTS
#define PDO_MYSQL_G(v) TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
diff --git a/ext/pdo_mysql/tests/bug44327.phpt b/ext/pdo_mysql/tests/bug44327.phpt
index 1952cce05..f82c4302d 100644
--- a/ext/pdo_mysql/tests/bug44327.phpt
+++ b/ext/pdo_mysql/tests/bug44327.phpt
@@ -42,22 +42,22 @@ $db = MySQLPDOTest::factory();
?>
--EXPECTF--
object(PDORow)#%d (2) {
- ["queryString"]=>
- string(17) "SELECT 1 AS "one""
- ["one"]=>
- string(1) "1"
+ [%u|b%"queryString"]=>
+ %unicode|string%(17) "SELECT 1 AS "one""
+ [%u|b%"one"]=>
+ %unicode|string%(1) "1"
}
-string(1) "1"
-string(1) "1"
-string(17) "SELECT 1 AS "one""
+%unicode|string%(1) "1"
+%unicode|string%(1) "1"
+%unicode|string%(17) "SELECT 1 AS "one""
----------------------------------
object(PDORow)#%d (2) {
- ["queryString"]=>
- string(19) "SELECT id FROM test"
- ["id"]=>
- string(1) "1"
+ [%u|b%"queryString"]=>
+ %unicode|string%(19) "SELECT id FROM test"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
-string(19) "SELECT id FROM test"
+%unicode|string%(19) "SELECT id FROM test"
----------------------------------
Notice: Trying to get property of non-object in %s on line %d
diff --git a/ext/pdo_mysql/tests/bug46292.phpt b/ext/pdo_mysql/tests/bug46292.phpt
index 80423bc7a..a0f9716c6 100644
--- a/ext/pdo_mysql/tests/bug46292.phpt
+++ b/ext/pdo_mysql/tests/bug46292.phpt
@@ -50,32 +50,35 @@ if (version_compare(PHP_VERSION, '5.1.0', '<'))
var_dump($stmt->fetch());
var_dump($stmt->fetch());
var_dump($stmt->fetchAll());
-
- $pdoDb->query('DROP TABLE IF EXISTS testz');
-
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS testz');
?>
--EXPECTF--
bool(true)
myclass::__construct()
object(myclass)#%d (1) {
- ["value"]=>
- string(1) "1"
+ [%u|b%"value"]=>
+ %unicode|string%(1) "1"
}
myclass::__construct()
object(myclass2)#%d (1) {
- ["value"]=>
- string(1) "2"
+ [%u|b%"value"]=>
+ %unicode|string%(1) "2"
}
myclass::__construct()
array(2) {
[0]=>
object(myclass)#%d (1) {
- ["value"]=>
+ [%u|b%"value"]=>
NULL
}
[1]=>
object(stdClass)#%d (1) {
- ["value"]=>
+ [%u|b%"value"]=>
NULL
}
}
diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt
index 88392ef32..5969cae6a 100644
--- a/ext/pdo_mysql/tests/bug_33689.phpt
+++ b/ext/pdo_mysql/tests/bug_33689.phpt
@@ -34,10 +34,15 @@ else
print_r($tmp);
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
object(PDOStatement)#%d (1) {
- ["queryString"]=>
- string(18) "SELECT * from test"
+ [%u|b%"queryString"]=>
+ %unicode|string%(18) "SELECT * from test"
}
Array
(
diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt
index 524a3d080..8e915332d 100644
--- a/ext/pdo_mysql/tests/bug_37445.phpt
+++ b/ext/pdo_mysql/tests/bug_37445.phpt
@@ -15,7 +15,6 @@ $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
$db->setAttribute(PDO :: ATTR_EMULATE_PREPARES, true);
$stmt = $db->prepare("SELECT 1");
$stmt->bindParam(':a', 'b');
-
?>
--EXPECTF--
Fatal error: Cannot pass parameter 2 by reference in %sbug_37445.php on line %d
diff --git a/ext/pdo_mysql/tests/bug_39858.phpt b/ext/pdo_mysql/tests/bug_39858.phpt
index 6a2124d3b..47457180a 100644
--- a/ext/pdo_mysql/tests/bug_39858.phpt
+++ b/ext/pdo_mysql/tests/bug_39858.phpt
@@ -62,35 +62,41 @@ bug_39858($db);
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec("DROP PROCEDURE IF EXISTS p");
+?>
--EXPECTF--
Emulated Prepared Statements...
array(1) {
[0]=>
array(1) {
- ["2 * 2"]=>
- string(1) "4"
+ [%u|b%"2 * 2"]=>
+ %unicode|string%(1) "4"
}
}
array(1) {
[0]=>
array(1) {
- ["2 * 2"]=>
- string(1) "4"
+ [%u|b%"2 * 2"]=>
+ %unicode|string%(1) "4"
}
}
Native Prepared Statements...
array(1) {
[0]=>
array(1) {
- ["2 * 2"]=>
- string(1) "4"
+ [%u|b%"2 * 2"]=>
+ %unicode|string%(1) "4"
}
}
array(1) {
[0]=>
array(1) {
- ["2 * 2"]=>
- string(1) "4"
+ [%u|b%"2 * 2"]=>
+ %unicode|string%(1) "4"
}
}
done!
diff --git a/ext/pdo_mysql/tests/bug_41125.phpt b/ext/pdo_mysql/tests/bug_41125.phpt
index 1f54cca5f..a1d8dd1ae 100644
--- a/ext/pdo_mysql/tests/bug_41125.phpt
+++ b/ext/pdo_mysql/tests/bug_41125.phpt
@@ -22,6 +22,7 @@ if ($version < 40100)
<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
+$db->exec("DROP TABLE IF EXISTS test");
// And now allow the evil to do his work
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 1);
@@ -37,6 +38,12 @@ do {
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec("DROP TABLE IF EXISTS test");
+?>
--EXPECTF--
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d
array(0) {
diff --git a/ext/pdo_mysql/tests/bug_41698.phpt b/ext/pdo_mysql/tests/bug_41698.phpt
index b2dee60d7..890ba7761 100644
--- a/ext/pdo_mysql/tests/bug_41698.phpt
+++ b/ext/pdo_mysql/tests/bug_41698.phpt
@@ -22,16 +22,16 @@ $stmt = $db->prepare('INSERT INTO test VALUES(?)');
$stmt->execute(array($value));
var_dump($db->query('SELECT * from test')->fetchAll(PDO::FETCH_ASSOC));
?>
---EXPECT--
+--EXPECTF--
array(2) {
[0]=>
array(1) {
- ["floatval"]=>
- string(8) "2.340000"
+ [%u|b%"floatval"]=>
+ %unicode|string%(8) "2.340000"
}
[1]=>
array(1) {
- ["floatval"]=>
- string(8) "4.560000"
+ [%u|b%"floatval"]=>
+ %unicode|string%(8) "4.560000"
}
} \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/bug_41997.phpt b/ext/pdo_mysql/tests/bug_41997.phpt
index c48a641f9..ee0cfe9ac 100644
--- a/ext/pdo_mysql/tests/bug_41997.phpt
+++ b/ext/pdo_mysql/tests/bug_41997.phpt
@@ -38,17 +38,17 @@ var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
var_dump($stmt->errorInfo());
print "done!";
?>
---EXPECT--
+--EXPECTF--
array(1) {
[0]=>
array(1) {
- ["one"]=>
- string(1) "1"
+ [%u|b%"one"]=>
+ %unicode|string%(1) "1"
}
}
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
NULL
[2]=>
@@ -57,13 +57,13 @@ array(3) {
array(1) {
[0]=>
array(1) {
- ["two"]=>
- string(1) "2"
+ [%u|b%"two"]=>
+ %unicode|string%(1) "2"
}
}
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
NULL
[2]=>
diff --git a/ext/pdo_mysql/tests/bug_42499.phpt b/ext/pdo_mysql/tests/bug_42499.phpt
index 4fcea874b..dece019a9 100644
--- a/ext/pdo_mysql/tests/bug_42499.phpt
+++ b/ext/pdo_mysql/tests/bug_42499.phpt
@@ -61,8 +61,8 @@ Emulated Prepared Statements...
array(1) {
[0]=>
array(1) {
- ["_id"]=>
- string(1) "a"
+ [%u|b%"_id"]=>
+ %unicode|string%(1) "a"
}
}
@@ -71,8 +71,8 @@ Native Prepared Statements...
array(1) {
[0]=>
array(1) {
- ["_id"]=>
- string(1) "a"
+ [%u|b%"_id"]=>
+ %unicode|string%(1) "a"
}
}
diff --git a/ext/pdo_mysql/tests/bug_44454.phpt b/ext/pdo_mysql/tests/bug_44454.phpt
index e8f91a00a..7ad7f8545 100644
--- a/ext/pdo_mysql/tests/bug_44454.phpt
+++ b/ext/pdo_mysql/tests/bug_44454.phpt
@@ -63,9 +63,15 @@ bug_44454($db);
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--XFAIL--
For some reason the exception gets thrown at the wrong place
---EXPECT--
+--EXPECTF--
Native Prepared Statements
... SELECT has returned 1 row...
... INSERT should fail...
diff --git a/ext/pdo_mysql/tests/bug_44707.phpt b/ext/pdo_mysql/tests/bug_44707.phpt
index d5d4539fc..18c81040f 100644
--- a/ext/pdo_mysql/tests/bug_44707.phpt
+++ b/ext/pdo_mysql/tests/bug_44707.phpt
@@ -73,7 +73,7 @@ bug_44707($db);
print "done!";
?>
---EXPECT--
+--EXPECTF--
Native Prepared Statements
bool(false)
bool(false)
@@ -83,10 +83,10 @@ array(0) {
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["mybool"]=>
- string(1) "0"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"mybool"]=>
+ %unicode|string%(1) "0"
}
}
done!
diff --git a/ext/pdo_mysql/tests/bug_45120.phpt b/ext/pdo_mysql/tests/bug_45120.phpt
index 0e46d5eaf..db5da823f 100644
--- a/ext/pdo_mysql/tests/bug_45120.phpt
+++ b/ext/pdo_mysql/tests/bug_45120.phpt
@@ -42,8 +42,6 @@ bug_45120($db);
print "done!";
?>
---XFAIL--
-This is an open PDO bug. It is not a PDO_MYSQL bug
--EXPECT--
Emulated Prepared Statements
Native Prepared Statements
diff --git a/ext/pdo_mysql/tests/bug_50323.phpt b/ext/pdo_mysql/tests/bug_50323.phpt
new file mode 100644
index 000000000..02050fac5
--- /dev/null
+++ b/ext/pdo_mysql/tests/bug_50323.phpt
@@ -0,0 +1,61 @@
+--TEST--
+Bug #50323 (No ability to connect to database named 't;', no chance to escape semicolon)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
+require dirname(__FILE__) . '/config.inc';
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+ function changeDSN($original, $new_options) {
+ $old_options = array();
+ $dsn = substr($original,
+ strpos($original, ':') + 1,
+ strlen($original));
+
+ // no real parser - any excotic setting can fool us
+ $parts = explode(';', $dsn);
+ foreach ($parts as $k => $v) {
+ $tmp = explode('=', $v);
+ if (count($tmp) == 2)
+ $old_options[$tmp[0]] = $tmp[1];
+ }
+
+ $options = $old_options;
+ foreach ($new_options as $k => $v)
+ $options[$k] = $v;
+
+ $dsn = 'mysql:';
+ foreach ($options as $k => $v)
+ $dsn .= sprintf('%s=%s;', $k, $v);
+
+ $dsn = substr($dsn, 0, strlen($dsn) -1);
+
+ return $dsn;
+ }
+
+
+if (1 === @$db->exec('CREATE DATABASE `crazy;dbname`')) {
+ $dsn = changeDSN(getenv('PDOTEST_DSN'), array('dbname' => 'crazy;;dbname'));
+ $user = getenv('PDOTEST_USER');
+ $pass = getenv('PDOTEST_PASS');
+
+ new PDO($dsn, $user, $pass);
+}
+echo 'done!';
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+@$db->exec('DROP DATABASE IF EXISTS `crazy;dbname`');
+?>
+--EXPECTF--
+done!
+
diff --git a/ext/pdo_mysql/tests/bug_pecl_12925.phpt b/ext/pdo_mysql/tests/bug_pecl_12925.phpt
index 1e7cea5e4..1867868ec 100644
--- a/ext/pdo_mysql/tests/bug_pecl_12925.phpt
+++ b/ext/pdo_mysql/tests/bug_pecl_12925.phpt
@@ -42,21 +42,21 @@ bug_pecl_1295($db);
$db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
---EXPECT--
+--EXPECTF--
Emulated...
array(1) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "c"
}
}
Native...
array(1) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "c"
}
}
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/bug_pecl_7976.phpt b/ext/pdo_mysql/tests/bug_pecl_7976.phpt
index 24e934f86..5f585bd01 100644
--- a/ext/pdo_mysql/tests/bug_pecl_7976.phpt
+++ b/ext/pdo_mysql/tests/bug_pecl_7976.phpt
@@ -48,40 +48,45 @@ $db = MySQLPDOTest::factory();
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
bug_pecl_7976($db);
-$db->exec('DROP PROCEDURE IF EXISTS p');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP PROCEDURE IF EXISTS p');
+?>
--XFAIL--
Works with mysqlnd. It is not supported by libmysql. For libmysql is good enough to see no crash.
---EXPECT--
+--EXPECTF--
Emulated...
array(1) {
[0]=>
array(1) {
- ["_one"]=>
- string(1) "1"
+ [%u|b%"_one"]=>
+ %unicode|string%(1) "1"
}
}
array(1) {
[0]=>
array(1) {
- ["_one"]=>
- string(1) "1"
+ [%u|b%"_one"]=>
+ %unicode|string%(1) "1"
}
}
Native...
array(1) {
[0]=>
array(1) {
- ["_one"]=>
- string(1) "1"
+ [%u|b%"_one"]=>
+ %unicode|string%(1) "1"
}
}
array(1) {
[0]=>
array(1) {
- ["_one"]=>
- string(1) "1"
+ [%u|b%"_one"]=>
+ %unicode|string%(1) "1"
}
}
done!
diff --git a/ext/pdo_mysql/tests/mysql_pdo_test.inc b/ext/pdo_mysql/tests/mysql_pdo_test.inc
index aa98d1464..736791933 100644
--- a/ext/pdo_mysql/tests/mysql_pdo_test.inc
+++ b/ext/pdo_mysql/tests/mysql_pdo_test.inc
@@ -158,5 +158,12 @@ class MySQLPDOTest extends PDOTest {
return (bool)preg_match('/Client API version.*mysqlnd/', $tmp);
}
+ static function dropTestTable($db = NULL) {
+ if (is_null($db))
+ $db = self::factory();
+
+ $db->exec('DROP TABLE IF EXISTS test');
+ }
+
}
-?>
+?> \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt
index 8602a4971..46015533d 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt
@@ -101,7 +101,8 @@ MySQLPDOTest::skip();
}
// what about long values for a valid option ...
- $dsn = MySQLPDOTest::getDSN(array('host' => str_repeat('0123456789', 1024 * 100)));
+ // hostnames > 1024 chars break on some NIS-enabled FreeBSD...
+ $dsn = MySQLPDOTest::getDSN(array('host' => str_repeat('0123456789', 100)));
try { $db = @new PDO($dsn, $user, $pass); assert(false); printf("%s\n", $dsn); } catch (PDOException $e) {
$tmp = $e->getMessage();
if (!stristr($tmp, 'HY000') && !stristr($tmp, '2005') && !stristr($tmp, '2002'))
@@ -285,6 +286,7 @@ MySQLPDOTest::skip();
}
print "done!";
+?>
--EXPECTF--
[002] invalid data source name, [n/a] n/a
[003] invalid data source name, [n/a] n/a
@@ -295,4 +297,4 @@ MySQLPDOTest::skip();
[009] SQLSTATE[28000] [1045] Access denied for user 'dont%s'@'%s' (using password: YES), [n/a] n/a
[010] SQLSTATE[28000] [1045] Access denied for user 'dont%s'@'%s' (using password: YES), [n/a] n/a
[017] DSN=%s, SQLSTATE[%s] [%d] %s
-[033] DSN = mysql:%s, character sets has not been set, @@character_set_connection reports 'latin1', expecting 'latin2'done! \ No newline at end of file
+[033] DSN = mysql:%s, character sets has not been set, @@character_set_connection reports 'latin1', expecting 'latin2'done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt
index 5bd824b81..14f81a66f 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct_ini.phpt
@@ -8,7 +8,6 @@ MySQLPDOTest::skip();
/* TODO - fix this limitation */
if (getenv('PDO_MYSQL_TEST_DSN') !== "mysql:dbname=phptest;unix_socket=/tmp/mysql.sock")
die("skip Fix test to run in other environments as well!");
-
?>
--INI--
pdo.dsn.mysql="mysql:dbname=phptest;socket=/tmp/mysql.sock"
@@ -51,6 +50,7 @@ pdo.dsn.mysql="mysql:dbname=phptest;socket=/tmp/mysql.sock"
}
print "done!";
+?>
--EXPECTF--
pdo.dsn.mysql cannot be accessed through ini_get_all()/ini_get()
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt
index 8bd714d69..c0df4a512 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt
@@ -46,6 +46,8 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY',
PDO::MYSQL_ATTR_LOCAL_INFILE => 'PDO::MYSQL_ATTR_LOCAL_INFILE',
PDO::MYSQL_ATTR_DIRECT_QUERY => 'PDO::MYSQL_ATTR_DIRECT_QUERY',
+
+ PDO::MYSQL_ATTR_INIT_COMMAND => 'PDO::MYSQL_ATTR_INIT_COMMAND',
);
$defaults = array(
@@ -59,6 +61,7 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
PDO::MYSQL_ATTR_LOCAL_INFILE => false,
/* TODO getAttribute() does not handle it */
PDO::MYSQL_ATTR_DIRECT_QUERY => 1,
+ PDO::MYSQL_ATTR_INIT_COMMAND => '',
);
if (NULL !== ($db = @new PDO($dsn, $user, $pass, 'wrong type')))
@@ -140,6 +143,10 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
set_option_and_check(21, PDO::MYSQL_ATTR_LOCAL_INFILE, true, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
set_option_and_check(22, PDO::MYSQL_ATTR_LOCAL_INFILE, false, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
+ set_option_and_check(23, PDO::MYSQL_ATTR_INIT_COMMAND, 'SET @a=1', 'PDO::MYSQL_ATTR_INIT_COMMAND');
+ set_option_and_check(24, PDO::MYSQL_ATTR_INIT_COMMAND, '', 'PDO::MYSQL_ATTR_INIT_COMMAND');
+ set_option_and_check(25, PDO::MYSQL_ATTR_INIT_COMMAND, 'INSERT INTO nonexistent(invalid) VALUES (1)', 'PDO::MYSQL_ATTR_INIT_COMMAND');
+
set_option_and_check(33, PDO::MYSQL_ATTR_DIRECT_QUERY, 1, 'PDO::MYSQL_ATTR_DIRECT_QUERY');
set_option_and_check(34, PDO::MYSQL_ATTR_DIRECT_QUERY, 0, 'PDO::MYSQL_ATTR_DIRECT_QUERY');
@@ -151,9 +158,11 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
}
print "done!";
+?>
--EXPECTF--
[003] [TODO][CHANGEREQUEST] Please, lets not ignore invalid options and bail out!
[003a] Expecting default value for 'PDO::ATTR_EMULATE_PREPARES' of '1'/integer, getAttribute() reports setting ''/boolean
+[003a] Expecting default value for 'PDO::MYSQL_ATTR_INIT_COMMAND' of ''/string, getAttribute() reports setting ''/boolean
Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute in %s on line %d
[010] [TODO][CHANGEREQUEST] ATTR_EMULATE_PREPARES should be on
@@ -167,4 +176,7 @@ Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this func
Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute in %s on line %d
[018] PDO::MYSQL_ATTR_DIRECT_QUERY should be off
[021] Execting '1'/boolean got ''/boolean' for options 'PDO::MYSQL_ATTR_LOCAL_INFILE'
-done! \ No newline at end of file
+[023] Execting 'SET @a=1'/string got ''/boolean' for options 'PDO::MYSQL_ATTR_INIT_COMMAND'
+[024] SQLSTATE[42000] [1065] Query was empty
+[025] SQLSTATE[42S02] [1146] Table 'test.nonexistent' doesn't exist
+done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
index 8a8e347a6..4c9e41437 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
@@ -59,10 +59,6 @@ if (MySQLPDOTest::isPDOMySQLnd())
$tmp, gettype($tmp));
}
- set_option_and_check(23, PDO::MYSQL_ATTR_INIT_COMMAND, 'SET @a=1', 'PDO::MYSQL_ATTR_INIT_COMMAND');
- set_option_and_check(24, PDO::MYSQL_ATTR_INIT_COMMAND, '', 'PDO::MYSQL_ATTR_INIT_COMMAND');
- set_option_and_check(25, PDO::MYSQL_ATTR_INIT_COMMAND, 'INSERT INTO nonexistent(invalid) VALUES (1)', 'PDO::MYSQL_ATTR_INIT_COMMAND');
-
set_option_and_check(26, PDO::MYSQL_ATTR_READ_DEFAULT_FILE, true, 'PDO::MYSQL_ATTR_READ_DEFAULT_FILE');
set_option_and_check(27, PDO::MYSQL_ATTR_READ_DEFAULT_FILE, false, 'PDO::MYSQL_ATTR_READ_DEFAULT_FILE');
@@ -79,10 +75,8 @@ if (MySQLPDOTest::isPDOMySQLnd())
}
print "done!";
+?>
--EXPECTF--
[001] Expecting default value for 'PDO::MYSQL_ATTR_INIT_COMMAND' of ''/string, getAttribute() reports setting ''/boolean
-[023] Execting 'SET @a=1'/string got ''/boolean' for options 'PDO::MYSQL_ATTR_INIT_COMMAND'
-[024] SQLSTATE[42000] [1065] Query was empty
-[025] SQLSTATE[42S02] [1146] Table '%snonexistent' doesn't exist
[026] Execting '1'/boolean got ''/boolean' for options 'PDO::MYSQL_ATTR_READ_DEFAULT_FILE'
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
index 87e1a1ee0..7e92ff2e9 100644
--- a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt
@@ -66,6 +66,7 @@ MySQLPDOTest::skip();
}
print "done!";
+?>
--EXPECTF--
Warning: PDO::__construct(%s
[002] URI=uri:file:%spdomuri.tst, DSN=mysql%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql%sdbname=%s'), invalid data source URI
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt
index b48952875..b1e5507f6 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt
@@ -87,7 +87,12 @@ $db = MySQLPDOTest::factory();
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt
index c7a203727..618d9e65e 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt
@@ -81,86 +81,91 @@ $db = MySQLPDOTest::factory();
var_export($db->errorInfo(), true), var_export($db->errorCode(), true));
var_dump($stmt->fetchAll(PDO::FETCH_BOTH));
-
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
+
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
-string(15) "PDO::CASE_LOWER"
+%unicode|string%(15) "PDO::CASE_LOWER"
array(2) {
[0]=>
array(6) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["id_upper"]=>
- string(1) "1"
+ %unicode|string%(1) "1"
+ [%u|b%"id_upper"]=>
+ %unicode|string%(1) "1"
[1]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
[2]=>
- string(1) "a"
+ %unicode|string%(1) "a"
}
[1]=>
array(6) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
[0]=>
- string(1) "2"
- ["id_upper"]=>
- string(1) "2"
+ %unicode|string%(1) "2"
+ [%u|b%"id_upper"]=>
+ %unicode|string%(1) "2"
[1]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
[2]=>
- string(1) "b"
+ %unicode|string%(1) "b"
}
}
array(2) {
[0]=>
array(10) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["id_upper"]=>
- string(1) "1"
+ %unicode|string%(1) "1"
+ [%u|b%"id_upper"]=>
+ %unicode|string%(1) "1"
[1]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
[2]=>
- string(1) "a"
- ["mixed"]=>
+ %unicode|string%(1) "a"
+ [%u|b%"mixed"]=>
NULL
[3]=>
NULL
- ["myupper"]=>
+ [%u|b%"myupper"]=>
NULL
[4]=>
NULL
}
[1]=>
array(10) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
[0]=>
- string(1) "2"
- ["id_upper"]=>
- string(1) "2"
+ %unicode|string%(1) "2"
+ [%u|b%"id_upper"]=>
+ %unicode|string%(1) "2"
[1]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
[2]=>
- string(1) "b"
- ["mixed"]=>
+ %unicode|string%(1) "b"
+ [%u|b%"mixed"]=>
NULL
[3]=>
NULL
- ["myupper"]=>
+ [%u|b%"myupper"]=>
NULL
[4]=>
NULL
@@ -169,23 +174,23 @@ array(2) {
array(1) {
[0]=>
array(10) {
- ["ID"]=>
- string(1) "1"
+ [%u|b%"ID"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["LABEL"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"LABEL"]=>
+ %unicode|string%(1) "a"
[1]=>
- string(1) "a"
- ["MIXED"]=>
+ %unicode|string%(1) "a"
+ [%u|b%"MIXED"]=>
NULL
[2]=>
NULL
- ["MYUPPER"]=>
+ [%u|b%"MYUPPER"]=>
NULL
[3]=>
NULL
- ["LOWER"]=>
+ [%u|b%"LOWER"]=>
NULL
[4]=>
NULL
@@ -194,26 +199,26 @@ array(1) {
array(1) {
[0]=>
array(10) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
[1]=>
- string(1) "a"
- ["MiXeD"]=>
+ %unicode|string%(1) "a"
+ [%u|b%"MiXeD"]=>
NULL
[2]=>
NULL
- ["MYUPPER"]=>
+ [%u|b%"MYUPPER"]=>
NULL
[3]=>
NULL
- ["ID"]=>
- string(1) "1"
+ [%u|b%"ID"]=>
+ %unicode|string%(1) "1"
[4]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
}
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt
index e3f21fbaf..2d939635c 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_client_version.phpt
@@ -32,5 +32,6 @@ $db = MySQLPDOTest::factory();
printf("[003] Did we change it from '%s' to '%s'?\n", $version, $new_version);
print "done!";
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt
index 038df3cdb..187f9ec23 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_connection_status.phpt
@@ -32,5 +32,6 @@ $db = MySQLPDOTest::factory();
printf("[005] Connection status should not have changed\n");
print "done!";
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt
index 0c156e4d1..8661dda59 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_driver_name.phpt
@@ -25,6 +25,7 @@ $db = MySQLPDOTest::factory();
printf("[002] Did we change it from '%s' to '%s'?\n", $name, $new_name);
print "done!";
+?>
--EXPECTF--
-string(5) "mysql"
+%unicode|string%(5) "mysql"
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt
index 3b2b0929e..b9a4fc934 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt
@@ -23,19 +23,20 @@ MySQLPDOTest::skip();
$stmt->closeCursor();
print "done!";
+?>
--EXPECTF--
array(1) {
[0]=>
array(1) {
- ["test.label"]=>
- string(1) "a"
+ [%u|b%"test.label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "a"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt
index 8d086b7cc..89e6f386e 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_init_command.phpt
@@ -33,7 +33,8 @@ error_reporting=E_ALL
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
$db->exec(sprintf('DROP TABLE IF EXISTS %s', $table));
- print "done!\n";
+ print "done!";
+?>
--EXPECTF--
%unicode|string%(58) "CREATE TABLE test_%s(id INT)"
%unicode|string%(5) "00000"
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt
index 9ba8dee85..115103df7 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_max_buffer_size.phpt
@@ -62,6 +62,13 @@ if (MySQLPDOTest::isPDOMySQLnd())
try_buffer_size(4, 2000);
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
[001] id = 1, val = 0123456789... (length: %d)
[002] id = 1, val = 0123456789... (length: 1000)
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt
index 9e938ef6a..cdc0b2643 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt
@@ -80,41 +80,42 @@ MySQLPDOTest::skip();
@$db->exec('DROP PROCEDURE IF EXISTS p');
print "done!";
+?>
--EXPECTF--
[002] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...
[003] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...
array(1) {
[0]=>
array(6) {
- ["z"]=>
+ [%u|b%"z"]=>
NULL
- ["a"]=>
+ [%u|b%"a"]=>
NULL
- ["b"]=>
- string(1) " "
- ["c"]=>
+ [%u|b%"b"]=>
+ %unicode|string%(1) " "
+ [%u|b%"c"]=>
NULL
- ["d"]=>
- string(2) " d"
- ["e"]=>
- string(3) "%se"
+ [%u|b%"d"]=>
+ %unicode|string%(2) " d"
+ [%u|b%"e"]=>
+ %unicode|string%(3) "%se"
}
}
array(1) {
[0]=>
array(6) {
- ["z"]=>
+ [%u|b%"z"]=>
NULL
- ["a"]=>
- string(0) ""
- ["b"]=>
- string(1) " "
- ["c"]=>
- string(0) ""
- ["d"]=>
- string(2) " d"
- ["e"]=>
- string(3) "%se"
+ [%u|b%"a"]=>
+ %unicode|string%(0) ""
+ [%u|b%"b"]=>
+ %unicode|string%(1) " "
+ [%u|b%"c"]=>
+ %unicode|string%(0) ""
+ [%u|b%"d"]=>
+ %unicode|string%(2) " d"
+ [%u|b%"e"]=>
+ %unicode|string%(3) "%se"
}
}
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt
index 07bb8c39f..a59a6b0cc 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_server_version.phpt
@@ -60,5 +60,6 @@ $db = MySQLPDOTest::factory();
printf("[010] Did we change it from '%s' to '%s'?\n", $version, $new_version);
print "done!";
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt
index d077f6ebf..631a918dd 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt
@@ -106,10 +106,11 @@ $db = MySQLPDOTest::factory();
$stmt = $db->query('SELECT id, label FROM test ORDER BY id ASC LIMIT 1');
print "done!";
+?>
--EXPECTF--
array(1) {
[0]=>
- string(12) "PDOStatement"
+ %unicode|string%(12) "PDOStatement"
}
Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class in %s on line %d
@@ -125,29 +126,29 @@ Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: user-supplied stat
Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d
array(2) {
[0]=>
- string(12) "mystatement4"
+ %unicode|string%(12) "mystatement4"
[1]=>
array(1) {
[0]=>
- string(6) "param1"
+ %unicode|string%(6) "param1"
}
}
mystatement4
-string(6) "param1"
+%unicode|string%(6) "param1"
mystatement5
-string(12) "mystatement5"
-string(10) "no data :)"
+%unicode|string%(12) "mystatement5"
+%unicode|string%(10) "no data :)"
array(1) {
[0]=>
array(4) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
[1]=>
- string(1) "a"
+ %unicode|string%(1) "a"
}
}
diff --git a/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt b/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt
index 30aecf4b5..8871a3170 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt
@@ -120,7 +120,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
$tmp = $stmt->fetch(PDO::FETCH_ASSOC);
if ($tmp['auto_commit'] != 0)
printf("[026] Autocommit mode of the MySQL Server should be off, got '%s', [%d] %s\n",
- $tmp['auto_commit'], $stmt->errorCode(), implode(' ', $stmt->errorInfo()));
+ $tmp['auto_commit'], $stmt->errorCode(), trim(implode(' ', $stmt->errorInfo())));
$db->commit();
// Now we should be back to autocommit - we've issues a commit
@@ -179,23 +179,28 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
if (1 != $db->exec('DELETE FROM test'))
printf("[038] No rows deleted, can't be true.\n");
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
bool(false)
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "z"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "z"
}
-[026] Autocommit mode of the MySQL Server should be off, got '1', [0] 00000
+[026] Autocommit mode of the MySQL Server should be off, got '1', [0] 00000
[028] I'm confused, how can autocommit be on? Didn't I say I want to manually control transactions?
-string(5) "00000"
+%unicode|string%(5) "00000"
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_bit.phpt b/ext/pdo_mysql/tests/pdo_mysql_bit.phpt
index 18506acef..899231a21 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_bit.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_bit.phpt
@@ -35,7 +35,6 @@ if (MySQLPDOTest::isPDOMySQLnd())
var_dump($row);
var_dump($value);
-
return true;
}
@@ -48,12 +47,18 @@ if (MySQLPDOTest::isPDOMySQLnd())
echo "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(2) {
- ["id"]=>
- string(2) "20"
- ["label"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(2) "20"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "1"
}
int(1)
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
index b09c1a586..9200d7bbd 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
@@ -12,16 +12,16 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
'MYSQL_ATTR_USE_BUFFERED_QUERY' => true,
'MYSQL_ATTR_LOCAL_INFILE' => true,
'MYSQL_ATTR_DIRECT_QUERY' => true,
- 'MYSQL_ATTR_FOUND_ROWS' => true,
+ 'MYSQL_ATTR_FOUND_ROWS' => true,
'MYSQL_ATTR_IGNORE_SPACE' => true,
+ 'MYSQL_ATTR_INIT_COMMAND' => true,
);
if (!MySQLPDOTest::isPDOMySQLnd()) {
$expected['MYSQL_ATTR_MAX_BUFFER_SIZE'] = true;
- $expected['MYSQL_ATTR_INIT_COMMAND'] = true;
$expected['MYSQL_ATTR_READ_DEFAULT_FILE'] = true;
$expected['MYSQL_ATTR_READ_DEFAULT_GROUP'] = true;
- $expected['MYSQL_ATTR_COMPRESS'] = true;
+ $expected['MYSQL_ATTR_COMPRESS'] = true;
}
/*
diff --git a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt
index 056c0e023..e213f66ea 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt
@@ -78,7 +78,13 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
$db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test_commit'));
print "done!";
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test_commit');
+MySQLPDOTest::dropTestTable($db);
+?>
--EXPECT--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt b/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt
index 35056a74d..b970c4ef9 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_errorcode.phpt
@@ -75,7 +75,12 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
index 99b2b846b..93e1fbf1a 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
@@ -29,8 +29,6 @@ $db = MySQLPDOTest::factory();
printf("[%03d] Driver-specific error message.not set\n", $offset);
}
-
-
}
function pdo_mysql_errorinfo($db, $offset) {
@@ -96,9 +94,13 @@ $db = MySQLPDOTest::factory();
printf("Native Prepared Statements...\n");
pdo_mysql_errorinfo($db, 20);
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Emulated Prepared Statements...
[015] Driver-specific error code not set
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
index 5ca5f4479..381a2b51d 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
@@ -170,8 +170,14 @@ MySQLPDOTest::skip();
}
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
- @$db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+@$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Warning: PDO::exec(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'THIS IS NOT VALID SQL, I HOPE' at line 1 in %s on line %d
[016] [42000] 42000 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'THIS IS NOT VALID SQL, I HOPE' at line %d
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt
index 00a2de169..2e8005355 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec_ddl.phpt
@@ -70,13 +70,6 @@ MySQLPDOTest::skip();
11.1.17. DROP TABLESPACE Syntax
*/
- // clean up
- @$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl');
- @$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl2');
- @$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl');
- @$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl2');
-
-
} catch (PDOException $e) {
printf("[001] %s, [%s] %s\n",
$e->getMessage(),
@@ -84,5 +77,16 @@ MySQLPDOTest::skip();
}
print "done!";
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+MySQLPDOTest::dropTestTable($db);
+// clean up
+@$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl');
+@$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl2');
+@$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl');
+@$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl2');
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt
index ecfa50243..1310c0e64 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt
@@ -96,7 +96,13 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1'))
$db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt
index a759f72cd..ef85fabe6 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt
@@ -50,9 +50,15 @@ MySQLPDOTest::skip();
$e->getMessage(),
$db->errorCode(), implode(' ', $db->errorInfo()));
}
-
- @$db->exec(sprintf('DROP TABLE IF EXISTS test'));
+
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+@$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Warning: PDO::exec(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in %s on line %d
[006] Expecting '1'/integer got ''/boolean when running 'INSERT INTO test(id, col1) VALUES (2, "b")', [HY000] HY000 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
diff --git a/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt b/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt
index a8cbde6ea..da886390c 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_fetch_both.phpt
@@ -56,33 +56,33 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
--EXPECTF--
[002] Suspicious FETCH_BOTH result, dumping
array(2) {
[0]=>
- string(1) "1"
+ %unicode|string%(1) "1"
[1]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
array(2) {
[1]=>
- string(1) "1"
+ %unicode|string%(1) "1"
[2]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
[002] Expected differes from returned data, dumping
array(2) {
[0]=>
- string(1) "1"
+ %unicode|string%(1) "1"
[1]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
array(2) {
[1]=>
- string(1) "1"
+ %unicode|string%(1) "1"
[2]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt b/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt
index 74f17d598..c992d3acf 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt
@@ -94,8 +94,13 @@ PDO::ATTR_CONNECTION_STATUS
PDO::ATTR_SERVER_INFO
*/
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
[001] Call to PDO::setAttribute(int attribute, mixed value) has changed the type of value from integer to boolean, test will not work properly
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt b/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt
index 552128cae..2bb5573f3 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt
@@ -108,7 +108,12 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
index e5ab3d5fb..eb0fff13e 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
@@ -92,10 +92,6 @@ MySQLPDOTest::skip();
}
print "done!";
---XFAIL--
-Expected to fail in debug mode as PDO doesn't properly clean persistent connections
+?>
--EXPECTF--
-Warning: PDO::exec(): MySQL server has gone away in %s on line %d
-
-Warning: PDO::exec(): Error while reading SET_OPTION's EOF packet. PID=%d in %s on line %d
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt
index 30e7bda47..a570c1fd4 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt
@@ -26,5 +26,6 @@ $db = MySQLPDOTest::factory();
}
print "done!";
+?>
--EXPECT--
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt
index fa942f385..4447146ee 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt
@@ -316,99 +316,104 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--XFAIL--
PDO's PS parser has some problems with invalid SQL and crashes from time to time
(check with valgrind...)
--EXPECTF--
array(1) {
- ["one"]=>
- string(1) "1"
+ [%u|b%"one"]=>
+ %unicode|string%(1) "1"
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(12) ":placeholder"
+ [%u|b%"label"]=>
+ %unicode|string%(12) ":placeholder"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(12) ":placeholder"
+ [%u|b%"label"]=>
+ %unicode|string%(12) ":placeholder"
}
}
array(2) {
[0]=>
array(1) {
- ["label"]=>
- string(9) "first row"
+ [%u|b%"label"]=>
+ %unicode|string%(9) "first row"
}
[1]=>
array(1) {
- ["label"]=>
- string(10) "second row"
+ [%u|b%"label"]=>
+ %unicode|string%(10) "second row"
}
}
array(2) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(3) "row"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(3) "row"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(3) "row"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(3) "row"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "?"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "?"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "?"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "?"
}
}
array(2) {
[0]=>
array(1) {
- ["label"]=>
- string(9) "first row"
+ [%u|b%"label"]=>
+ %unicode|string%(9) "first row"
}
[1]=>
array(1) {
- ["label"]=>
- string(10) "second row"
+ [%u|b%"label"]=>
+ %unicode|string%(10) "second row"
}
}
array(2) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(3) "row"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(3) "row"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(3) "row"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(3) "row"
}
}
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt
index 30edcbe4b..c382025ba 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt
@@ -56,17 +56,22 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "?"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "?"
}
}
now the same with native PS
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt
index a8faa8d13..e8f7d3984 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt
@@ -52,9 +52,14 @@ MySQLPDOTest::skip();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d
[003] Execute has failed, 'HY093' array (
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt
index 1f8a4c2c3..b8b77ff5d 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt
@@ -100,9 +100,14 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1'))
implode(' ', $db->errorInfo()),
(isset($stmt)) ? implode(' ', $stmt->errorInfo()) : 'N/A');
}
-
- // $db->exec('DROP TABLE IF EXISTS test');
+
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: %s in %s on line %d
[004] [0] array (
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt
index 54257be42..ba5142a0c 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_match_against.phpt
@@ -36,8 +36,14 @@ MySQLPDOTest::skip();
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(0) {
}
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt
index 1d5f30160..b9027c898 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt
@@ -333,9 +333,14 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(1) {
[0]=>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt
index 33c699c15..8c367af24 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt
@@ -66,9 +66,14 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Warning: PDOStatement::execute(): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unknown_column' in 'field list' in %s on line %d
[003] Execute has failed, '42S22' array (
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt
index b497268f9..57a4529ac 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_column.phpt
@@ -26,9 +26,14 @@ $db = MySQLPDOTest::factory();
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(1) {
[0]=>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt
index 4f901964e..c9d122a81 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt
@@ -92,9 +92,14 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Native...
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt
index c8d1a5ba8..90cedef56 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt
@@ -24,9 +24,13 @@ $db = MySQLPDOTest::factory();
$stmt->execute(array(1, 1));
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Warning: PDO::prepare(): SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters in %s on line %d
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt
index 4ead73d7f..c4a74eadf 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt
@@ -64,9 +64,14 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
[003] Execute has failed, 'HY093' array (
0 => 'HY093',
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt
index aa7815dea..0f8c8880e 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt
@@ -57,9 +57,14 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(1) {
[0]=>
diff --git a/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt b/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt
index 358d4a780..193b1a159 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt
@@ -79,9 +79,15 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
$db->commit();
var_dump($db->getAttribute(PDO::ATTR_AUTOCOMMIT));
- $db->exec('DROP TABLE IF EXISTS test');
- $db->exec('DROP TABLE IF EXISTS test2');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+$db->exec('DROP TABLE IF EXISTS test2');
+?>
--EXPECTF--
int(1)
int(0)
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt
index 394ed4f45..dd4920e39 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindcolumn.phpt
@@ -99,9 +99,14 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
id = 1 (integer) / label = 'a' (string)
id = 2 (integer) / label = 'b' (string)
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt
index 993ea0447..70b2f3fa2 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam.phpt
@@ -114,9 +114,13 @@ MySQLPDOTest::skip();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Emulated PS...
Buffered...
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt
index 64d4df064..9421f62ee 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindparam_types.phpt
@@ -162,8 +162,12 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt
index 6dc557d14..1c62d7731 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_bindvalue.phpt
@@ -293,9 +293,13 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Testing native PS...
Binding variable...
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt
index 88b847ce8..ae7e7fc42 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobfromsteam.phpt
@@ -132,11 +132,16 @@ unlink($file);
printf("[001] %s [%s] %s\n",
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
-
- @unlink($file);
- $db->exec('DROP TABLE IF EXISTS test');
+
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+@unlink(MySQLPDOTest::getTempDir() . DIRECTORY_SEPARATOR . 'pdoblob.tst');
+?>
--EXPECTF--
Emulated PS...
Native PS...
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
index 2914583f6..96489ef86 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt
@@ -87,5 +87,12 @@ MySQLPDOTest::skip();
}
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt
index c96da1f34..455b17d1e 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor.phpt
@@ -142,10 +142,14 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
-
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Testing emulated PS...
Buffered...
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt
index a575014c7..aea272b1d 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_closecursor_empty.phpt
@@ -61,6 +61,11 @@ $db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
in = 0 -> id = 1 (integer) / label = 'a' (string)
in = 0 -> id = 2 (integer) / label = 'b' (string)
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt
index 508ba0a3e..85985dde8 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt
@@ -52,9 +52,13 @@ $db = MySQLPDOTest::factory();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Testing emulated PS...
int(3)
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt
index 877200631..4d59e8c3b 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt
@@ -40,8 +40,6 @@ $db = MySQLPDOTest::factory();
$stmt->execute();
var_dump($stmt->errorCode());
-
-
} catch (PDOException $e) {
printf("[003] %s [%s] %s\n",
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt
index da372534f..d5a348957 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt
@@ -59,11 +59,16 @@ $db = MySQLPDOTest::factory();
}
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Testing emulated PS...
array(3) {
[0]=>
- string(0) ""
+ %unicode|string%(0) ""
[1]=>
NULL
[2]=>
@@ -73,26 +78,26 @@ array(3) {
Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.ihopeitdoesnotexist' doesn't exist in %s on line %d
array(3) {
[0]=>
- string(5) "42S02"
+ %unicode|string%(5) "42S02"
[1]=>
int(1146)
[2]=>
- string(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
+ %unicode|string%(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
}
Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.test' doesn't exist in %s on line %d
bool(false)
array(3) {
[0]=>
- string(5) "42S02"
+ %unicode|string%(5) "42S02"
[1]=>
int(1146)
[2]=>
- string(%d) "Table '%s.test' doesn't exist"
+ %unicode|string%(%d) "Table '%s.test' doesn't exist"
}
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
NULL
[2]=>
@@ -104,7 +109,7 @@ Warning: PDO::prepare(): SQLSTATE[42S02]: Base table or view not found: 1146 Tab
bool(false)
array(3) {
[0]=>
- string(0) ""
+ %unicode|string%(0) ""
[1]=>
NULL
[2]=>
@@ -114,18 +119,18 @@ array(3) {
Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.test' doesn't exist in %s on line %d
array(3) {
[0]=>
- string(5) "42S02"
+ %unicode|string%(5) "42S02"
[1]=>
int(1146)
[2]=>
- string(%d) "Table '%s.test' doesn't exist"
+ %unicode|string%(%d) "Table '%s.test' doesn't exist"
}
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
int(1146)
[2]=>
- string(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
+ %unicode|string%(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
}
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt
index fdf63ea14..928e90de6 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt
@@ -180,8 +180,12 @@ MySQLPDOTest::skip();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt
index db8f2f5ea..9c54dc2f6 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt
@@ -113,9 +113,14 @@ if (version_compare(PHP_VERSION, '5.1.0', '<'))
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Creating an object, serializing it and writing it to DB...
myclass::singleton(Creating object)
@@ -125,24 +130,24 @@ myclass::serialize()
Unserializing the previously serialized object...
myclass::unserialize('Data from serialize')
object(myclass)#4 (1) {
- ["myprotected":protected]=>
- string(19) "a protected propery"
+ [%u|b%"myprotected":protected]=>
+ %unicode|string%(19) "a protected propery"
}
Using PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE to fetch the object from DB and unserialize it...
myclass::unserialize('C:7:"myclass":19:{Data from serialize}')
object(myclass)#%d (1) {
- ["myprotected":protected]=>
- string(19) "a protected propery"
+ [%u|b%"myprotected":protected]=>
+ %unicode|string%(19) "a protected propery"
}
Using PDO::FETCH_CLASS to fetch the object from DB and unserialize it...
-myclass::__set(myobj, 'C:7:"myclass":19:{Data from serialize}')
myclass::__construct(PDO shall call __construct())
+myclass::__set(myobj, 'C:7:"myclass":19:{Data from serialize}')
object(myclass)#%d (2) {
- ["myprotected":protected]=>
- string(19) "a protected propery"
- ["myobj"]=>
- string(38) "C:7:"myclass":19:{Data from serialize}"
+ [%u|b%"myprotected":protected]=>
+ %unicode|string%(19) "a protected propery"
+ [%u|b%"myobj"]=>
+ %unicode|string%(38) "C:7:"myclass":19:{Data from serialize}"
}
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt
index 79ef0c34a..067f9ca70 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt
@@ -63,9 +63,13 @@ try {
$e->getMessage(), $db->errorInfo(), implode(' ', $db->errorInfo()));
}
-$db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
myclass::__set(id, -'1'-) 1
myclass::__set(, -''-) 2
@@ -83,13 +87,13 @@ myclass::__set(null, -NULL-) 3
myclass::__set(, -''-) 4
myclass::__construct(2, 3): 12 / 4
object(myclass)#%d (4) {
- ["set_calls":"myclass":private]=>
+ [%u|b%"set_calls":"myclass":private]=>
int(4)
- ["grp":protected]=>
+ [%u|b%"grp":protected]=>
NULL
- ["id"]=>
- string(1) "3"
- ["null"]=>
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"null"]=>
NULL
}
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
index fbff844e3..91b5237ea 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
@@ -49,14 +49,18 @@ MySQLPDOTest::skip();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Emulated Prepared Statements...
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
NULL
[2]=>
@@ -65,13 +69,13 @@ array(3) {
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "a"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
NULL
[2]=>
@@ -80,15 +84,15 @@ array(3) {
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "a"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "a"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
Native Prepared Statements...
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt
index f491536ab..799624543 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt
@@ -104,106 +104,110 @@ if (!MySQLPDOTest::isPDOMySQLnd())
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Emulated PS...
array(1) {
[0]=>
array(1) {
- ["_version"]=>
- string(%d) "%s"
+ [%u|b%"_version"]=>
+ %unicode|string%(%d) "%s"
}
}
bool(false)
array(3) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
[2]=>
array(1) {
- ["id"]=>
- string(1) "3"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
}
}
array(3) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "3"
- ["label"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "c"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
}
[2]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
bool(false)
array(1) {
[0]=>
array(1) {
- ["_version"]=>
- string(%d) "%s"
+ [%u|b%"_version"]=>
+ %unicode|string%(%d) "%s"
}
}
bool(false)
array(3) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
[2]=>
array(1) {
- ["id"]=>
- string(1) "3"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
}
}
array(3) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "3"
- ["label"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "c"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
}
[2]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
bool(false)
@@ -211,98 +215,98 @@ Native PS...
array(1) {
[0]=>
array(1) {
- ["_version"]=>
- string(%d) "%s"
+ [%u|b%"_version"]=>
+ %unicode|string%(%d) "%s"
}
}
bool(false)
array(3) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
[2]=>
array(1) {
- ["id"]=>
- string(1) "3"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
}
}
array(3) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "3"
- ["label"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "c"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
}
[2]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
bool(false)
array(1) {
[0]=>
array(1) {
- ["_version"]=>
- string(%d) "%s"
+ [%u|b%"_version"]=>
+ %unicode|string%(%d) "%s"
}
}
bool(false)
array(3) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
[2]=>
array(1) {
- ["id"]=>
- string(1) "3"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
}
}
array(3) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "3"
- ["label"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "c"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
}
[2]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
bool(false)
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt
index 8883b8496..17e2412de 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_rowcount.phpt
@@ -25,8 +25,12 @@ MySQLPDOTest::skip();
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt
index 0be9eacc7..f051403d8 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_unbuffered_2050.phpt
@@ -108,28 +108,32 @@ if (MYSQLPDOTest::isPDOMySQLnd())
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Native PS...
Buffered...
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
Unbuffered...
@@ -144,37 +148,37 @@ array(0) {
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt
index 853f5a385..c34f4a9d3 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_variable_columncount.phpt
@@ -118,5 +118,6 @@ if ($version < 50000)
}
print "done!";
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
index fbe0e1796..c83130d8d 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
@@ -74,6 +74,12 @@ if (version_compare(PHP_VERSION, '5.0.0', '<'))
$db->exec('DROP TABLE IF EXISTS test');
print "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
__construct('%S', '%S', '%S')
exec('DROP TABLE IF EXISTS test')
@@ -83,13 +89,13 @@ query('SELECT * FROM test ORDER BY id ASC')
array(2) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
}
bool(false)
diff --git a/ext/pdo_mysql/tests/pdo_mysql_types.phpt b/ext/pdo_mysql/tests/pdo_mysql_types.phpt
index 7bd58232c..3629ab9a3 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_types.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_types.phpt
@@ -174,5 +174,11 @@ MySQLPDOTest::skip();
echo "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
done!
diff --git a/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt b/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt
index 9d521a1b8..7c0ec3701 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt
@@ -113,5 +113,11 @@ MySQLPDOTest::skip();
echo "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
done! \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pecl_bug_5200.phpt b/ext/pdo_mysql/tests/pecl_bug_5200.phpt
index d07fe9432..ff5b0e4c3 100644
--- a/ext/pdo_mysql/tests/pecl_bug_5200.phpt
+++ b/ext/pdo_mysql/tests/pecl_bug_5200.phpt
@@ -17,7 +17,13 @@ $db->exec("CREATE TABLE test (bar INT NOT NULL, phase enum('please_select', 'I',
foreach ($db->query('DESCRIBE test phase')->fetchAll(PDO::FETCH_ASSOC) as $row) {
print_r($row);
}
-
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECT--
Array
(
diff --git a/ext/pdo_mysql/tests/pecl_bug_5780.phpt b/ext/pdo_mysql/tests/pecl_bug_5780.phpt
index 5cc349789..59842846d 100644
--- a/ext/pdo_mysql/tests/pecl_bug_5780.phpt
+++ b/ext/pdo_mysql/tests/pecl_bug_5780.phpt
@@ -26,17 +26,24 @@ $info = $logstmt->errorInfo();
unset($info[2]);
var_dump($info);
?>
---EXPECT--
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+$db->exec('DROP TABLE IF EXISTS test2');
+?>
+--EXPECTF--
array(2) {
[0]=>
- string(7) "testing"
+ %unicode|string%(7) "testing"
[1]=>
- string(7) "testing"
+ %unicode|string%(7) "testing"
}
bool(true)
array(2) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
NULL
}
diff --git a/ext/pdo_mysql/tests/pecl_bug_5802.phpt b/ext/pdo_mysql/tests/pecl_bug_5802.phpt
index fa22ecdcb..04aa2c955 100644
--- a/ext/pdo_mysql/tests/pecl_bug_5802.phpt
+++ b/ext/pdo_mysql/tests/pecl_bug_5802.phpt
@@ -32,21 +32,30 @@ $stmt = $db->prepare('select * from test') or var_dump($db->errorInfo());
if($stmt) $stmt->execute();
if($stmt) var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
---EXPECT--
+print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
+--EXPECTF--
array(3) {
[0]=>
array(1) {
- ["bar"]=>
- string(3) "foo"
+ [%u|b%"bar"]=>
+ %unicode|string%(3) "foo"
}
[1]=>
array(1) {
- ["bar"]=>
+ [%u|b%"bar"]=>
NULL
}
[2]=>
array(1) {
- ["bar"]=>
- string(3) "qaz"
+ [%u|b%"bar"]=>
+ %unicode|string%(3) "qaz"
}
}
+done! \ No newline at end of file