Fixed bug #23936 (fail to select and fetch)

This commit is contained in:
Ard Biesheuvel 2003-08-12 13:19:36 +00:00
parent 9ac579c2c0
commit 5a30b61eba

View File

@ -64,6 +64,11 @@ A lot... */
#if HAVE_IBASE
#include <ibase.h>
#ifndef SQLDA_CURRENT_VERSION
#define SQLDA_CURRENT_VERSION SQLDA_VERSION1
#endif
#include <time.h>
#include "ext/standard/fsock.h"
#include "ext/standard/info.h"
@ -1180,7 +1185,7 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i
IB_QUERY->out_sqlda = (XSQLDA *) emalloc(XSQLDA_LENGTH(1));
IB_QUERY->out_sqlda->sqln = 1;
IB_QUERY->out_sqlda->version = SQLDA_VERSION1;
IB_QUERY->out_sqlda->version = SQLDA_CURRENT_VERSION;
if (isc_dsql_prepare(IB_STATUS, &IB_QUERY->trans, &IB_QUERY->stmt, 0, query, dialect, IB_QUERY->out_sqlda)) {
_php_ibase_error(TSRMLS_C);
@ -1191,8 +1196,8 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i
if (IB_QUERY->out_sqlda->sqld > IB_QUERY->out_sqlda->sqln) {
IB_QUERY->out_sqlda = erealloc(IB_QUERY->out_sqlda, XSQLDA_LENGTH(IB_QUERY->out_sqlda->sqld));
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)) {
IB_QUERY->out_sqlda->version = SQLDA_CURRENT_VERSION;
if (isc_dsql_describe(IB_STATUS, &IB_QUERY->stmt, SQLDA_CURRENT_VERSION, IB_QUERY->out_sqlda)) {
_php_ibase_error(TSRMLS_C);
goto _php_ibase_alloc_query_error;
}
@ -1201,8 +1206,8 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i
/* maybe have input placeholders? */
IB_QUERY->in_sqlda = emalloc(XSQLDA_LENGTH(1));
IB_QUERY->in_sqlda->sqln = 1;
IB_QUERY->in_sqlda->version = SQLDA_VERSION1;
if (isc_dsql_describe_bind(IB_STATUS, &IB_QUERY->stmt, SQLDA_VERSION1, IB_QUERY->in_sqlda)) {
IB_QUERY->in_sqlda->version = SQLDA_CURRENT_VERSION;
if (isc_dsql_describe_bind(IB_STATUS, &IB_QUERY->stmt, SQLDA_CURRENT_VERSION, IB_QUERY->in_sqlda)) {
_php_ibase_error(TSRMLS_C);
goto _php_ibase_alloc_query_error;
}
@ -1211,8 +1216,8 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i
if (IB_QUERY->in_sqlda->sqln < IB_QUERY->in_sqlda->sqld) {
IB_QUERY->in_sqlda = erealloc(IB_QUERY->in_sqlda, XSQLDA_LENGTH(IB_QUERY->in_sqlda->sqld));
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)) {
IB_QUERY->in_sqlda->version = SQLDA_CURRENT_VERSION;
if (isc_dsql_describe_bind(IB_STATUS, &IB_QUERY->stmt, SQLDA_CURRENT_VERSION, IB_QUERY->in_sqlda)) {
_php_ibase_error(TSRMLS_C);
goto _php_ibase_alloc_query_error;
}