summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_mysql')
-rwxr-xr-xext/pdo_mysql/CREDITS3
-rwxr-xr-xext/pdo_mysql/config.m4140
-rw-r--r--ext/pdo_mysql/config.w3214
-rw-r--r--ext/pdo_mysql/get_error_codes.php27
-rwxr-xr-xext/pdo_mysql/mysql_driver.c601
-rwxr-xr-xext/pdo_mysql/mysql_statement.c642
-rw-r--r--ext/pdo_mysql/package2.xml93
-rwxr-xr-xext/pdo_mysql/pdo_mysql.c116
-rwxr-xr-xext/pdo_mysql/php_pdo_mysql.h53
-rwxr-xr-xext/pdo_mysql/php_pdo_mysql_int.h90
-rw-r--r--ext/pdo_mysql/php_pdo_mysql_sqlstate.h388
-rw-r--r--ext/pdo_mysql/tests/bug_33689.phpt52
-rw-r--r--ext/pdo_mysql/tests/bug_37445.phpt21
-rw-r--r--ext/pdo_mysql/tests/common.phpt28
-rw-r--r--ext/pdo_mysql/tests/config.inc19
-rw-r--r--ext/pdo_mysql/tests/last_insert_id.phpt36
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5200.phpt31
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5780.phpt42
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5802.phpt53
-rw-r--r--ext/pdo_mysql/tests/show_tables.phpt21
20 files changed, 0 insertions, 2470 deletions
diff --git a/ext/pdo_mysql/CREDITS b/ext/pdo_mysql/CREDITS
deleted file mode 100755
index 0bee1ee76e..0000000000
--- a/ext/pdo_mysql/CREDITS
+++ /dev/null
@@ -1,3 +0,0 @@
-mySQL driver for PDO
-George Schlossnagle, Wez Furlong, Ilia Alshanetsky
-
diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4
deleted file mode 100755
index 12efdf9785..0000000000
--- a/ext/pdo_mysql/config.m4
+++ /dev/null
@@ -1,140 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-if test "$PHP_PDO" != "no"; then
-
-AC_DEFUN([PDO_MYSQL_LIB_CHK], [
- str="$PDO_MYSQL_DIR/$1/libmysqlclient*"
- for j in `echo $str`; do
- if test -r $j; then
- PDO_MYSQL_LIB_DIR=$MYSQL_DIR/$1
- break 2
- fi
- done
-])
-
-PHP_ARG_WITH(pdo-mysql, for MySQL support for PDO,
-[ --with-pdo-mysql[=DIR] PDO: MySQL support. DIR is the MySQL base directory])
-
-if test "$PHP_PDO_MYSQL" != "no"; then
- 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_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"`
- else
- PDO_MYSQL_LIBNAME=mysqlclient
- 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
- AC_MSG_RESULT([not found])
- AC_MSG_CHECKING([for mysql install under $PDO_MYSQL_DIR])
- if test -r $PDO_MYSQL_DIR/include/mysql; then
- PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include/mysql
- else
- PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include
- fi
- if test -r $PDO_MYSQL_DIR/lib/mysql; then
- PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/lib/mysql
- else
- PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/lib
- fi
-
- if test -r "$PDO_MYSQL_LIB_DIR"; then
- AC_MSG_RESULT([libs under $PDO_MYSQL_LIB_DIR; seems promising])
- else
- AC_MSG_RESULT([can not find it])
- AC_MSG_ERROR([Unable to find your mysql installation])
- fi
-
- PHP_ADD_LIBRARY_WITH_PATH($PDO_MYSQL_LIBNAME, $PDO_MYSQL_LIB_DIR, PDO_MYSQL_SHARED_LIBADD)
- PHP_ADD_INCLUDE($PDO_MYSQL_INC_DIR)
- PDO_MYSQL_INCLUDE=-I$PDO_MYSQL_INC_DIR
- 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)
- PHP_EVAL_LIBLINE($PDO_MYSQL_LIBS, PDO_MYSQL_SHARED_LIBADD)
- ],[
- AC_MSG_ERROR([mysql_query missing!?])
- ],[
- $PDO_MYSQL_LIBS
- ])
- _SAVE_LIBS=$LIBS
- LIBS="$LIBS $PDO_MYSQL_LIBS"
- AC_CHECK_FUNCS([mysql_commit mysql_stmt_prepare mysql_next_result mysql_sqlstate])
- LIBS=$_SAVE_LIBS
-
- ifdef([PHP_CHECK_PDO_INCLUDES],
- [
- PHP_CHECK_PDO_INCLUDES
- ],[
- AC_MSG_CHECKING([for PDO includes])
- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- else
- AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
- fi
- AC_MSG_RESULT($pdo_inc_path)
- ])
-
- PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path)
- ifdef([PHP_ADD_EXTENSION_DEP],
- [
- PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
- ])
- PDO_MYSQL_MODULE_TYPE=external
-
- PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)
- PHP_SUBST_OLD(PDO_MYSQL_MODULE_TYPE)
-fi
-
-fi
-dnl vim: se ts=2 sw=2 et:
diff --git a/ext/pdo_mysql/config.w32 b/ext/pdo_mysql/config.w32
deleted file mode 100644
index 1fce9e5dbf..0000000000
--- a/ext/pdo_mysql/config.w32
+++ /dev/null
@@ -1,14 +0,0 @@
-// $Id$
-// vim:ft=javascript
-
-ARG_WITH("pdo-mysql", "MySQL support for PDO", "no");
-
-if (PHP_PDO_MYSQL != "no") {
- if (CHECK_LIB("libmysql.lib", "pdo_mysql", PHP_PDO_MYSQL) &&
- CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_PDO_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_PDO_MYSQL)) {
- EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c");
- } else {
- WARNING("pdo_mysql not enabled; libraries and headers not found");
- }
- ADD_EXTENSION_DEP('pdo_mysql', 'pdo');
-}
diff --git a/ext/pdo_mysql/get_error_codes.php b/ext/pdo_mysql/get_error_codes.php
deleted file mode 100644
index 2785c93b99..0000000000
--- a/ext/pdo_mysql/get_error_codes.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
- $codes = array();
- $maxlen = 0;
-
- while (!feof(STDIN)) {
- $line = fgets(STDIN);
-
- if (ereg('^(ER_.*),[[:space:]]+"(.*)",[[:space:]]+"(.*)"', $line, $matches)) {
- $codes[$matches[1]] = $matches[2];
- $maxlen = max($maxlen, strlen($matches[1]));
- }
- }
-
- if (empty($codes)) {
- fputs(STDERR, "input doesn't look like a MySQL sql_state.h file\n");
- exit(3);
- }
-
- echo "/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */\n";
- foreach ($codes as $code => $state) {
- echo "#ifdef $code\n";
- printf(" case %-{$maxlen}s: return \"%s\";\n", $code, $state);
- echo "#endif\n";
- }
-
-
-?> \ No newline at end of file
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
deleted file mode 100755
index 9b77ea5537..0000000000
--- a/ext/pdo_mysql/mysql_driver.c
+++ /dev/null
@@ -1,601 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 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 |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: George Schlossnagle <george@omniti.com> |
- | Wez Furlong <wez@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "pdo/php_pdo.h"
-#include "pdo/php_pdo_driver.h"
-#include "php_pdo_mysql.h"
-#include "php_pdo_mysql_int.h"
-#include <mysqld_error.h>
-#include "zend_exceptions.h"
-
-
-const char *pdo_mysql_get_sqlstate(unsigned int my_errno) {
- switch (my_errno) {
- /* import auto-generated case: code */
-#include "php_pdo_mysql_sqlstate.h"
- default: return "HY000";
- }
-}
-
-int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC) /* {{{ */
-{
- pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
- pdo_error_type *pdo_err;
- pdo_mysql_error_info *einfo;
- pdo_mysql_stmt *S = NULL;
-
- if (stmt) {
- S = (pdo_mysql_stmt*)stmt->driver_data;
- pdo_err = &stmt->error_code;
- einfo = &S->einfo;
- } else {
- pdo_err = &dbh->error_code;
- einfo = &H->einfo;
- }
-
-#if HAVE_MYSQL_STMT_PREPARE
- if (S && S->stmt) {
- einfo->errcode = mysql_stmt_errno(S->stmt);
- }
- else
-#endif
- {
- einfo->errcode = mysql_errno(H->server);
- }
-
- einfo->file = file;
- einfo->line = line;
-
- if (einfo->errmsg) {
- pefree(einfo->errmsg, dbh->is_persistent);
- einfo->errmsg = NULL;
- }
-
- if (einfo->errcode) {
- if (2014 != einfo->errcode) {
- einfo->errmsg = pestrdup(mysql_error(H->server), dbh->is_persistent);
- } else {
- einfo->errmsg = pestrdup(
- "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.",
- dbh->is_persistent);
- }
- } else { /* no error */
- strcpy(*pdo_err, PDO_ERR_NONE);
- return 0;
- }
-
-#if HAVE_MYSQL_SQLSTATE
-# if HAVE_MYSQL_STMT_PREPARE
- if (S && S->stmt) {
- strcpy(*pdo_err, mysql_stmt_sqlstate(S->stmt));
- } else
-# endif
- {
- strcpy(*pdo_err, mysql_sqlstate(H->server));
- }
-#else
- strcpy(*pdo_err, pdo_mysql_get_sqlstate(einfo->errcode));
-#endif
-
- if (!dbh->methods) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
- *pdo_err, einfo->errcode, einfo->errmsg);
- }
-/* printf("** [%s:%d] %s %s\n", file, line, *pdo_err, einfo->errmsg); */
-
- return einfo->errcode;
-}
-/* }}} */
-
-static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
-{
- pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
- pdo_mysql_error_info *einfo = &H->einfo;
-
- if (stmt) {
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
- einfo = &S->einfo;
- } else {
- einfo = &H->einfo;
- }
-
- if (einfo->errcode) {
- add_next_index_long(info, einfo->errcode);
- add_next_index_string(info, einfo->errmsg, 1);
- }
-
- return 1;
-}
-
-static int mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
-{
- pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
-
- if (H) {
- if (H->server) {
- mysql_close(H->server);
- H->server = NULL;
- }
- if (H->einfo.errmsg) {
- pefree(H->einfo.errmsg, dbh->is_persistent);
- H->einfo.errmsg = NULL;
- }
- pefree(H, dbh->is_persistent);
- dbh->driver_data = NULL;
- }
- return 0;
-}
-/* }}} */
-
-static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
-{
- pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
- pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt));
-#if HAVE_MYSQL_STMT_PREPARE
- char *nsql = NULL;
- int nsql_len = 0;
- int ret;
- int server_version;
-#endif
-
- S->H = H;
- stmt->driver_data = S;
- stmt->methods = &mysql_stmt_methods;
-
- if (H->emulate_prepare) {
- goto end;
- }
-
-#if HAVE_MYSQL_STMT_PREPARE
- server_version = mysql_get_server_version(H->server);
- if (server_version < 40100) {
- goto fallback;
- }
- stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL;
- ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
-
- if (ret == 1) {
- /* query was rewritten */
- sql = nsql;
- sql_len = nsql_len;
- } else if (ret == -1) {
- /* failed to parse */
- strcpy(dbh->error_code, stmt->error_code);
- return 0;
- }
-
- if (!(S->stmt = mysql_stmt_init(H->server))) {
- pdo_mysql_error(dbh);
- if (nsql) {
- efree(nsql);
- }
- return 0;
- }
-
- if (mysql_stmt_prepare(S->stmt, sql, sql_len)) {
- /* TODO: might need to pull statement specific info here? */
- /* if the query isn't supported by the protocol, fallback to emulation */
- if (mysql_errno(H->server) == 1295) {
- if (nsql) {
- efree(nsql);
- }
- goto fallback;
- }
- pdo_mysql_error(dbh);
- if (nsql) {
- efree(nsql);
- }
- return 0;
- }
- if (nsql) {
- efree(nsql);
- }
-
- S->num_params = mysql_stmt_param_count(S->stmt);
-
- if (S->num_params) {
- S->params = ecalloc(S->num_params, sizeof(MYSQL_BIND));
- S->in_null = ecalloc(S->num_params, sizeof(my_bool));
- S->in_length = ecalloc(S->num_params, sizeof(unsigned long));
- }
-
- dbh->alloc_own_columns = 1;
-
- S->max_length = pdo_attr_lval(driver_options, PDO_ATTR_MAX_COLUMN_LEN, 0 TSRMLS_CC);
-
- return 1;
-
-fallback:
-#endif
-end:
- stmt->supports_placeholders = PDO_PLACEHOLDER_NONE;
-
- return 1;
-}
-
-static long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC)
-{
- pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
-
- if (mysql_real_query(H->server, sql, sql_len)) {
- pdo_mysql_error(dbh);
- return -1;
- } else {
- my_ulonglong c = mysql_affected_rows(H->server);
- if (c == (my_ulonglong) -1) {
- pdo_mysql_error(dbh);
- return (H->einfo.errcode ? -1 : 0);
- } else {
- return c;
- }
- }
-}
-
-static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
-{
- pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
- char *id = php_pdo_int64_to_str(mysql_insert_id(H->server) TSRMLS_CC);
- *len = strlen(id);
- return id;
-}
-
-static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
-{
- pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
- *quoted = safe_emalloc(2, unquotedlen, 3);
- *quotedlen = mysql_real_escape_string(H->server, *quoted + 1, unquoted, unquotedlen);
- (*quoted)[0] =(*quoted)[++*quotedlen] = '\'';
- (*quoted)[++*quotedlen] = '\0';
- return 1;
-}
-
-static int mysql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
-{
- return 0 <= mysql_handle_doer(dbh, ZEND_STRL("START TRANSACTION") TSRMLS_CC);
-}
-
-static int mysql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
-{
- return 0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT") TSRMLS_CC);
-}
-
-static int mysql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
-{
- return 0 <= mysql_handle_doer(dbh, ZEND_STRL("ROLLBACK") TSRMLS_CC);
-}
-
-static int mysql_handle_autocommit(pdo_dbh_t *dbh TSRMLS_DC)
-{
- if (dbh->auto_commit) {
- return 0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=1") TSRMLS_CC);
- } else {
- return 0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=0") TSRMLS_CC);
- }
-}
-
-static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
-{
- switch (attr) {
- case PDO_ATTR_AUTOCOMMIT:
-
- convert_to_boolean(val);
-
- /* ignore if the new value equals the old one */
- if (dbh->auto_commit ^ Z_BVAL_P(val)) {
- dbh->auto_commit = Z_BVAL_P(val);
- mysql_handle_autocommit(dbh TSRMLS_CC);
- }
- return 1;
-
- case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY:
- ((pdo_mysql_db_handle *)dbh->driver_data)->buffered = Z_BVAL_P(val);
- return 1;
- case PDO_MYSQL_ATTR_DIRECT_QUERY:
- case PDO_ATTR_EMULATE_PREPARES:
- ((pdo_mysql_db_handle *)dbh->driver_data)->emulate_prepare = Z_BVAL_P(val);
- return 1;
- default:
- return 0;
- }
-}
-
-static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC)
-{
- pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
-
- switch (attr) {
- case PDO_ATTR_CLIENT_VERSION:
- ZVAL_STRING(return_value, (char *)mysql_get_client_info(), 1);
- break;
-
- case PDO_ATTR_SERVER_VERSION:
- ZVAL_STRING(return_value, (char *)mysql_get_server_info(H->server), 1);
- break;
-
- case PDO_ATTR_CONNECTION_STATUS:
- ZVAL_STRING(return_value, (char *)mysql_get_host_info(H->server), 1);
- break;
-
- case PDO_ATTR_SERVER_INFO: {
- char *tmp;
-
- if ((tmp = (char *)mysql_stat(H->server))) {
- ZVAL_STRING(return_value, tmp, 1);
- } else {
- pdo_mysql_error(dbh);
- return -1;
- }
- }
- break;
-
- case PDO_ATTR_AUTOCOMMIT:
- ZVAL_LONG(return_value, dbh->auto_commit);
- return 1;
-
- case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY:
- ZVAL_LONG(return_value, H->buffered);
- return 1;
-
- case PDO_MYSQL_ATTR_DIRECT_QUERY:
- ZVAL_LONG(return_value, H->emulate_prepare);
- return 1;
-
- case PDO_MYSQL_ATTR_MAX_BUFFER_SIZE:
- ZVAL_LONG(return_value, H->max_buffer_size);
- return 1;
-
- default:
- return 0;
- }
-
- return 1;
-}
-
-static int pdo_mysql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
-{
- pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
-#if MYSQL_VERSION_ID <= 32230
- void (*handler) (int);
- unsigned int my_errno;
-#endif
-
-#if MYSQL_VERSION_ID > 32230
- if (mysql_ping(H->server)) {
- return FAILURE;
- }
-#else /* no mysql_ping() */
- handler=signal(SIGPIPE, SIG_IGN);
- mysql_stat(H->server);
- switch (mysql_errno(H->server)) {
- case CR_SERVER_GONE_ERROR:
- /* case CR_SERVER_LOST: I'm not sure this means the same as "gone" for us */
- signal(SIGPIPE, handler);
- return FAILURE;
- default:
- break;
- }
- signal(SIGPIPE, handler);
-#endif /* end mysql_ping() */
- return SUCCESS;
-}
-/* }}} */
-
-static struct pdo_dbh_methods mysql_methods = {
- mysql_handle_closer,
- mysql_handle_preparer,
- mysql_handle_doer,
- mysql_handle_quoter,
- mysql_handle_begin,
- mysql_handle_commit,
- mysql_handle_rollback,
- pdo_mysql_set_attribute,
- pdo_mysql_last_insert_id,
- pdo_mysql_fetch_error_func,
- pdo_mysql_get_attribute,
- pdo_mysql_check_liveness
-};
-
-#ifndef PDO_MYSQL_UNIX_ADDR
-# ifdef PHP_WIN32
-# define PDO_MYSQL_UNIX_ADDR "MySQL"
-# else
-# define PDO_MYSQL_UNIX_ADDR "/tmp/mysql.sock"
-# endif
-#endif
-
-static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
-{
- pdo_mysql_db_handle *H;
- int i, ret = 0;
- char *host = NULL, *unix_socket = NULL;
- unsigned int port = 3306;
- char *dbname;
- struct pdo_data_src_parser vars[] = {
- { "charset", NULL, 0 },
- { "dbname", "", 0 },
- { "host", "localhost", 0 },
- { "port", "3306", 0 },
- { "unix_socket", PDO_MYSQL_UNIX_ADDR, 0 },
- };
- int connect_opts = 0
-#ifdef CLIENT_MULTI_RESULTS
- |CLIENT_MULTI_RESULTS
-#endif
-#ifdef CLIENT_MULTI_STATEMENTS
- |CLIENT_MULTI_STATEMENTS
-#endif
- ;
-
- php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5);
-
- H = pecalloc(1, sizeof(pdo_mysql_db_handle), dbh->is_persistent);
-
- H->einfo.errcode = 0;
- H->einfo.errmsg = NULL;
-
- /* at the time of writing, the mysql documentation states:
- * http://mysql.localhost.net.ar/doc/refman/5.0/en/query-cache-how.html
- * "A query also is not cached under these conditions:
- * ...
- * It was issued as a prepared statement, even if no placeholders were employed."
- *
- * We default to emulating prepared statements
- * in order to take advantage of the query cache
-FIXME: H->emulate_prepare = 1; a bit risky to do this so late in the RC, so defer it.
- */
-
- /* allocate an environment */
-
- /* handle for the server */
- if (!(H->server = mysql_init(NULL))) {
- pdo_mysql_error(dbh);
- goto cleanup;
- }
-
- dbh->driver_data = H;
- H->max_buffer_size = 1024*1024;
-
- /* handle MySQL options */
- if (driver_options) {
- long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC);
- long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0 TSRMLS_CC);
- char *init_cmd = NULL, *default_file = NULL, *default_group = NULL;
-
- H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 0 TSRMLS_CC);
-
- H->emulate_prepare = pdo_attr_lval(driver_options,
- PDO_MYSQL_ATTR_DIRECT_QUERY, H->emulate_prepare TSRMLS_CC);
- H->emulate_prepare = pdo_attr_lval(driver_options,
- PDO_ATTR_EMULATE_PREPARES, H->emulate_prepare TSRMLS_CC);
-
- H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, H->max_buffer_size TSRMLS_CC);
-
- if (mysql_options(H->server, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout)) {
- pdo_mysql_error(dbh);
- goto cleanup;
- }
-
- if (mysql_options(H->server, MYSQL_OPT_LOCAL_INFILE, (const char *)&local_infile)) {
- pdo_mysql_error(dbh);
- goto cleanup;
- }
-
-#ifdef MYSQL_OPT_RECONNECT
- /* since 5.0.3, the default for this option is 0 if not specified.
- * we want the old behaviour */
- {
- long reconnect = 1;
- mysql_options(H->server, MYSQL_OPT_RECONNECT, (const char*)&reconnect);
- }
-#endif
-
- init_cmd = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_INIT_COMMAND, NULL TSRMLS_CC);
- if (init_cmd) {
- if (mysql_options(H->server, MYSQL_INIT_COMMAND, (const char *)init_cmd)) {
- efree(init_cmd);
- pdo_mysql_error(dbh);
- goto cleanup;
- }
- efree(init_cmd);
- }
-
- default_file = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_FILE, NULL TSRMLS_CC);
- if (default_file) {
- if (mysql_options(H->server, MYSQL_READ_DEFAULT_FILE, (const char *)default_file)) {
- efree(default_file);
- pdo_mysql_error(dbh);
- goto cleanup;
- }
- efree(default_file);
- }
-
- default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL TSRMLS_CC);
- if (default_group) {
- if (mysql_options(H->server, MYSQL_READ_DEFAULT_GROUP, (const char *)default_group)) {
- efree(default_group);
- pdo_mysql_error(dbh);
- goto cleanup;
- }
- efree(default_group);
- }
- }
-
- dbname = vars[1].optval;
- host = vars[2].optval;
- if(vars[3].optval) {
- port = atoi(vars[3].optval);
- }
- if (vars[2].optval && !strcmp("localhost", vars[2].optval)) {
- unix_socket = vars[4].optval;
- }
- if (mysql_real_connect(H->server, host, dbh->username, dbh->password, dbname, port, unix_socket, connect_opts) == NULL) {
- pdo_mysql_error(dbh);
- goto cleanup;
- }
-
- if (!dbh->auto_commit) {
- mysql_handle_autocommit(dbh TSRMLS_CC);
- }
-
- H->attached = 1;
-
- dbh->alloc_own_columns = 1;
- dbh->max_escaped_char_length = 2;
- dbh->methods = &mysql_methods;
-
- ret = 1;
-
-cleanup:
- for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) {
- if (vars[i].freeme) {
- efree(vars[i].optval);
- }
- }
-
- dbh->methods = &mysql_methods;
-
- return ret;
-}
-/* }}} */
-
-pdo_driver_t pdo_mysql_driver = {
- PDO_DRIVER_HEADER(mysql),
- pdo_mysql_handle_factory
-};
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
deleted file mode 100755
index 920702b3c9..0000000000
--- a/ext/pdo_mysql/mysql_statement.c
+++ /dev/null
@@ -1,642 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 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 |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: George Schlossnagle <george@omniti.com> |
- | Wez Furlong <wez@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "pdo/php_pdo.h"
-#include "pdo/php_pdo_driver.h"
-#include "php_pdo_mysql.h"
-#include "php_pdo_mysql_int.h"
-
-
-static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
-{
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
-
- if (S->result) {
- /* free the resource */
- mysql_free_result(S->result);
- S->result = NULL;
- }
- if (S->einfo.errmsg) {
- pefree(S->einfo.errmsg, stmt->dbh->is_persistent);
- S->einfo.errmsg = NULL;
- }
-#if HAVE_MYSQL_STMT_PREPARE
- if (S->stmt) {
- mysql_stmt_close(S->stmt);
- S->stmt = NULL;
- }
- if (S->params) {
- efree(S->params);
- efree(S->in_null);
- efree(S->in_length);
- }
- if (S->bound_result)
- {
- int i;
- for (i = 0; i < stmt->column_count; i++) {
- efree(S->bound_result[i].buffer);
- }
-
- efree(S->bound_result);
- efree(S->out_null);
- efree(S->out_length);
- }
-#endif
-#if HAVE_MYSQL_NEXT_RESULT
- while (mysql_more_results(S->H->server)) {
- MYSQL_RES *res;
- if (mysql_next_result(S->H->server) != 0) {
- break;
- }
-
- res = mysql_store_result(S->H->server);
- if (res) {
- mysql_free_result(res);
- }
- }
-#endif
- efree(S);
- return 1;
-}
-
-static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
-{
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
- pdo_mysql_db_handle *H = S->H;
- my_ulonglong row_count;
-#if HAVE_MYSQL_STMT_PREPARE
- int i;
-
- if (S->stmt) {
- /* (re)bind the parameters */
- if (mysql_stmt_bind_param(S->stmt, S->params)) {
- pdo_mysql_error_stmt(stmt);
- return 0;
- }
-
- if (mysql_stmt_execute(S->stmt)) {
- pdo_mysql_error_stmt(stmt);
- return 0;
- }
-
- if (!S->result) {
- /* figure out the result set format, if any */
- S->result = mysql_stmt_result_metadata(S->stmt);
- if (S->result) {
- int calc_max_length = H->buffered && S->max_length == 1;
-
- S->fields = mysql_fetch_fields(S->result);
-
- if (S->bound_result) {
- int i;
- for (i = 0; i < stmt->column_count; i++) {
- efree(S->bound_result[i].buffer);
- }
- efree(S->bound_result);
- efree(S->out_null);
- efree(S->out_length);
- }
-
- stmt->column_count = (int)mysql_num_fields(S->result);
- S->bound_result = ecalloc(stmt->column_count, sizeof(MYSQL_BIND));
- S->out_null = ecalloc(stmt->column_count, sizeof(my_bool));
- S->out_length = ecalloc(stmt->column_count, sizeof(unsigned long));
-
- /* summon memory to hold the row */
- for (i = 0; i < stmt->column_count; i++) {
- if (calc_max_length && S->fields[i].type == FIELD_TYPE_BLOB) {
- my_bool on = 1;
- mysql_stmt_attr_set(S->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &on);
- calc_max_length = 0;
- }
- switch (S->fields[i].type) {
- case FIELD_TYPE_INT24:
- S->bound_result[i].buffer_length = MAX_MEDIUMINT_WIDTH;
- break;
- case FIELD_TYPE_LONG:
- S->bound_result[i].buffer_length = MAX_INT_WIDTH;
- break;
- case FIELD_TYPE_LONGLONG:
- S->bound_result[i].buffer_length = MAX_BIGINT_WIDTH;
- break;
- case FIELD_TYPE_TINY:
- S->bound_result[i].buffer_length = MAX_TINYINT_WIDTH;
- break;
- case FIELD_TYPE_SHORT:
- S->bound_result[i].buffer_length = MAX_SMALLINT_WIDTH;
- break;
- default:
- S->bound_result[i].buffer_length =
- S->fields[i].max_length? S->fields[i].max_length:
- S->fields[i].length;
- /* work-around for longtext and alike */
- if (S->bound_result[i].buffer_length > H->max_buffer_size) {
- S->bound_result[i].buffer_length = H->max_buffer_size;
- }
- }
-#if 0
- printf("%d: max_length=%d length=%d buffer_length=%d type=%d\n",
- i,
- S->fields[i].max_length,
- S->fields[i].length,
- S->bound_result[i].buffer_length,
- S->fields[i].type
- );
-#endif
-
- /* there are cases where the length reported by mysql is too short.
- * eg: when describing a table that contains an enum column. Since
- * we have no way of knowing the true length either, we'll bump up
- * our buffer size to a reasonable size, just in case */
- if (S->fields[i].max_length == 0 && S->bound_result[i].buffer_length < 128 && MYSQL_TYPE_VAR_STRING) {
- S->bound_result[i].buffer_length = 128;
- }
-
- S->out_length[i] = 0;
-
- S->bound_result[i].buffer = emalloc(S->bound_result[i].buffer_length);
- S->bound_result[i].is_null = &S->out_null[i];
- S->bound_result[i].length = &S->out_length[i];
- S->bound_result[i].buffer_type = MYSQL_TYPE_STRING;
- }
-
- if (mysql_stmt_bind_result(S->stmt, S->bound_result)) {
- pdo_mysql_error_stmt(stmt);
- return 0;
- }
-
- /* if buffered, pre-fetch all the data */
- if (H->buffered) {
- mysql_stmt_store_result(S->stmt);
- }
- }
- }
-
- row_count = mysql_stmt_affected_rows(S->stmt);
- if (row_count != (my_ulonglong)-1) {
- stmt->row_count = row_count;
- }
- return 1;
- }
-#endif
- /* ensure that we free any previous unfetched results */
- if (S->result) {
- mysql_free_result(S->result);
- S->result = NULL;
- }
-
- if (mysql_real_query(H->server, stmt->active_query_string, stmt->active_query_stringlen) != 0) {
- pdo_mysql_error_stmt(stmt);
- return 0;
- }
-
- row_count = mysql_affected_rows(H->server);
- if (row_count == (my_ulonglong)-1) {
- /* we either have a query that returned a result set or an error occured
- lets see if we have access to a result set */
- if (!H->buffered) {
- S->result = mysql_use_result(H->server);
- } else {
- S->result = mysql_store_result(H->server);
- }
- if (NULL == S->result) {
- pdo_mysql_error_stmt(stmt);
- return 0;
- }
-
- stmt->row_count = 0;
-
- if (!stmt->executed) {
- stmt->column_count = (int) mysql_num_fields(S->result);
- S->fields = mysql_fetch_fields(S->result);
- }
- } else {
- /* this was a DML or DDL query (INSERT, UPDATE, DELETE, ... */
- stmt->row_count = row_count;
- }
-
- return 1;
-}
-
-static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
-{
-#if HAVE_MYSQL_NEXT_RESULT
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
- pdo_mysql_db_handle *H = S->H;
- my_ulonglong row_count;
- int ret;
-
- /* ensure that we free any previous unfetched results */
-#if HAVE_MYSQL_STMT_PREPARE
- if (S->stmt) {
- mysql_stmt_free_result(S->stmt);
- }
-#endif
- if (S->result) {
- mysql_free_result(S->result);
- S->result = NULL;
- }
-
- ret = mysql_next_result(H->server);
-
- if (ret > 0) {
- pdo_mysql_error_stmt(stmt);
- return 0;
- } else if (ret < 0) {
- /* No more results */
- return 0;
- } else {
- if ((my_ulonglong)-1 == (row_count = mysql_affected_rows(H->server))) {
- pdo_mysql_error_stmt(stmt);
- return 0;
- }
-
- if (!H->buffered) {
- S->result = mysql_use_result(H->server);
- } else {
- S->result = mysql_store_result(H->server);
- }
-
- if (NULL == S->result) {
- return 0;
- }
-
- stmt->row_count = row_count;
- stmt->column_count = (int) mysql_num_fields(S->result);
- S->fields = mysql_fetch_fields(S->result);
- return 1;
- }
-#else
- strcpy(stmt->error_code, "HYC00");
- return 0;
-#endif
-}
-
-
-static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
- enum pdo_param_event event_type TSRMLS_DC)
-{
-#if HAVE_MYSQL_STMT_PREPARE
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
- MYSQL_BIND *b;
-
- if (S->stmt && param->is_param) {
- switch (event_type) {
- case PDO_PARAM_EVT_ALLOC:
- /* sanity check parameter number range */
- if (param->paramno < 0 || param->paramno >= S->num_params) {
- strcpy(stmt->error_code, "HY093");
- return 0;
- }
- b = &S->params[param->paramno];
- param->driver_data = b;
- b->is_null = &S->in_null[param->paramno];
- b->length = &S->in_length[param->paramno];
- return 1;
-
- case PDO_PARAM_EVT_EXEC_PRE:
- b = (MYSQL_BIND*)param->driver_data;
-
- *b->is_null = 0;
- if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL ||
- Z_TYPE_P(param->parameter) == IS_NULL) {
- *b->is_null = 1;
- b->buffer_type = MYSQL_TYPE_STRING;
- b->buffer = NULL;
- b->buffer_length = 0;
- *b->length = 0;
- return 1;
- }
-
- switch (PDO_PARAM_TYPE(param->param_type)) {
- case PDO_PARAM_STMT:
- return 0;
- case PDO_PARAM_LOB:
- if (Z_TYPE_P(param->parameter) == IS_RESOURCE) {
- php_stream *stm;
- php_stream_from_zval_no_verify(stm, &param->parameter);
- if (stm) {
- SEPARATE_ZVAL_IF_NOT_REF(&param->parameter);
- Z_TYPE_P(param->parameter) = IS_STRING;
- Z_STRLEN_P(param->parameter) = php_stream_copy_to_mem(stm,
- &Z_STRVAL_P(param->parameter), PHP_STREAM_COPY_ALL, 0);
- } else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
- return 0;
- }
- }
- /* fall through */
-
- default:
- ;
- }
-
- switch (Z_TYPE_P(param->parameter)) {
- case IS_STRING:
- b->buffer_type = MYSQL_TYPE_STRING;
- b->buffer = Z_STRVAL_P(param->parameter);
- b->buffer_length = Z_STRLEN_P(param->parameter);
- *b->length = Z_STRLEN_P(param->parameter);
- return 1;
-
- case IS_LONG:
- b->buffer_type = MYSQL_TYPE_LONG;
- b->buffer = &Z_LVAL_P(param->parameter);
- return 1;
-
- case IS_DOUBLE:
- b->buffer_type = MYSQL_TYPE_DOUBLE;
- b->buffer = &Z_DVAL_P(param->parameter);
- return 1;
-
- default:
- return 0;
- }
- }
- }
-#endif
- return 1;
-}
-
-static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, long offset TSRMLS_DC)
-{
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
-#if HAVE_MYSQL_STMT_PREPARE
- int ret;
-
- if (S->stmt) {
- ret = mysql_stmt_fetch(S->stmt);
-
-#ifdef MYSQL_DATA_TRUNCATED
- if (ret == MYSQL_DATA_TRUNCATED) {
- ret = 0;
- }
-#endif
-
- if (ret) {
- if (ret != MYSQL_NO_DATA) {
- pdo_mysql_error_stmt(stmt);
- }
- return 0;
- }
-
- return 1;
- }
-#endif
-
- if (!S->result) {
- return 0;
- }
- if ((S->current_data = mysql_fetch_row(S->result)) == NULL) {
- if (mysql_errno(S->H->server)) {
- pdo_mysql_error_stmt(stmt);
- }
- return 0;
- }
- S->current_lengths = mysql_fetch_lengths(S->result);
- return 1;
-}
-
-static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
-{
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
- struct pdo_column_data *cols = stmt->columns;
- unsigned int i;
-
- if (!S->result) {
- return 0;
- }
-
- if (colno >= stmt->column_count) {
- /* error invalid column */
- return 0;
- }
-
- /* fetch all on demand, this seems easiest
- ** if we've been here before bail out
- */
- if (cols[0].name) {
- return 1;
- }
- for (i=0; i < stmt->column_count; i++) {
- int namelen;
- namelen = strlen(S->fields[i].name);
- cols[i].precision = S->fields[i].decimals;
- cols[i].maxlen = S->fields[i].length;
- cols[i].namelen = namelen;
- cols[i].name = estrndup(S->fields[i].name, namelen);
- cols[i].param_type = PDO_PARAM_STR;
- }
- return 1;
-}
-
-static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC)
-{
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
-
-#if HAVE_MYSQL_STMT_PREPARE
- if (!S->stmt) {
-#endif
- if (S->current_data == NULL || !S->result) {
- return 0;
- }
-#if HAVE_MYSQL_STMT_PREPARE
- }
-#endif
- if (colno >= stmt->column_count) {
- /* error invalid column */
- return 0;
- }
-#if HAVE_MYSQL_STMT_PREPARE
- if (S->stmt) {
- if (S->out_null[colno]) {
- *ptr = NULL;
- *len = 0;
- return 1;
- }
- *ptr = S->bound_result[colno].buffer;
- if (S->out_length[colno] > S->bound_result[colno].buffer_length) {
- /* mysql lied about the column width */
- strcpy(stmt->error_code, "01004"); /* truncated */
- S->out_length[colno] = S->bound_result[colno].buffer_length;
- *len = S->out_length[colno];
- return 0;
- }
- *len = S->out_length[colno];
- return 1;
- }
-#endif
- *ptr = S->current_data[colno];
- *len = S->current_lengths[colno];
- return 1;
-}
-
-static char *type_to_name_native(int type)
-{
-#define PDO_MYSQL_NATIVE_TYPE_NAME(x) case FIELD_TYPE_##x: return #x;
-
- switch (type) {
- PDO_MYSQL_NATIVE_TYPE_NAME(STRING)
- PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING)
-#ifdef MYSQL_HAS_TINY
- PDO_MYSQL_NATIVE_TYPE_NAME(TINY)
-#endif
- PDO_MYSQL_NATIVE_TYPE_NAME(SHORT)
- PDO_MYSQL_NATIVE_TYPE_NAME(LONG)
- PDO_MYSQL_NATIVE_TYPE_NAME(LONGLONG)
- PDO_MYSQL_NATIVE_TYPE_NAME(INT24)
- PDO_MYSQL_NATIVE_TYPE_NAME(FLOAT)
- PDO_MYSQL_NATIVE_TYPE_NAME(DOUBLE)
- PDO_MYSQL_NATIVE_TYPE_NAME(DECIMAL)
-#ifdef FIELD_TYPE_NEWDECIMAL
- PDO_MYSQL_NATIVE_TYPE_NAME(NEWDECIMAL)
-#endif
-#ifdef FIELD_TYPE_GEOMETRY
- PDO_MYSQL_NATIVE_TYPE_NAME(GEOMETRY)
-#endif
- PDO_MYSQL_NATIVE_TYPE_NAME(TIMESTAMP)
-#ifdef MYSQL_HAS_YEAR
- PDO_MYSQL_NATIVE_TYPE_NAME(YEAR)
-#endif
- PDO_MYSQL_NATIVE_TYPE_NAME(SET)
- PDO_MYSQL_NATIVE_TYPE_NAME(ENUM)
- PDO_MYSQL_NATIVE_TYPE_NAME(DATE)
-#ifdef FIELD_TYPE_NEWDATE
- PDO_MYSQL_NATIVE_TYPE_NAME(NEWDATE)
-#endif
- PDO_MYSQL_NATIVE_TYPE_NAME(TIME)
- PDO_MYSQL_NATIVE_TYPE_NAME(DATETIME)
- PDO_MYSQL_NATIVE_TYPE_NAME(TINY_BLOB)
- PDO_MYSQL_NATIVE_TYPE_NAME(MEDIUM_BLOB)
- PDO_MYSQL_NATIVE_TYPE_NAME(LONG_BLOB)
- PDO_MYSQL_NATIVE_TYPE_NAME(BLOB)
- PDO_MYSQL_NATIVE_TYPE_NAME(NULL)
- default:
- return NULL;
- }
-}
-
-static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC)
-{
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
- MYSQL_FIELD *F;
- zval *flags;
- char *str;
-
- if (!S->result) {
- return FAILURE;
- }
- if (colno >= stmt->column_count) {
- /* error invalid column */
- return FAILURE;
- }
-
- array_init(return_value);
- MAKE_STD_ZVAL(flags);
- array_init(flags);
-
- F = S->fields + colno;
-
- if (F->def) {
- add_assoc_string(return_value, "mysql:def", F->def, 1);
- }
- if (IS_NOT_NULL(F->flags)) {
- add_next_index_string(flags, "not_null", 1);
- }
- if (IS_PRI_KEY(F->flags)) {
- add_next_index_string(flags, "primary_key", 1);
- }
- if (F->flags & MULTIPLE_KEY_FLAG) {
- add_next_index_string(flags, "multiple_key", 1);
- }
- if (F->flags & UNIQUE_KEY_FLAG) {
- add_next_index_string(flags, "unique_key", 1);
- }
- if (IS_BLOB(F->flags)) {
- add_next_index_string(flags, "blob", 1);
- }
- str = type_to_name_native(F->type);
- if (str) {
- add_assoc_string(return_value, "native_type", str, 1);
- }
-
- add_assoc_zval(return_value, "flags", flags);
- return SUCCESS;
-}
-
-static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
-{
- pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
-#if HAVE_MYSQL_STMT_PREPARE
- if (S->stmt) {
- int retval = mysql_stmt_free_result(S->stmt);
- return retval ? 0 : 1;
- }
-#endif
- if (S->result) {
- mysql_free_result(S->result);
- S->result = NULL;
- }
-#if HAVE_MYSQL_NEXT_RESULT
- while (mysql_more_results(S->H->server)) {
- MYSQL_RES *res;
- if (mysql_next_result(S->H->server) != 0) {
- break;
- }
- res = mysql_store_result(S->H->server);
- if (res) {
- mysql_free_result(res);
- }
- }
-#endif
- return 1;
-}
-
-struct pdo_stmt_methods mysql_stmt_methods = {
- pdo_mysql_stmt_dtor,
- pdo_mysql_stmt_execute,
- pdo_mysql_stmt_fetch,
- pdo_mysql_stmt_describe,
- pdo_mysql_stmt_get_col,
- pdo_mysql_stmt_param_hook,
- NULL, /* set_attr */
- NULL, /* get_attr */
- pdo_mysql_stmt_col_meta,
- pdo_mysql_stmt_next_rowset,
- pdo_mysql_stmt_cursor_closer
-};
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/pdo_mysql/package2.xml b/ext/pdo_mysql/package2.xml
deleted file mode 100644
index cee6cc7dea..0000000000
--- a/ext/pdo_mysql/package2.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>PDO_MYSQL</name>
- <channel>pecl.php.net</channel>
- <summary>MySQL driver for PDO</summary>
- <description>This extension provides a MySQL driver for PDO.
- </description>
- <lead>
- <name>George Schlossnagle</name>
- <user>gschlossnagle</user>
- <email>george@omniti.com</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Ilia Alshanetsky</name>
- <user>iliaa</user>
- <email>iliaa@php.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Wez Furlong</name>
- <user>wez</user>
- <email>wez@php.net</email>
- <active>yes</active>
- </lead>
- <date>2006-05-01</date>
- <version>
- <release>1.0.2</release>
- <api>1.0.2</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>
-This PECL release corresponds to PHP 5.1.3.
-
-Added PDO::ATTR_EMULATE_PREPARES which can be used to force use of emulated or
-native prepares. This attribute should can be set on the database handle, and
-will cause subsequent prepares to use emulation.
-
-- Fixed bug #36572 (cannot use native prepared statements with internal
- queries like "show master status") (Ilia)
-- Repackage using package2.xml
-- Fixed Bug #35480 and #35415, crash when using persistent connections.
-- Improved error detection for OPTIMIZE queries
-- Added PDO::MYSQL_ATTR_LOCAL_INFILE, PDO::MYSQL_ATTR_INIT_COMMAND,
- PDO::MYSQL_ATTR_READ_DEFAULT_FILE, PDO::MYSQL_ATTR_READ_DEFAULT_GROUP
-- Improved error reporting when using native prepared statements
-- Fixed PECL Bug #5193: improved bounds checking when calling getColumnMeta()
-- Fixed Bug #34630: improved (emulated) LOB support
-- Fixed Bug #34623: crash when selecting longtext fields
-- Fixed PECL Bug #5802; is_null flag was sticking
-- Fixed PECL Bug #5645; added mysql client library version information to phpinfo() output.
-
-Windows binaries can be found at http://pecl4win.php.net/ext.php/php_pdo_mysql.dll
-
- </notes>
- <contents>
- <dir name="/">
- <file name="config.m4" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="mysql_driver.c" role="src" />
- <file name="mysql_statement.c" role="src" />
- <file name="pdo_mysql.c" role="src" />
- <file name="php_pdo_mysql.h" role="src" />
- <file name="php_pdo_mysql_int.h" role="src" />
- <file name="php_pdo_mysql_sqlstate.h" role="src" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.0.3</min>
- </php>
- <pearinstaller>
- <min>1.4.0</min>
- </pearinstaller>
- <package>
- <name>pdo</name>
- <channel>pecl.php.net</channel>
- <min>1.0.3</min>
- <providesextension>PDO</providesextension>
- </package>
- </required>
- </dependencies>
- <providesextension>PDO_MYSQL</providesextension>
- <extsrcrelease />
-</package>
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
deleted file mode 100755
index a3d4c12c09..0000000000
--- a/ext/pdo_mysql/pdo_mysql.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 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 |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: George Schlossnagle <george@omniti.com> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "pdo/php_pdo.h"
-#include "pdo/php_pdo_driver.h"
-#include "php_pdo_mysql.h"
-#include "php_pdo_mysql_int.h"
-
-/* {{{ pdo_mysql_functions[] */
-zend_function_entry pdo_mysql_functions[] = {
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-/* {{{ pdo_mysql_functions[] */
-#if ZEND_MODULE_API_NO >= 20050922
-static zend_module_dep pdo_mysql_deps[] = {
- ZEND_MOD_REQUIRED("pdo")
- {NULL, NULL, NULL}
-};
-#endif
-/* }}} */
-
-/* {{{ pdo_mysql_module_entry */
-zend_module_entry pdo_mysql_module_entry = {
-#if ZEND_MODULE_API_NO >= 20050922
- STANDARD_MODULE_HEADER_EX, NULL,
- pdo_mysql_deps,
-#else
- STANDARD_MODULE_HEADER,
-#endif
- "pdo_mysql",
- pdo_mysql_functions,
- PHP_MINIT(pdo_mysql),
- PHP_MSHUTDOWN(pdo_mysql),
- NULL,
- NULL,
- PHP_MINFO(pdo_mysql),
- "1.0.2",
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-#ifdef COMPILE_DL_PDO_MYSQL
-ZEND_GET_MODULE(pdo_mysql)
-#endif
-
-/* true global environment */
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(pdo_mysql)
-{
- 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);
- REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_INIT_COMMAND", (long)PDO_MYSQL_ATTR_INIT_COMMAND);
- REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_FILE", (long)PDO_MYSQL_ATTR_READ_DEFAULT_FILE);
- REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_GROUP", (long)PDO_MYSQL_ATTR_READ_DEFAULT_GROUP);
- REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_MAX_BUFFER_SIZE", (long)PDO_MYSQL_ATTR_MAX_BUFFER_SIZE);
- REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_DIRECT_QUERY", (long)PDO_MYSQL_ATTR_DIRECT_QUERY);
-
- return php_pdo_register_driver(&pdo_mysql_driver);
-}
-/* }}} */
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(pdo_mysql)
-{
- php_pdo_unregister_driver(&pdo_mysql_driver);
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(pdo_mysql)
-{
- php_info_print_table_start();
- php_info_print_table_header(2, "PDO Driver for MySQL, client library version", mysql_get_client_info());
- php_info_print_table_end();
-}
-/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h
deleted file mode 100755
index 82b9f98d45..0000000000
--- a/ext/pdo_mysql/php_pdo_mysql.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 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 |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: George Schlossnagle <george@omniti.com> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifndef PHP_PDO_MYSQL_H
-#define PHP_PDO_MYSQL_H
-
-extern zend_module_entry pdo_mysql_module_entry;
-#define phpext_pdo_mysql_ptr &pdo_mysql_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_PDO_MYSQL_API __declspec(dllexport)
-#else
-#define PHP_PDO_MYSQL_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-PHP_MINIT_FUNCTION(pdo_mysql);
-PHP_MSHUTDOWN_FUNCTION(pdo_mysql);
-PHP_RINIT_FUNCTION(pdo_mysql);
-PHP_RSHUTDOWN_FUNCTION(pdo_mysql);
-PHP_MINFO_FUNCTION(pdo_mysql);
-
-#endif /* PHP_PDO_MYSQL_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
deleted file mode 100755
index 0ae9486c0a..0000000000
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 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 |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: George Schlossnagle <george@omniti.com> |
- | Wez Furlong <wez@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifndef PHP_PDO_MYSQL_INT_H
-#define PHP_PDO_MYSQL_INT_H
-
-#include <mysql.h>
-
-typedef struct {
- const char *file;
- int line;
- unsigned int errcode;
- char *errmsg;
-} pdo_mysql_error_info;
-
-/* stuff we use in a mySQL database handle */
-typedef struct {
- MYSQL *server;
-
- unsigned attached:1;
- unsigned buffered:1;
- unsigned emulate_prepare:1;
- unsigned _reserved:31;
- unsigned long max_buffer_size;
-
- pdo_mysql_error_info einfo;
-} pdo_mysql_db_handle;
-
-typedef struct {
- MYSQL_FIELD *def;
-} pdo_mysql_column;
-
-typedef struct {
- pdo_mysql_db_handle *H;
- MYSQL_RES *result;
- MYSQL_FIELD *fields;
- MYSQL_ROW current_data;
- long *current_lengths;
- pdo_mysql_error_info einfo;
-#if HAVE_MYSQL_STMT_PREPARE
- MYSQL_STMT *stmt;
-
- int num_params;
- MYSQL_BIND *params;
- my_bool *in_null;
- unsigned long *in_length;
-
- MYSQL_BIND *bound_result;
- my_bool *out_null;
- unsigned long *out_length;
- unsigned max_length:1;
-#endif
-} pdo_mysql_stmt;
-
-extern pdo_driver_t pdo_mysql_driver;
-
-extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC);
-#define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC)
-
-extern struct pdo_stmt_methods mysql_stmt_methods;
-
-enum {
- PDO_MYSQL_ATTR_USE_BUFFERED_QUERY = PDO_ATTR_DRIVER_SPECIFIC,
- PDO_MYSQL_ATTR_LOCAL_INFILE,
- PDO_MYSQL_ATTR_INIT_COMMAND,
- PDO_MYSQL_ATTR_READ_DEFAULT_FILE,
- PDO_MYSQL_ATTR_READ_DEFAULT_GROUP,
- PDO_MYSQL_ATTR_MAX_BUFFER_SIZE,
- PDO_MYSQL_ATTR_DIRECT_QUERY,
-};
-#endif
diff --git a/ext/pdo_mysql/php_pdo_mysql_sqlstate.h b/ext/pdo_mysql/php_pdo_mysql_sqlstate.h
deleted file mode 100644
index 97724b72e9..0000000000
--- a/ext/pdo_mysql/php_pdo_mysql_sqlstate.h
+++ /dev/null
@@ -1,388 +0,0 @@
-/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */
-#ifdef ER_DUP_KEY
- case ER_DUP_KEY : return "23000";
-#endif
-#ifdef ER_OUTOFMEMORY
- case ER_OUTOFMEMORY : return "HY001";
-#endif
-#ifdef ER_OUT_OF_SORTMEMORY
- case ER_OUT_OF_SORTMEMORY : return "HY001";
-#endif
-#ifdef ER_CON_COUNT_ERROR
- case ER_CON_COUNT_ERROR : return "08004";
-#endif
-#ifdef ER_BAD_HOST_ERROR
- case ER_BAD_HOST_ERROR : return "08S01";
-#endif
-#ifdef ER_HANDSHAKE_ERROR
- case ER_HANDSHAKE_ERROR : return "08S01";
-#endif
-#ifdef ER_DBACCESS_DENIED_ERROR
- case ER_DBACCESS_DENIED_ERROR : return "42000";
-#endif
-#ifdef ER_ACCESS_DENIED_ERROR
- case ER_ACCESS_DENIED_ERROR : return "28000";
-#endif
-#ifdef ER_NO_DB_ERROR
- case ER_NO_DB_ERROR : return "3D000";
-#endif
-#ifdef ER_UNKNOWN_COM_ERROR
- case ER_UNKNOWN_COM_ERROR : return "08S01";
-#endif
-#ifdef ER_BAD_NULL_ERROR
- case ER_BAD_NULL_ERROR : return "23000";
-#endif
-#ifdef ER_BAD_DB_ERROR
- case ER_BAD_DB_ERROR : return "42000";
-#endif
-#ifdef ER_TABLE_EXISTS_ERROR
- case ER_TABLE_EXISTS_ERROR : return "42S01";
-#endif
-#ifdef ER_BAD_TABLE_ERROR
- case ER_BAD_TABLE_ERROR : return "42S02";
-#endif
-#ifdef ER_NON_UNIQ_ERROR
- case ER_NON_UNIQ_ERROR : return "23000";
-#endif
-#ifdef ER_SERVER_SHUTDOWN
- case ER_SERVER_SHUTDOWN : return "08S01";
-#endif
-#ifdef ER_BAD_FIELD_ERROR
- case ER_BAD_FIELD_ERROR : return "42S22";
-#endif
-#ifdef ER_WRONG_FIELD_WITH_GROUP
- case ER_WRONG_FIELD_WITH_GROUP : return "42000";
-#endif
-#ifdef ER_WRONG_GROUP_FIELD
- case ER_WRONG_GROUP_FIELD : return "42000";
-#endif
-#ifdef ER_WRONG_SUM_SELECT
- case ER_WRONG_SUM_SELECT : return "42000";
-#endif
-#ifdef ER_WRONG_VALUE_COUNT
- case ER_WRONG_VALUE_COUNT : return "21S01";
-#endif
-#ifdef ER_TOO_LONG_IDENT
- case ER_TOO_LONG_IDENT : return "42000";
-#endif
-#ifdef ER_DUP_FIELDNAME
- case ER_DUP_FIELDNAME : return "42S21";
-#endif
-#ifdef ER_DUP_KEYNAME
- case ER_DUP_KEYNAME : return "42000";
-#endif
-#ifdef ER_DUP_ENTRY
- case ER_DUP_ENTRY : return "23000";
-#endif
-#ifdef ER_WRONG_FIELD_SPEC
- case ER_WRONG_FIELD_SPEC : return "42000";
-#endif
-#ifdef ER_PARSE_ERROR
- case ER_PARSE_ERROR : return "42000";
-#endif
-#ifdef ER_NONUNIQ_TABLE
- case ER_NONUNIQ_TABLE : return "42000";
-#endif
-#ifdef ER_INVALID_DEFAULT
- case ER_INVALID_DEFAULT : return "42000";
-#endif
-#ifdef ER_MULTIPLE_PRI_KEY
- case ER_MULTIPLE_PRI_KEY : return "42000";
-#endif
-#ifdef ER_TOO_MANY_KEYS
- case ER_TOO_MANY_KEYS : return "42000";
-#endif
-#ifdef ER_TOO_MANY_KEY_PARTS
- case ER_TOO_MANY_KEY_PARTS : return "42000";
-#endif
-#ifdef ER_TOO_LONG_KEY
- case ER_TOO_LONG_KEY : return "42000";
-#endif
-#ifdef ER_KEY_COLUMN_DOES_NOT_EXITS
- case ER_KEY_COLUMN_DOES_NOT_EXITS : return "42000";
-#endif
-#ifdef ER_BLOB_USED_AS_KEY
- case ER_BLOB_USED_AS_KEY : return "42000";
-#endif
-#ifdef ER_TOO_BIG_FIELDLENGTH
- case ER_TOO_BIG_FIELDLENGTH : return "42000";
-#endif
-#ifdef ER_WRONG_AUTO_KEY
- case ER_WRONG_AUTO_KEY : return "42000";
-#endif
-#ifdef ER_FORCING_CLOSE
- case ER_FORCING_CLOSE : return "08S01";
-#endif
-#ifdef ER_IPSOCK_ERROR
- case ER_IPSOCK_ERROR : return "08S01";
-#endif
-#ifdef ER_NO_SUCH_INDEX
- case ER_NO_SUCH_INDEX : return "42S12";
-#endif
-#ifdef ER_WRONG_FIELD_TERMINATORS
- case ER_WRONG_FIELD_TERMINATORS : return "42000";
-#endif
-#ifdef ER_BLOBS_AND_NO_TERMINATED
- case ER_BLOBS_AND_NO_TERMINATED : return "42000";
-#endif
-#ifdef ER_CANT_REMOVE_ALL_FIELDS
- case ER_CANT_REMOVE_ALL_FIELDS : return "42000";
-#endif
-#ifdef ER_CANT_DROP_FIELD_OR_KEY
- case ER_CANT_DROP_FIELD_OR_KEY : return "42000";
-#endif
-#ifdef ER_BLOB_CANT_HAVE_DEFAULT
- case ER_BLOB_CANT_HAVE_DEFAULT : return "42000";
-#endif
-#ifdef ER_WRONG_DB_NAME
- case ER_WRONG_DB_NAME : return "42000";
-#endif
-#ifdef ER_WRONG_TABLE_NAME
- case ER_WRONG_TABLE_NAME : return "42000";
-#endif
-#ifdef ER_TOO_BIG_SELECT
- case ER_TOO_BIG_SELECT : return "42000";
-#endif
-#ifdef ER_UNKNOWN_PROCEDURE
- case ER_UNKNOWN_PROCEDURE : return "42000";
-#endif
-#ifdef ER_WRONG_PARAMCOUNT_TO_PROCEDURE
- case ER_WRONG_PARAMCOUNT_TO_PROCEDURE : return "42000";
-#endif
-#ifdef ER_UNKNOWN_TABLE
- case ER_UNKNOWN_TABLE : return "42S02";
-#endif
-#ifdef ER_FIELD_SPECIFIED_TWICE
- case ER_FIELD_SPECIFIED_TWICE : return "42000";
-#endif
-#ifdef ER_UNSUPPORTED_EXTENSION
- case ER_UNSUPPORTED_EXTENSION : return "42000";
-#endif
-#ifdef ER_TABLE_MUST_HAVE_COLUMNS
- case ER_TABLE_MUST_HAVE_COLUMNS : return "42000";
-#endif
-#ifdef ER_UNKNOWN_CHARACTER_SET
- case ER_UNKNOWN_CHARACTER_SET : return "42000";
-#endif
-#ifdef ER_TOO_BIG_ROWSIZE
- case ER_TOO_BIG_ROWSIZE : return "42000";
-#endif
-#ifdef ER_WRONG_OUTER_JOIN
- case ER_WRONG_OUTER_JOIN : return "42000";
-#endif
-#ifdef ER_NULL_COLUMN_IN_INDEX
- case ER_NULL_COLUMN_IN_INDEX : return "42000";
-#endif
-#ifdef ER_PASSWORD_ANONYMOUS_USER
- case ER_PASSWORD_ANONYMOUS_USER : return "42000";
-#endif
-#ifdef ER_PASSWORD_NOT_ALLOWED
- case ER_PASSWORD_NOT_ALLOWED : return "42000";
-#endif
-#ifdef ER_PASSWORD_NO_MATCH
- case ER_PASSWORD_NO_MATCH : return "42000";
-#endif
-#ifdef ER_WRONG_VALUE_COUNT_ON_ROW
- case ER_WRONG_VALUE_COUNT_ON_ROW : return "21S01";
-#endif
-#ifdef ER_INVALID_USE_OF_NULL
- case ER_INVALID_USE_OF_NULL : return "42000";
-#endif
-#ifdef ER_REGEXP_ERROR
- case ER_REGEXP_ERROR : return "42000";
-#endif
-#ifdef ER_NONEXISTING_GRANT
- case ER_NONEXISTING_GRANT : return "42000";
-#endif
-#ifdef ER_TABLEACCESS_DENIED_ERROR
- case ER_TABLEACCESS_DENIED_ERROR : return "42000";
-#endif
-#ifdef ER_COLUMNACCESS_DENIED_ERROR
- case ER_COLUMNACCESS_DENIED_ERROR : return "42000";
-#endif
-#ifdef ER_ILLEGAL_GRANT_FOR_TABLE
- case ER_ILLEGAL_GRANT_FOR_TABLE : return "42000";
-#endif
-#ifdef ER_GRANT_WRONG_HOST_OR_USER
- case ER_GRANT_WRONG_HOST_OR_USER : return "42000";
-#endif
-#ifdef ER_NO_SUCH_TABLE
- case ER_NO_SUCH_TABLE : return "42S02";
-#endif
-#ifdef ER_NONEXISTING_TABLE_GRANT
- case ER_NONEXISTING_TABLE_GRANT : return "42000";
-#endif
-#ifdef ER_NOT_ALLOWED_COMMAND
- case ER_NOT_ALLOWED_COMMAND : return "42000";
-#endif
-#ifdef ER_SYNTAX_ERROR
- case ER_SYNTAX_ERROR : return "42000";
-#endif
-#ifdef ER_ABORTING_CONNECTION
- case ER_ABORTING_CONNECTION : return "08S01";
-#endif
-#ifdef ER_NET_PACKET_TOO_LARGE
- case ER_NET_PACKET_TOO_LARGE : return "08S01";
-#endif
-#ifdef ER_NET_READ_ERROR_FROM_PIPE
- case ER_NET_READ_ERROR_FROM_PIPE : return "08S01";
-#endif
-#ifdef ER_NET_FCNTL_ERROR
- case ER_NET_FCNTL_ERROR : return "08S01";
-#endif
-#ifdef ER_NET_PACKETS_OUT_OF_ORDER
- case ER_NET_PACKETS_OUT_OF_ORDER : return "08S01";
-#endif
-#ifdef ER_NET_UNCOMPRESS_ERROR
- case ER_NET_UNCOMPRESS_ERROR : return "08S01";
-#endif
-#ifdef ER_NET_READ_ERROR
- case ER_NET_READ_ERROR : return "08S01";
-#endif
-#ifdef ER_NET_READ_INTERRUPTED
- case ER_NET_READ_INTERRUPTED : return "08S01";
-#endif
-#ifdef ER_NET_ERROR_ON_WRITE
- case ER_NET_ERROR_ON_WRITE : return "08S01";
-#endif
-#ifdef ER_NET_WRITE_INTERRUPTED
- case ER_NET_WRITE_INTERRUPTED : return "08S01";
-#endif
-#ifdef ER_TOO_LONG_STRING
- case ER_TOO_LONG_STRING : return "42000";
-#endif
-#ifdef ER_TABLE_CANT_HANDLE_BLOB
- case ER_TABLE_CANT_HANDLE_BLOB : return "42000";
-#endif
-#ifdef ER_TABLE_CANT_HANDLE_AUTO_INCREMENT
- case ER_TABLE_CANT_HANDLE_AUTO_INCREMENT : return "42000";
-#endif
-#ifdef ER_WRONG_COLUMN_NAME
- case ER_WRONG_COLUMN_NAME : return "42000";
-#endif
-#ifdef ER_WRONG_KEY_COLUMN
- case ER_WRONG_KEY_COLUMN : return "42000";
-#endif
-#ifdef ER_DUP_UNIQUE
- case ER_DUP_UNIQUE : return "23000";
-#endif
-#ifdef ER_BLOB_KEY_WITHOUT_LENGTH
- case ER_BLOB_KEY_WITHOUT_LENGTH : return "42000";
-#endif
-#ifdef ER_PRIMARY_CANT_HAVE_NULL
- case ER_PRIMARY_CANT_HAVE_NULL : return "42000";
-#endif
-#ifdef ER_TOO_MANY_ROWS
- case ER_TOO_MANY_ROWS : return "42000";
-#endif
-#ifdef ER_REQUIRES_PRIMARY_KEY
- case ER_REQUIRES_PRIMARY_KEY : return "42000";
-#endif
-#ifdef ER_CHECK_NO_SUCH_TABLE
- case ER_CHECK_NO_SUCH_TABLE : return "42000";
-#endif
-#ifdef ER_CHECK_NOT_IMPLEMENTED
- case ER_CHECK_NOT_IMPLEMENTED : return "42000";
-#endif
-#ifdef ER_CANT_DO_THIS_DURING_AN_TRANSACTION
- case ER_CANT_DO_THIS_DURING_AN_TRANSACTION: return "25000";
-#endif
-#ifdef ER_NEW_ABORTING_CONNECTION
- case ER_NEW_ABORTING_CONNECTION : return "08S01";
-#endif
-#ifdef ER_MASTER_NET_READ
- case ER_MASTER_NET_READ : return "08S01";
-#endif
-#ifdef ER_MASTER_NET_WRITE
- case ER_MASTER_NET_WRITE : return "08S01";
-#endif
-#ifdef ER_TOO_MANY_USER_CONNECTIONS
- case ER_TOO_MANY_USER_CONNECTIONS : return "42000";
-#endif
-#ifdef ER_READ_ONLY_TRANSACTION
- case ER_READ_ONLY_TRANSACTION : return "25000";
-#endif
-#ifdef ER_LOCK_DEADLOCK
- case ER_LOCK_DEADLOCK : return "40001";
-#endif
-#ifdef ER_NO_REFERENCED_ROW
- case ER_NO_REFERENCED_ROW : return "23000";
-#endif
-#ifdef ER_ROW_IS_REFERENCED
- case ER_ROW_IS_REFERENCED : return "23000";
-#endif
-#ifdef ER_CONNECT_TO_MASTER
- case ER_CONNECT_TO_MASTER : return "08S01";
-#endif
-#ifdef ER_USER_LIMIT_REACHED
- case ER_USER_LIMIT_REACHED : return "42000";
-#endif
-#ifdef ER_NO_DEFAULT
- case ER_NO_DEFAULT : return "42000";
-#endif
-#ifdef ER_WRONG_VALUE_FOR_VAR
- case ER_WRONG_VALUE_FOR_VAR : return "42000";
-#endif
-#ifdef ER_WRONG_TYPE_FOR_VAR
- case ER_WRONG_TYPE_FOR_VAR : return "42000";
-#endif
-#ifdef ER_CANT_USE_OPTION_HERE
- case ER_CANT_USE_OPTION_HERE : return "42000";
-#endif
-#ifdef ER_NOT_SUPPORTED_YET
- case ER_NOT_SUPPORTED_YET : return "42000";
-#endif
-#ifdef ER_WRONG_FK_DEF
- case ER_WRONG_FK_DEF : return "42000";
-#endif
-#ifdef ER_OPERAND_COLUMNS
- case ER_OPERAND_COLUMNS : return "21000";
-#endif
-#ifdef ER_SUBQUERY_NO_1_ROW
- case ER_SUBQUERY_NO_1_ROW : return "21000";
-#endif
-#ifdef ER_ILLEGAL_REFERENCE
- case ER_ILLEGAL_REFERENCE : return "42S22";
-#endif
-#ifdef ER_DERIVED_MUST_HAVE_ALIAS
- case ER_DERIVED_MUST_HAVE_ALIAS : return "42000";
-#endif
-#ifdef ER_SELECT_REDUCED
- case ER_SELECT_REDUCED : return "01000";
-#endif
-#ifdef ER_TABLENAME_NOT_ALLOWED_HERE
- case ER_TABLENAME_NOT_ALLOWED_HERE : return "42000";
-#endif
-#ifdef ER_NOT_SUPPORTED_AUTH_MODE
- case ER_NOT_SUPPORTED_AUTH_MODE : return "08004";
-#endif
-#ifdef ER_SPATIAL_CANT_HAVE_NULL
- case ER_SPATIAL_CANT_HAVE_NULL : return "42000";
-#endif
-#ifdef ER_COLLATION_CHARSET_MISMATCH
- case ER_COLLATION_CHARSET_MISMATCH : return "42000";
-#endif
-#ifdef ER_WARN_TOO_FEW_RECORDS
- case ER_WARN_TOO_FEW_RECORDS : return "01000";
-#endif
-#ifdef ER_WARN_TOO_MANY_RECORDS
- case ER_WARN_TOO_MANY_RECORDS : return "01000";
-#endif
-#ifdef ER_WARN_NULL_TO_NOTNULL
- case ER_WARN_NULL_TO_NOTNULL : return "01000";
-#endif
-#ifdef ER_WARN_DATA_OUT_OF_RANGE
- case ER_WARN_DATA_OUT_OF_RANGE : return "01000";
-#endif
-#ifdef ER_WARN_DATA_TRUNCATED
- case ER_WARN_DATA_TRUNCATED : return "01000";
-#endif
-#ifdef ER_WRONG_NAME_FOR_INDEX
- case ER_WRONG_NAME_FOR_INDEX : return "42000";
-#endif
-#ifdef ER_WRONG_NAME_FOR_CATALOG
- case ER_WRONG_NAME_FOR_CATALOG : return "42000";
-#endif
-#ifdef ER_UNKNOWN_STORAGE_ENGINE
- case ER_UNKNOWN_STORAGE_ENGINE : return "42000";
-#endif
diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt
deleted file mode 100644
index bd0a40904a..0000000000
--- a/ext/pdo_mysql/tests/bug_33689.phpt
+++ /dev/null
@@ -1,52 +0,0 @@
---TEST--
-PDO MySQL Bug #33689
---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';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-PDOTest::skip();
-?>
---FILE--
-<?php
-require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-
-$db->exec('CREATE TABLE test (bar INT NOT NULL)');
-$db->exec('INSERT INTO test VALUES(1)');
-
-var_dump($db->query('SELECT * from test'));
-foreach ($db->query('SELECT * from test') as $row) {
- print_r($row);
-}
-
-$stmt = $db->prepare('SELECT * from test');
-print_r($stmt->getColumnMeta(0));
-$stmt->execute();
-print_r($stmt->getColumnMeta(0));
-
---EXPECTF--
-object(PDOStatement)#%d (1) {
- ["queryString"]=>
- string(18) "SELECT * from test"
-}
-Array
-(
- [bar] => 1
- [0] => 1
-)
-Array
-(
- [native_type] => LONG
- [flags] => Array
- (
- [0] => not_null
- )
-
- [name] => bar
- [len] => 11
- [precision] => 0
- [pdo_type] => 2
-)
diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt
deleted file mode 100644
index c4d760083d..0000000000
--- a/ext/pdo_mysql/tests/bug_37445.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-PDO MySQL Bug #37445 (Premature stmt object destruction)
---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';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-PDOTest::skip();
-?>
---FILE--
-<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$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 %s/bug_37445.php on line %d \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/common.phpt b/ext/pdo_mysql/tests/common.phpt
deleted file mode 100644
index 8179454cf7..0000000000
--- a/ext/pdo_mysql/tests/common.phpt
+++ /dev/null
@@ -1,28 +0,0 @@
---TEST--
-MySQL
---SKIPIF--
-<?php # vim:ft=php
-if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) print 'skip not loaded';
-?>
---REDIRECTTEST--
-# magic auto-configuration
-
-$config = array(
- 'TESTS' => 'ext/pdo/tests'
-);
-
-if (false !== getenv('PDO_MYSQL_TEST_DSN')) {
- # user set them from their shell
- $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN');
- $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER');
- $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS');
- if (false !== getenv('PDO_MYSQL_TEST_ATTR')) {
- $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR');
- }
-} else {
- $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test';
- $config['ENV']['PDOTEST_USER'] = 'root';
- $config['ENV']['PDOTEST_PASS'] = '';
-}
-
-return $config;
diff --git a/ext/pdo_mysql/tests/config.inc b/ext/pdo_mysql/tests/config.inc
deleted file mode 100644
index 855f89bc1e..0000000000
--- a/ext/pdo_mysql/tests/config.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-if (false !== getenv('PDO_MYSQL_TEST_DSN')) {
- # user set them from their shell
- $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN');
- $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER');
- $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS');
- if (false !== getenv('PDO_MYSQL_TEST_ATTR')) {
- $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR');
- }
-} else {
- $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test';
- $config['ENV']['PDOTEST_USER'] = 'root';
- $config['ENV']['PDOTEST_PASS'] = '';
-}
-
-foreach ($config['ENV'] as $k => $v) {
- putenv("$k=$v");
-}
diff --git a/ext/pdo_mysql/tests/last_insert_id.phpt b/ext/pdo_mysql/tests/last_insert_id.phpt
deleted file mode 100644
index d48ba14992..0000000000
--- a/ext/pdo_mysql/tests/last_insert_id.phpt
+++ /dev/null
@@ -1,36 +0,0 @@
---TEST--
-PDO MySQL auto_increment / last insert id
---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';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-PDOTest::skip();
-?>
---FILE--
-<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-
-print_r($db->query("CREATE TABLE test (id int auto_increment primary key, num int)"));
-
-print_r($db->query("INSERT INTO test (id, num) VALUES (23, 42)"));
-
-print_r($db->query("INSERT INTO test (num) VALUES (451)"));
-
-print_r($db->lastInsertId());
---EXPECT--
-PDOStatement Object
-(
- [queryString] => CREATE TABLE test (id int auto_increment primary key, num int)
-)
-PDOStatement Object
-(
- [queryString] => INSERT INTO test (id, num) VALUES (23, 42)
-)
-PDOStatement Object
-(
- [queryString] => INSERT INTO test (num) VALUES (451)
-)
-24 \ 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
deleted file mode 100644
index 639a640c8a..0000000000
--- a/ext/pdo_mysql/tests/pecl_bug_5200.phpt
+++ /dev/null
@@ -1,31 +0,0 @@
---TEST--
-PDO MySQL PECL Bug #5200
---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';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-PDOTest::skip();
-?>
---FILE--
-<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt');
-
-$db->exec("CREATE TABLE test (bar INT NOT NULL, phase enum('please_select', 'I', 'II', 'IIa', 'IIb', 'III', 'IV'))");
-
-foreach ($db->query('DESCRIBE test phase')->fetchAll(PDO::FETCH_ASSOC) as $row) {
- print_r($row);
-}
-
---EXPECT--
-Array
-(
- [field] => phase
- [type] => enum('please_select','I','II','IIa','IIb','III','IV')
- [null] => YES
- [key] =>
- [default] =>
- [extra] =>
-)
diff --git a/ext/pdo_mysql/tests/pecl_bug_5780.phpt b/ext/pdo_mysql/tests/pecl_bug_5780.phpt
deleted file mode 100644
index ef94db13cc..0000000000
--- a/ext/pdo_mysql/tests/pecl_bug_5780.phpt
+++ /dev/null
@@ -1,42 +0,0 @@
---TEST--
-PDO MySQL PECL Bug #5780
---SKIPIF--
-<?php # vim:ft=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';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-PDOTest::skip();
-?>
---FILE--
-<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt');
-
-$db->exec("CREATE TABLE test (login varchar(32) NOT NULL, data varchar(64) NOT NULL)");
-$db->exec("CREATE TABLE test2 (login varchar(32) NOT NULL, password varchar(64) NOT NULL)");
-$db->exec("INSERT INTO test2 (login, password) VALUES ('testing', 'testing')");
-$db->exec("INSERT INTO test2 (login, password) VALUES ('test2', 'testpw2')");
-
-$logstmt = $db->prepare('INSERT INTO test (login, data) VALUES (:var1, :var2)');
-$authstmt = $db->prepare('SELECT * FROM test2 WHERE login = :varlog AND password = :varpass');
-$authstmt->execute(array(':varlog' => 'testing', ':varpass' => 'testing'));
-var_dump($authstmt->fetch(PDO::FETCH_NUM));
-@var_dump($logstmt->execute(array(':var1' => 'test1', ':var2' => 'test2')));
-$info = $logstmt->errorInfo();
-unset($info[2]);
-var_dump($info);
---EXPECT--
-array(2) {
- [0]=>
- string(7) "testing"
- [1]=>
- string(7) "testing"
-}
-bool(false)
-array(2) {
- [0]=>
- string(5) "HY000"
- [1]=>
- int(2014)
-}
diff --git a/ext/pdo_mysql/tests/pecl_bug_5802.phpt b/ext/pdo_mysql/tests/pecl_bug_5802.phpt
deleted file mode 100644
index f154dd13a9..0000000000
--- a/ext/pdo_mysql/tests/pecl_bug_5802.phpt
+++ /dev/null
@@ -1,53 +0,0 @@
---TEST--
-PDO MySQL PECL Bug #5802
---SKIPIF--
-<?php # vim:ft=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';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-PDOTest::skip();
-?>
---FILE--
-<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt');
-
-$db->exec('create table test ( bar char(3) NULL )');
-$stmt = $db->prepare('insert into test (bar) values(:bar)') or var_dump($db->errorInfo());
-
-$bar = 'foo';
-$stmt->bindParam(':bar', $bar);
-$stmt->execute() or var_dump($stmt->errorInfo());
-
-$bar = null;
-$stmt->bindParam(':bar', $bar);
-$stmt->execute() or var_dump($stmt->errorInfo());
-
-$bar = 'qaz';
-$stmt->bindParam(':bar', $bar);
-$stmt->execute() or var_dump($stmt->errorInfo());
-
-$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--
-array(3) {
- [0]=>
- array(1) {
- ["bar"]=>
- string(3) "foo"
- }
- [1]=>
- array(1) {
- ["bar"]=>
- NULL
- }
- [2]=>
- array(1) {
- ["bar"]=>
- string(3) "qaz"
- }
-}
diff --git a/ext/pdo_mysql/tests/show_tables.phpt b/ext/pdo_mysql/tests/show_tables.phpt
deleted file mode 100644
index 97dfe686e7..0000000000
--- a/ext/pdo_mysql/tests/show_tables.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-PDO MySQL SHOW TABLES
---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';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-PDOTest::skip();
-?>
---FILE--
-<?php
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
-$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
-
-print_r($db->query('SHOW TABLES'));
---EXPECT--
-PDOStatement Object
-(
- [queryString] => SHOW TABLES
-)