]> granicus.if.org Git - php/commitdiff
Remove dead code related to error constants
authorAdam Baratz <adambaratz@php.net>
Wed, 1 Mar 2017 21:28:47 +0000 (16:28 -0500)
committerAdam Baratz <adambaratz@php.net>
Wed, 1 Mar 2017 21:28:47 +0000 (16:28 -0500)
ext/pdo/pdo_dbh.c
ext/pdo_firebird/firebird_driver.c
ext/pdo_oci/oci_driver.c

index 056d6276197f620389ce60801d13f7def98eb41f..586797e744bc981f94f98407af5ceff2c39766b9 100644 (file)
@@ -1488,20 +1488,6 @@ void pdo_dbh_init(void)
 
        REGISTER_PDO_CLASS_CONST_LONG("CURSOR_FWDONLY", (zend_long)PDO_CURSOR_FWDONLY);
        REGISTER_PDO_CLASS_CONST_LONG("CURSOR_SCROLL", (zend_long)PDO_CURSOR_SCROLL);
-
-#if 0
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_CANT_MAP",           (zend_long)PDO_ERR_CANT_MAP);
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_SYNTAX",             (zend_long)PDO_ERR_SYNTAX);
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_CONSTRAINT",         (zend_long)PDO_ERR_CONSTRAINT);
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_NOT_FOUND",          (zend_long)PDO_ERR_NOT_FOUND);
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_ALREADY_EXISTS",     (zend_long)PDO_ERR_ALREADY_EXISTS);
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_NOT_IMPLEMENTED",    (zend_long)PDO_ERR_NOT_IMPLEMENTED);
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_MISMATCH",           (zend_long)PDO_ERR_MISMATCH);
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_TRUNCATED",          (zend_long)PDO_ERR_TRUNCATED);
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_DISCONNECTED",       (zend_long)PDO_ERR_DISCONNECTED);
-       REGISTER_PDO_CLASS_CONST_LONG("ERR_NO_PERM",            (zend_long)PDO_ERR_NO_PERM);
-#endif
-
 }
 
 static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent)
index 166fb13d43555a21f981e4cbb35016afee2b27a0..ab2571df3d57ce22c938d6f3118bb53d9bfc9a2e 100644 (file)
@@ -37,56 +37,9 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t*, const char*, size_t, XSQLDA*,
 /* map driver specific error message to PDO error */
 void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line) /* {{{ */
 {
-#if 0
-       pdo_firebird_db_handle *H = stmt ? ((pdo_firebird_stmt *)stmt->driver_data)->H
-               : (pdo_firebird_db_handle *)dbh->driver_data;
-#endif
        pdo_error_type *const error_code = stmt ? &stmt->error_code : &dbh->error_code;
 
-#if 0
-       switch (isc_sqlcode(H->isc_status)) {
-
-               case 0:
-                       *error_code = PDO_ERR_NONE;
-                       break;
-               default:
-                       *error_code = PDO_ERR_CANT_MAP;
-                       break;
-               case -104:
-                       *error_code = PDO_ERR_SYNTAX;
-                       break;
-               case -530:
-               case -803:
-                       *error_code = PDO_ERR_CONSTRAINT;
-                       break;
-               case -204:
-               case -205:
-               case -206:
-               case -829:
-                       *error_code = PDO_ERR_NOT_FOUND;
-                       break;
-
-                       *error_code = PDO_ERR_ALREADY_EXISTS;
-                       break;
-
-                       *error_code = PDO_ERR_NOT_IMPLEMENTED;
-                       break;
-               case -313:
-               case -804:
-                       *error_code = PDO_ERR_MISMATCH;
-                       break;
-               case -303:
-               case -314:
-               case -413:
-                       *error_code = PDO_ERR_TRUNCATED;
-                       break;
-
-                       *error_code = PDO_ERR_DISCONNECTED;
-                       break;
-       }
-#else
        strcpy(*error_code, "HY000");
-#endif
 }
 /* }}} */
 
index 367f478e12482158fc698907c8c06a6a175debdc..ac52d10b99249d0abf17566eb9ef721af53d4183 100644 (file)
@@ -132,12 +132,6 @@ ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, swor
                                        zend_bailout();
                                        break;
 
-#if 0
-                               case 955:       /* ORA-00955: name is already used by an existing object */
-                                       *pdo_err = PDO_ERR_ALREADY_EXISTS;
-                                       break;
-#endif
-
                                case 12154:     /* ORA-12154: TNS:could not resolve service name */
                                        strcpy(*pdo_err, "42S02");
                                        break;