Remove dead code related to error constants

This commit is contained in:
Adam Baratz 2017-03-01 16:28:47 -05:00
parent 3985ddc495
commit 2f09973968
3 changed files with 0 additions and 67 deletions

View 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)

View 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
}
/* }}} */

View 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;