]> granicus.if.org Git - php/commitdiff
Turn "pdo_stmt_methods" into constants.
authorDmitry Stogov <dmitry@zend.com>
Thu, 14 Dec 2017 19:59:58 +0000 (22:59 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 14 Dec 2017 19:59:58 +0000 (22:59 +0300)
15 files changed:
ext/pdo/php_pdo_driver.h
ext/pdo_dblib/dblib_stmt.c
ext/pdo_dblib/php_pdo_dblib_int.h
ext/pdo_firebird/firebird_statement.c
ext/pdo_firebird/php_pdo_firebird_int.h
ext/pdo_mysql/mysql_statement.c
ext/pdo_mysql/php_pdo_mysql_int.h
ext/pdo_oci/oci_statement.c
ext/pdo_oci/php_pdo_oci_int.h
ext/pdo_odbc/odbc_stmt.c
ext/pdo_odbc/php_pdo_odbc_int.h
ext/pdo_pgsql/pgsql_statement.c
ext/pdo_pgsql/php_pdo_pgsql_int.h
ext/pdo_sqlite/php_pdo_sqlite_int.h
ext/pdo_sqlite/sqlite_statement.c

index 578f3a3ac1bf5bca2bdf2220709a6f753e0b928a..52c64cda1ca799ca80f911109c24a4c07943450c 100644 (file)
@@ -563,7 +563,7 @@ struct pdo_bound_param_data {
 /* represents a prepared statement */
 struct _pdo_stmt_t {
        /* driver specifics */
-       struct pdo_stmt_methods *methods;
+       const struct pdo_stmt_methods *methods;
        void *driver_data;
 
        /* if true, we've already successfully executed this statement at least
index b4e437282126925aff64883220d2af1c05246ed2..dd58207f11eeec3c2e434757ed9386231caa206c 100644 (file)
@@ -554,7 +554,7 @@ static int pdo_dblib_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zva
 }
 
 
-struct pdo_stmt_methods dblib_stmt_methods = {
+const struct pdo_stmt_methods dblib_stmt_methods = {
        pdo_dblib_stmt_dtor,
        pdo_dblib_stmt_execute,
        pdo_dblib_stmt_fetch,
index 91fe464dafbca1d599cb3579132df0844ebf5d5c..d14bc5c780948aad73686134aa5f880ee17093b3 100644 (file)
@@ -105,7 +105,7 @@ int pdo_dblib_msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate,
        int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line);
 
 extern const pdo_driver_t pdo_dblib_driver;
-extern struct pdo_stmt_methods dblib_stmt_methods;
+extern const struct pdo_stmt_methods dblib_stmt_methods;
 
 typedef struct {
        int severity;
index 1061785a53ac997db68bf6f28467d0e924e67260..952080688e8a6c6a8feb821279fe0abc2a90316c 100644 (file)
@@ -761,7 +761,7 @@ static int firebird_stmt_cursor_closer(pdo_stmt_t *stmt) /* {{{ */
 /* }}} */
 
 
-struct pdo_stmt_methods firebird_stmt_methods = { /* {{{ */
+const struct pdo_stmt_methods firebird_stmt_methods = { /* {{{ */
        firebird_stmt_dtor,
        firebird_stmt_execute,
        firebird_stmt_fetch,
index 47bfc18e4bf404e15ab36dfea0b001da8d31328c..0ae59358f2a4c85fba7109dfebd2fe459ace3297 100644 (file)
@@ -132,7 +132,7 @@ typedef struct {
 
 extern const pdo_driver_t pdo_firebird_driver;
 
-extern struct pdo_stmt_methods firebird_stmt_methods;
+extern const struct pdo_stmt_methods firebird_stmt_methods;
 
 void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line);
 
index c390a7575ea16142b2f0bcd7a67e83b7882eaf61..5d820ff289cdb3171471c01b80fea739ec93361b 100644 (file)
@@ -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,
index 6e7d840d7a8af4c128e1aafe7a9d2dfe40b191dc..9e0fab3ad87d5765395fd7a831758ce05ea529f2 100644 (file)
@@ -155,7 +155,7 @@ extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file,
 #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,
index 02c8df161cf111ca1129852bb3e5aa57f8e94d2b..75ce4f26664e2945a88629c932cae4d1b66d2849 100644 (file)
@@ -795,7 +795,7 @@ static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, size_t *len
        }
 } /* }}} */
 
-struct pdo_stmt_methods oci_stmt_methods = {
+const struct pdo_stmt_methods oci_stmt_methods = {
        oci_stmt_dtor,
        oci_stmt_execute,
        oci_stmt_fetch,
index 88f9458e3241d7982a3e13a4759644c7edad1c07..b9be4dc5b76e6899f276a6c1457ab949918e6d96 100644 (file)
@@ -93,7 +93,7 @@ ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, swor
 #define oci_drv_error(w)       _oci_error(H->err, dbh, NULL, w, H->last_err, FALSE, __FILE__, __LINE__)
 #define oci_stmt_error(w)      _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, FALSE, __FILE__, __LINE__)
 
-extern struct pdo_stmt_methods oci_stmt_methods;
+extern const struct pdo_stmt_methods oci_stmt_methods;
 
 /* Default prefetch size in number of rows */
 #define PDO_OCI_PREFETCH_DEFAULT 100
index ec69dd68dfb5d8b8720eea1ef9cfda5bca8f1ee4..bf5e9fc31a297c8af3a285bb4a1413fb7ef6f47b 100644 (file)
@@ -856,7 +856,7 @@ static int odbc_stmt_next_rowset(pdo_stmt_t *stmt)
        return 1;
 }
 
-struct pdo_stmt_methods odbc_stmt_methods = {
+const struct pdo_stmt_methods odbc_stmt_methods = {
        odbc_stmt_dtor,
        odbc_stmt_execute,
        odbc_stmt_fetch,
index a94181fe4a78536b0377d479d4adc2d7d1a00723..0eb23b1c805ab470831992f035a49c92292adb02 100644 (file)
@@ -165,7 +165,7 @@ typedef struct {
 } pdo_odbc_param;
 
 extern const pdo_driver_t pdo_odbc_driver;
-extern struct pdo_stmt_methods odbc_stmt_methods;
+extern const struct pdo_stmt_methods odbc_stmt_methods;
 
 void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line);
 #define pdo_odbc_drv_error(what)       pdo_odbc_error(dbh, NULL, SQL_NULL_HSTMT, what, __FILE__, __LINE__)
index 783dab2244ee60f45e1df7a5e768964e35693c08..63d9ee6b7319b052588795a1f6b7045fa3d9fb89 100644 (file)
@@ -707,7 +707,7 @@ static int pdo_pgsql_stmt_cursor_closer(pdo_stmt_t *stmt)
        return 1;
 }
 
-struct pdo_stmt_methods pgsql_stmt_methods = {
+const struct pdo_stmt_methods pgsql_stmt_methods = {
        pgsql_stmt_dtor,
        pgsql_stmt_execute,
        pgsql_stmt_fetch,
index 8a0d96420eaac97f1246b0d38b067ed36b371a46..d861be005a140be3a26e08b54970d473174cb6ae 100644 (file)
@@ -85,7 +85,7 @@ extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const
 #define pdo_pgsql_error_stmt(s,e,z)    _pdo_pgsql_error(s->dbh, s, e, z, NULL, __FILE__, __LINE__)
 #define pdo_pgsql_error_stmt_msg(s,e,m)        _pdo_pgsql_error(s->dbh, s, e, NULL, m, __FILE__, __LINE__)
 
-extern struct pdo_stmt_methods pgsql_stmt_methods;
+extern const struct pdo_stmt_methods pgsql_stmt_methods;
 
 #define pdo_pgsql_sqlstate(r) PQresultErrorField(r, PG_DIAG_SQLSTATE)
 
index 073c86848448d6e47d50f345e2f89fcaa82ec9a6..bea82c26d08cfab791672cb32ed8a26cc993b003 100644 (file)
@@ -74,7 +74,7 @@ extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file,
 #define pdo_sqlite_error(s) _pdo_sqlite_error(s, NULL, __FILE__, __LINE__)
 #define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__)
 
-extern struct pdo_stmt_methods sqlite_stmt_methods;
+extern const struct pdo_stmt_methods sqlite_stmt_methods;
 
 enum {
        PDO_SQLITE_ATTR_OPEN_FLAGS = PDO_ATTR_DRIVER_SPECIFIC,
index 817e6294db1e30cf82a9d49be01e2c4ecd277ddf..7d43123ba6573f3cc9ea88e2e809e30a8a82a8ca 100644 (file)
@@ -352,7 +352,7 @@ static int pdo_sqlite_stmt_cursor_closer(pdo_stmt_t *stmt)
        return 1;
 }
 
-struct pdo_stmt_methods sqlite_stmt_methods = {
+const struct pdo_stmt_methods sqlite_stmt_methods = {
        pdo_sqlite_stmt_dtor,
        pdo_sqlite_stmt_execute,
        pdo_sqlite_stmt_fetch,