summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_mysql')
-rw-r--r--ext/pdo_mysql/mysql_driver.c40
-rw-r--r--ext/pdo_mysql/mysql_statement.c4
-rw-r--r--ext/pdo_mysql/package2.xml93
-rw-r--r--ext/pdo_mysql/pdo_mysql.c6
-rw-r--r--ext/pdo_mysql/php_pdo_mysql.h2
-rw-r--r--ext/pdo_mysql/php_pdo_mysql_int.h6
6 files changed, 12 insertions, 139 deletions
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 07aaa6f6c1..dcad8ef6c7 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 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 |
@@ -349,11 +349,7 @@ static int mysql_handle_commit(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_commit");
PDO_DBG_INF_FMT("dbh=%p", dbh);
-#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 == mysql_commit(((pdo_mysql_db_handle *)dbh->driver_data)->server));
-#else
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT")));
-#endif
}
/* }}} */
@@ -362,11 +358,7 @@ static int mysql_handle_rollback(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_rollback");
PDO_DBG_INF_FMT("dbh=%p", dbh);
-#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 <= mysql_rollback(((pdo_mysql_db_handle *)dbh->driver_data)->server));
-#else
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("ROLLBACK")));
-#endif
}
/* }}} */
@@ -376,15 +368,7 @@ static inline int mysql_handle_autocommit(pdo_dbh_t *dbh)
PDO_DBG_ENTER("mysql_handle_autocommit");
PDO_DBG_INF_FMT("dbh=%p", dbh);
PDO_DBG_INF_FMT("dbh->autocommit=%d", dbh->auto_commit);
-#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 <= mysql_autocommit(((pdo_mysql_db_handle *)dbh->driver_data)->server, dbh->auto_commit));
-#else
- if (dbh->auto_commit) {
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=1")));
- } else {
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=0")));
- }
-#endif
}
/* }}} */
@@ -516,37 +500,19 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
static int pdo_mysql_check_liveness(pdo_dbh_t *dbh)
{
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
PDO_DBG_ENTER("pdo_mysql_check_liveness");
PDO_DBG_INF_FMT("dbh=%p", dbh);
-#if MYSQL_VERSION_ID > 32230
if (mysql_ping(H->server)) {
PDO_DBG_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:
- signal(SIGPIPE, handler);
- PDO_DBG_RETURN(FAILURE);
- default:
- break;
- }
- signal(SIGPIPE, handler);
-#endif /* end mysql_ping() */
PDO_DBG_RETURN(SUCCESS);
}
/* }}} */
/* {{{ mysql_methods */
-static struct pdo_dbh_methods mysql_methods = {
+static const struct pdo_dbh_methods mysql_methods = {
mysql_handle_closer,
mysql_handle_preparer,
mysql_handle_doer,
@@ -853,7 +819,7 @@ cleanup:
}
/* }}} */
-pdo_driver_t pdo_mysql_driver = {
+const pdo_driver_t pdo_mysql_driver = {
PDO_DRIVER_HEADER(mysql),
pdo_mysql_handle_factory
};
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index f4a3879998..5d820ff289 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 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 |
@@ -923,7 +923,7 @@ static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt) /* {{{ */
}
/* }}} */
-struct pdo_stmt_methods mysql_stmt_methods = {
+const struct pdo_stmt_methods mysql_stmt_methods = {
pdo_mysql_stmt_dtor,
pdo_mysql_stmt_execute,
pdo_mysql_stmt_fetch,
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
index 94b825b9c8..9d1059487b 100644
--- a/ext/pdo_mysql/pdo_mysql.c
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 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 |
@@ -82,7 +82,7 @@ static MYSQLND * pdo_mysql_convert_zv_to_mysqlnd(zval * zv)
return NULL;
}
-static MYSQLND_REVERSE_API pdo_mysql_reverse_api = {
+static const MYSQLND_REVERSE_API pdo_mysql_reverse_api = {
&pdo_mysql_module_entry,
pdo_mysql_convert_zv_to_mysqlnd
};
@@ -226,7 +226,7 @@ ZEND_TSRMLS_CACHE_UPDATE();
/* }}} */
/* {{{ pdo_mysql_functions[] */
-const zend_function_entry pdo_mysql_functions[] = {
+static const zend_function_entry pdo_mysql_functions[] = {
PHP_FE_END
};
/* }}} */
diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h
index d7417631a4..745ef5e8e2 100644
--- a/ext/pdo_mysql/php_pdo_mysql.h
+++ b/ext/pdo_mysql/php_pdo_mysql.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 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 |
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
index 9b11ab5398..9e0fab3ad8 100644
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 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 |
@@ -149,13 +149,13 @@ typedef struct {
unsigned max_length:1;
} pdo_mysql_stmt;
-extern pdo_driver_t pdo_mysql_driver;
+extern const pdo_driver_t pdo_mysql_driver;
extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line);
#define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__)
#define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__)
-extern struct pdo_stmt_methods mysql_stmt_methods;
+extern const struct pdo_stmt_methods mysql_stmt_methods;
enum {
PDO_MYSQL_ATTR_USE_BUFFERED_QUERY = PDO_ATTR_DRIVER_SPECIFIC,