mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Unify error messages
This commit is contained in:
parent
2390cdafcf
commit
70a5d29ece
1 changed files with 68 additions and 72 deletions
|
@ -213,7 +213,7 @@ typedef struct {
|
|||
} else if (Z_TYPE_P(blob_arg) != IS_STRING\
|
||||
|| Z_STRLEN_P(blob_arg) != sizeof(ibase_blob_handle)\
|
||||
|| ((ibase_blob_handle *)(Z_STRVAL_P(blob_arg)))->bl_handle != 0){\
|
||||
_php_ibase_module_error("invalid blob id");\
|
||||
_php_ibase_module_error("Invalid blob id");\
|
||||
RETURN_FALSE;\
|
||||
} else {\
|
||||
ib_blob = (ibase_blob_handle *)Z_STRVAL_P(blob_arg);\
|
||||
|
@ -262,13 +262,12 @@ PHP_FUNCTION(ibase_errmsg)
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ _php_ibase_error()
|
||||
/* {{{ _php_ibase_error(TSRMLS_D)
|
||||
print interbase error and save it for ibase_errmsg() */
|
||||
static void _php_ibase_error(void)
|
||||
static void _php_ibase_error(TSRMLS_D)
|
||||
{
|
||||
char *s;
|
||||
ISC_STATUS *statusp;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
s = IBG(errmsg);
|
||||
statusp = IB_STATUS;
|
||||
|
@ -276,7 +275,7 @@ static void _php_ibase_error(void)
|
|||
strcat(IBG(errmsg), " ");
|
||||
s = IBG(errmsg) + strlen(IBG(errmsg));
|
||||
}
|
||||
php_error(E_WARNING, "InterBase: %s", IBG(errmsg));
|
||||
php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), IBG(errmsg));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -292,7 +291,7 @@ static void _php_ibase_module_error(char *msg, ...)
|
|||
vsnprintf(IBG(errmsg), MAX_ERRMSG, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
php_error(E_WARNING, "InterBase module: %s", IBG(errmsg));
|
||||
php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), IBG(errmsg));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -330,7 +329,7 @@ static void _php_ibase_commit_link(ibase_db_link *link)
|
|||
if (link->trans[0] != NULL) { /* commit default */
|
||||
IBDEBUG("Committing default transaction...");
|
||||
if (isc_commit_transaction(IB_STATUS, &link->trans[0])) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
}
|
||||
link->trans[0] = NULL;
|
||||
}
|
||||
|
@ -338,7 +337,7 @@ static void _php_ibase_commit_link(ibase_db_link *link)
|
|||
if (link->trans[i] != NULL) {
|
||||
IBDEBUG("Rolling back other transactions...");
|
||||
if (isc_rollback_transaction(IB_STATUS, &link->trans[i])) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
}
|
||||
link->trans[i] = NULL;
|
||||
}
|
||||
|
@ -396,7 +395,7 @@ static void _php_ibase_free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
|||
if ( !(IB_STATUS[0] && IB_STATUS[1]) && ib_result->drop_stmt && ib_result->stmt ) {
|
||||
IBDEBUG("Dropping statement handle (free_result)...");
|
||||
if (isc_dsql_free_statement(IB_STATUS, &ib_result->stmt, DSQL_drop)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
}
|
||||
} else {
|
||||
/* Shouldn't be here unless query was select and had parameter
|
||||
|
@ -438,7 +437,7 @@ static void _php_ibase_free_query(ibase_query *ib_query)
|
|||
if ( !(IB_STATUS[0] && IB_STATUS[1]) && ib_query->stmt) {
|
||||
IBDEBUG("Dropping statement handle (free_query)...");
|
||||
if (isc_dsql_free_statement(IB_STATUS, &ib_query->stmt, DSQL_drop)){
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
}
|
||||
}
|
||||
if (ib_query->in_array) {
|
||||
|
@ -489,7 +488,7 @@ static void _php_ibase_free_trans(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
|||
if (ib_link->trans[ib_trans->trans_num] != NULL) {
|
||||
IBDEBUG("Rolling back unhandled transaction...");
|
||||
if (isc_rollback_transaction(IB_STATUS, &ib_link->trans[ib_trans->trans_num])) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
}
|
||||
ib_link->trans[ib_trans->trans_num] = NULL;
|
||||
}
|
||||
|
@ -692,7 +691,7 @@ static int _php_ibase_attach_db(char *server, char *uname, char *passwd, char *c
|
|||
dpb_length = dpb - dpb_buffer;
|
||||
|
||||
if (isc_attach_database(IB_STATUS, (short) strlen(server), server, db, (short) dpb_length, dpb_buffer)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
|
@ -975,7 +974,7 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, int *array_cntp,
|
|||
|
||||
if (isc_array_lookup_bounds(IB_STATUS, &link, &trans,
|
||||
var->relname, var->sqlname, ar_desc)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
efree(IB_ARRAY);
|
||||
IB_ARRAY = NULL;
|
||||
return FAILURE;
|
||||
|
@ -1014,7 +1013,7 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, int *array_cntp,
|
|||
IB_ARRAY[ar_cnt].el_size = ar_desc->array_desc_length+sizeof(short);
|
||||
break;
|
||||
default:
|
||||
_php_ibase_module_error("unexpected array type %d in relation '%s' column '%s')",
|
||||
_php_ibase_module_error("Unexpected array type %d in relation '%s' column '%s'",
|
||||
ar_desc->array_desc_dtype, var->relname, var->sqlname);
|
||||
efree(IB_ARRAY);
|
||||
IB_ARRAY = NULL;
|
||||
|
@ -1059,7 +1058,7 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i
|
|||
IB_QUERY->dialect = dialect;
|
||||
|
||||
if (isc_dsql_allocate_statement(IB_STATUS, &link, &IB_QUERY->stmt)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
goto _php_ibase_alloc_query_error;
|
||||
}
|
||||
|
||||
|
@ -1068,7 +1067,7 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i
|
|||
IB_QUERY->out_sqlda->version = SQLDA_VERSION1;
|
||||
|
||||
if (isc_dsql_prepare(IB_STATUS, &IB_QUERY->trans, &IB_QUERY->stmt, 0, query, dialect, IB_QUERY->out_sqlda)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
goto _php_ibase_alloc_query_error;
|
||||
}
|
||||
|
||||
|
@ -1078,7 +1077,7 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i
|
|||
IB_QUERY->out_sqlda->sqln = IB_QUERY->out_sqlda->sqld;
|
||||
IB_QUERY->out_sqlda->version = SQLDA_VERSION1;
|
||||
if (isc_dsql_describe(IB_STATUS, &IB_QUERY->stmt, SQLDA_VERSION1, IB_QUERY->out_sqlda)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
goto _php_ibase_alloc_query_error;
|
||||
}
|
||||
}
|
||||
|
@ -1088,7 +1087,7 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i
|
|||
IB_QUERY->in_sqlda->sqln = 0;
|
||||
IB_QUERY->in_sqlda->version = SQLDA_VERSION1;
|
||||
if (isc_dsql_describe_bind(IB_STATUS, &IB_QUERY->stmt, SQLDA_VERSION1, IB_QUERY->in_sqlda)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
goto _php_ibase_alloc_query_error;
|
||||
}
|
||||
|
||||
|
@ -1098,7 +1097,7 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i
|
|||
IB_QUERY->in_sqlda->sqln = IB_QUERY->in_sqlda->sqld;
|
||||
IB_QUERY->in_sqlda->version = SQLDA_VERSION1;
|
||||
if (isc_dsql_describe_bind(IB_STATUS, &IB_QUERY->stmt, SQLDA_VERSION1, IB_QUERY->in_sqlda)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
goto _php_ibase_alloc_query_error;
|
||||
}
|
||||
}
|
||||
|
@ -1178,7 +1177,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu
|
|||
case SQL_SHORT:
|
||||
convert_to_long(b_var);
|
||||
if (Z_LVAL_P(b_var) > SHRT_MAX || Z_LVAL_P(b_var) < SHRT_MIN) {
|
||||
_php_ibase_module_error("field %*s overflow", var->aliasname_length, var->aliasname);
|
||||
_php_ibase_module_error("Field %*s overflow", var->aliasname_length, var->aliasname);
|
||||
return FAILURE;
|
||||
}
|
||||
buf[i].val.sval = (short)Z_LVAL_P(b_var);
|
||||
|
@ -1244,7 +1243,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu
|
|||
n = sscanf(Z_STRVAL_P(b_var), "%d%*[/]%d%*[/]%d %d%*[:]%d%*[:]%d",
|
||||
&t.tm_mon, &t.tm_mday, &t.tm_year, &t.tm_hour, &t.tm_min, &t.tm_sec);
|
||||
if(n != 3 && n != 6){
|
||||
_php_ibase_module_error("invalid date/time format: Expected 3 or 6 fields, got %d. Use format m/d/Y H:i:s. You gave '%s'", n, Z_STRVAL_P(b_var));
|
||||
_php_ibase_module_error("Invalid date/time format: Expected 3 or 6 fields, got %d. Use format m/d/Y H:i:s. You gave '%s'", n, Z_STRVAL_P(b_var));
|
||||
return FAILURE;
|
||||
}
|
||||
t.tm_year -= 1900;
|
||||
|
@ -1311,22 +1310,22 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu
|
|||
ib_blob->bl_handle = NULL;
|
||||
if (isc_create_blob(IB_STATUS, &ib_blob->link, &ib_blob->trans_handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) {
|
||||
efree(ib_blob);
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
return FAILURE;
|
||||
}
|
||||
convert_to_string(b_var);
|
||||
if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) Z_STRLEN_P(b_var), Z_STRVAL_P(b_var))) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
return FAILURE;
|
||||
}
|
||||
if (isc_close_blob(IB_STATUS, &ib_blob->bl_handle)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
return FAILURE;
|
||||
}
|
||||
ib_blob_id = ib_blob;
|
||||
var->sqldata = (void ISC_FAR *)&ib_blob_id->bl_qd;
|
||||
/*
|
||||
_php_ibase_module_error("invalid blob id string");
|
||||
_php_ibase_module_error("Invalid blob id string");
|
||||
return FAILURE;
|
||||
*/
|
||||
} else {
|
||||
|
@ -1337,7 +1336,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu
|
|||
}
|
||||
break;
|
||||
case SQL_ARRAY:
|
||||
_php_ibase_module_error("binding arrays not supported yet");
|
||||
_php_ibase_module_error("Binding arrays not supported yet");
|
||||
return FAILURE;
|
||||
break;
|
||||
} /*switch*/
|
||||
|
@ -1439,21 +1438,21 @@ static int _php_ibase_exec(ibase_result **ib_resultp, ibase_query *ib_query, int
|
|||
if (ib_query->in_sqlda) { /* has placeholders */
|
||||
IBDEBUG("Query wants XSQLDA for input");
|
||||
if (ib_query->in_sqlda->sqld != argc) {
|
||||
_php_ibase_module_error("placeholders (%d) and variables (%d) mismatch", ib_query->in_sqlda->sqld, argc);
|
||||
_php_ibase_module_error("Placeholders (%d) and variables (%d) mismatch", ib_query->in_sqlda->sqld, argc);
|
||||
goto _php_ibase_exec_error; /* yes mommy, goto! */
|
||||
}
|
||||
in_sqlda = emalloc(XSQLDA_LENGTH(ib_query->in_sqlda->sqld));
|
||||
memcpy(in_sqlda, ib_query->in_sqlda, XSQLDA_LENGTH(ib_query->in_sqlda->sqld));
|
||||
bind_buf = emalloc(sizeof(BIND_BUF) * ib_query->in_sqlda->sqld);
|
||||
if (_php_ibase_bind(in_sqlda, args, bind_buf, ib_query) == FAILURE) {
|
||||
IBDEBUG("Could not bind input XSQLDA... (_php_ibase_exec)");
|
||||
IBDEBUG("Could not bind input XSQLDA");
|
||||
goto _php_ibase_exec_error;
|
||||
}
|
||||
}
|
||||
|
||||
if (isc_dsql_execute(IB_STATUS, &ib_query->trans, &ib_query->stmt, ib_query->dialect, in_sqlda)) {
|
||||
IBDEBUG("Could not execute query... (_php_ibase_exec)");
|
||||
_php_ibase_error();
|
||||
IBDEBUG("Could not execute query");
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
goto _php_ibase_exec_error;
|
||||
}
|
||||
|
||||
|
@ -1555,12 +1554,12 @@ PHP_FUNCTION(ibase_trans)
|
|||
&& ib_link->trans[trans_n]; trans_n++)
|
||||
;
|
||||
if (trans_n == IBASE_TRANS_ON_LINK) {
|
||||
_php_ibase_module_error("too many transactions on link");
|
||||
_php_ibase_module_error("Too many transactions on link");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (isc_start_transaction(IB_STATUS, &ib_link->trans[trans_n], 1, &ib_link->link, tpb_len, tpbp)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1579,7 +1578,7 @@ static int _php_ibase_def_trans(ibase_db_link * ib_link, int trans_n)
|
|||
|
||||
if (trans_n == 0 && ib_link->trans[0] == NULL) {
|
||||
if (isc_start_transaction(IB_STATUS, &ib_link->trans[0], 1, &ib_link->link, 0, NULL)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -1621,12 +1620,12 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit)
|
|||
|
||||
if (commit) {
|
||||
if (isc_commit_transaction(IB_STATUS, &ib_link->trans[trans_n])) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
if (isc_rollback_transaction(IB_STATUS, &ib_link->trans[trans_n])) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1694,7 +1693,7 @@ PHP_FUNCTION(ibase_query)
|
|||
query = Z_STRVAL_PP(args[i]);
|
||||
i++; /* next arg */
|
||||
} else {
|
||||
_php_ibase_module_error("query argument missed");
|
||||
_php_ibase_module_error("Query argument missed");
|
||||
efree(args);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
@ -1895,7 +1894,7 @@ static int _php_ibase_arr_pval(pval *ar_pval, char **datap, ibase_array *ib_arra
|
|||
|
||||
|
||||
if (dim > 16) { /* InterBase limit */
|
||||
_php_ibase_module_error("php module internal error in %s %d", __FILE__, __LINE__);
|
||||
_php_ibase_module_error("Too many dimensions");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
@ -1968,7 +1967,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
|
|||
ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, "InterBase result", le_result);
|
||||
|
||||
if (ib_result->out_sqlda == NULL) {
|
||||
_php_ibase_module_error("trying to fetch results from a non-select query");
|
||||
_php_ibase_module_error("Trying to fetch results from a non-select query");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1977,7 +1976,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
|
|||
}
|
||||
|
||||
if (IB_STATUS[0] && IB_STATUS[1]) { /* error in fetch */
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2018,13 +2017,13 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
|
|||
char bl_items[1], *bl_data, bl_info[20], *p;
|
||||
|
||||
if (isc_open_blob(IB_STATUS, &ib_result->link, &ib_result->trans, &bl_handle, (ISC_QUAD ISC_FAR *) var->sqldata)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
bl_items[0] = isc_info_blob_total_length;
|
||||
if (isc_blob_info(IB_STATUS, &bl_handle, sizeof(bl_items), bl_items, sizeof(bl_info), bl_info)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2048,20 +2047,20 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
|
|||
cur_len += seg_len;
|
||||
if (cur_len > max_len) { /* never!*/
|
||||
efree(bl_data);
|
||||
_php_ibase_module_error("php module internal error in %s %d", __FILE__, __LINE__);
|
||||
_php_ibase_module_error("PHP module internal error");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (IB_STATUS[0] && IB_STATUS[1] && (IB_STATUS[1] != isc_segstr_eof)) {
|
||||
efree(bl_data);
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
bl_data[cur_len] = '\0';
|
||||
if (isc_close_blob(IB_STATUS, &bl_handle)) {
|
||||
efree(bl_data);
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
Z_TYPE_P(tmp) = IS_STRING;
|
||||
|
@ -2096,7 +2095,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
|
|||
|
||||
if (isc_array_get_slice(IB_STATUS, &ib_result->link, &ib_result->trans,
|
||||
&ar_qd, &ib_array->ar_desc, ar_data, &ib_array->ar_size)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2278,7 +2277,7 @@ PHP_FUNCTION(ibase_execute)
|
|||
IBDEBUG("Implicitly closing a cursor");
|
||||
if (isc_dsql_free_statement(IB_STATUS, &ib_query->stmt, DSQL_close)){
|
||||
efree(args);
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2318,11 +2317,11 @@ PHP_FUNCTION(ibase_free_query)
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
#if HAVE_STRFTIME
|
||||
/* {{{ proto int ibase_timefmt(string format)
|
||||
Sets the format of timestamp, date and time columns returned from queries */
|
||||
PHP_FUNCTION(ibase_timefmt)
|
||||
{
|
||||
#if HAVE_STRFTIME
|
||||
pval ***args;
|
||||
char *fmt = NULL;
|
||||
int type = PHP_IBASE_TIMESTAMP;
|
||||
|
@ -2369,12 +2368,9 @@ PHP_FUNCTION(ibase_timefmt)
|
|||
|
||||
efree(args);
|
||||
RETURN_TRUE;
|
||||
#else
|
||||
_php_ibase_module_error("ibase_timefmt not supported on this platform");
|
||||
RETURN_FALSE;
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
/* {{{ proto int ibase_num_fields(int result)
|
||||
Get the number of fields in result */
|
||||
|
@ -2392,7 +2388,7 @@ PHP_FUNCTION(ibase_num_fields)
|
|||
ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result, -1, "InterBase result", le_result);
|
||||
|
||||
if (ib_result->out_sqlda == NULL) {
|
||||
_php_ibase_module_error("trying to get num fields from a non-select query");
|
||||
_php_ibase_module_error("Trying to get the number of fields from a non-select query");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2420,7 +2416,7 @@ PHP_FUNCTION(ibase_field_info)
|
|||
ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, "InterBase result", le_result);
|
||||
|
||||
if (ib_result->out_sqlda == NULL) {
|
||||
_php_ibase_module_error("trying to get field info from a non-select query");
|
||||
_php_ibase_module_error("Trying to get field info from a non-select query");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2500,7 +2496,7 @@ static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_in
|
|||
bl_info->bl_stream = 0;
|
||||
|
||||
if (isc_blob_info(IB_STATUS, &bl_handle, sizeof(bl_items), bl_items, sizeof(bl_inf), bl_inf)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
@ -2527,7 +2523,7 @@ static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_in
|
|||
break;
|
||||
case isc_info_truncated:
|
||||
case isc_info_error: /* hmm. don't think so...*/
|
||||
_php_ibase_module_error("php module internal error in %s %d", __FILE__, __LINE__);
|
||||
_php_ibase_module_error("PHP module internal error");
|
||||
return FAILURE;
|
||||
} /*switch*/
|
||||
p += item_len;
|
||||
|
@ -2575,7 +2571,7 @@ PHP_FUNCTION(ibase_blob_create)
|
|||
|
||||
if (isc_create_blob(IB_STATUS, &ib_blob->link, &ib_blob->trans_handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) {
|
||||
efree(ib_blob);
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2611,7 +2607,7 @@ PHP_FUNCTION(ibase_blob_open)
|
|||
ib_blob->bl_handle = NULL;
|
||||
if (isc_open_blob(IB_STATUS, &ib_blob->link, &ib_blob->trans_handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) {
|
||||
efree(ib_blob);
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2637,7 +2633,7 @@ PHP_FUNCTION(ibase_blob_add)
|
|||
convert_to_string(string_arg);
|
||||
|
||||
if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) Z_STRLEN_P(string_arg), Z_STRVAL_P(string_arg))) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
|
@ -2674,7 +2670,7 @@ PHP_FUNCTION(ibase_blob_get)
|
|||
cur_len += seg_len;
|
||||
if (cur_len > max_len) { /* never!*/
|
||||
efree(bl_data);
|
||||
_php_ibase_module_error("php module internal error in %s %d", __FILE__, __LINE__);
|
||||
_php_ibase_module_error("PHP module internal error");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -2682,7 +2678,7 @@ PHP_FUNCTION(ibase_blob_get)
|
|||
bl_data[cur_len] = '\0';
|
||||
if (IB_STATUS[0] && (IB_STATUS[1] != isc_segstr_eof && IB_STATUS[1] != isc_segment)) {
|
||||
efree(bl_data);
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_STRINGL(bl_data, cur_len, 0);
|
||||
|
@ -2713,7 +2709,7 @@ static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end)
|
|||
if (bl_end == BLOB_CLOSE) { /* return id here */
|
||||
if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/
|
||||
if (isc_close_blob(IB_STATUS, &ib_blob->bl_handle)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -2722,7 +2718,7 @@ static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end)
|
|||
zend_list_delete(Z_LVAL_P(blob_arg));
|
||||
} else { /* discard created blob */
|
||||
if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ib_blob->bl_handle = NULL;
|
||||
|
@ -2771,7 +2767,7 @@ PHP_FUNCTION(ibase_blob_info)
|
|||
if (ib_blob_id->bl_qd.gds_quad_high || ib_blob_id->bl_qd.gds_quad_low) { /*not null ?*/
|
||||
if (isc_open_blob(IB_STATUS, &ib_blob_id->link, &ib_blob_id->trans_handle,
|
||||
&ib_blob_id->bl_handle, &ib_blob_id->bl_qd)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2779,7 +2775,7 @@ PHP_FUNCTION(ibase_blob_info)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
if (isc_close_blob(IB_STATUS, &ib_blob_id->bl_handle)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ib_blob_id->bl_handle = NULL;
|
||||
|
@ -2842,7 +2838,7 @@ PHP_FUNCTION(ibase_blob_echo)
|
|||
|
||||
if (isc_open_blob(IB_STATUS, &ib_blob_id->link, &ib_blob_id->trans_handle,
|
||||
&ib_blob_id->bl_handle, &ib_blob_id->bl_qd)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2852,12 +2848,12 @@ PHP_FUNCTION(ibase_blob_echo)
|
|||
}
|
||||
|
||||
if (IB_STATUS[0] && (IB_STATUS[1] != isc_segstr_eof)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (isc_close_blob(IB_STATUS, &ib_blob_id->bl_handle)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ib_blob_id->bl_handle = NULL;
|
||||
|
@ -2923,7 +2919,7 @@ PHP_FUNCTION(ibase_blob_import)
|
|||
ib_blob.bl_qd.gds_quad_low = 0;
|
||||
|
||||
if (isc_create_blob(IB_STATUS, &ib_blob.link, &ib_blob.trans_handle, &ib_blob.bl_handle, &ib_blob.bl_qd)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2931,7 +2927,7 @@ PHP_FUNCTION(ibase_blob_import)
|
|||
|
||||
while(b = php_stream_read(stream, bl_data, sizeof(bl_data)) > 0) {
|
||||
if (isc_put_segment(IB_STATUS, &ib_blob.bl_handle, b, bl_data)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
size += b;
|
||||
|
@ -2939,7 +2935,7 @@ PHP_FUNCTION(ibase_blob_import)
|
|||
}
|
||||
|
||||
if (isc_close_blob(IB_STATUS, &ib_blob.bl_handle)) {
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -3043,7 +3039,7 @@ static void _php_ibase_user(INTERNAL_FUNCTION_PARAMETERS, int operation)
|
|||
if (isc_service_attach(IB_STATUS, 0, service_name,
|
||||
&service_handle, spb_length, spb_buffer)) {
|
||||
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
else {
|
||||
|
@ -3089,7 +3085,7 @@ static void _php_ibase_user(INTERNAL_FUNCTION_PARAMETERS, int operation)
|
|||
if (isc_service_start(IB_STATUS, &service_handle,
|
||||
NULL, (unsigned short) (p - request), request)) {
|
||||
|
||||
_php_ibase_error();
|
||||
_php_ibase_error(TSRMLS_C);
|
||||
isc_service_detach(IB_STATUS, &service_handle);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue