Skip to content

Commit 6fa585e

Browse files
committed
Emit warning about unhandled sqltype
1 parent 025f24d commit 6fa585e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ibase_query.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -922,9 +922,9 @@ static void _php_ibase_alloc_xsqlda(XSQLDA *sqlda) /* {{{ */
922922
break;
923923
// Boolean data type exists since FB 3.0
924924
#ifdef SQL_BOOLEAN
925-
case SQL_BOOLEAN:
926-
var->sqldata = emalloc(sizeof(FB_BOOLEAN));
927-
break;
925+
case SQL_BOOLEAN:
926+
var->sqldata = emalloc(sizeof(FB_BOOLEAN));
927+
break;
928928
#endif
929929
case SQL_SHORT:
930930
var->sqldata = emalloc(sizeof(short));
@@ -954,6 +954,9 @@ static void _php_ibase_alloc_xsqlda(XSQLDA *sqlda) /* {{{ */
954954
case SQL_ARRAY:
955955
var->sqldata = emalloc(sizeof(ISC_QUAD));
956956
break;
957+
default:
958+
php_error(E_WARNING, "Unhandled sqltype: %d for sqlname %s %s:%d. This is most likely due to this PHP driver has been not kept up with newer server version", var->sqltype, var->sqlname, __FILE__, __LINE__);
959+
break;
957960
} /* switch */
958961

959962
if (var->sqltype & 1) { /* sql NULL flag */
@@ -1055,7 +1058,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
10551058
res->trans = ib_query->trans;
10561059
res->stmt = ib_query->stmt;
10571060
GC_ADDREF(res->stmt_res = ib_query->stmt_res);
1058-
1061+
10591062
res->statement_type = ib_query->statement_type;
10601063
res->has_more_rows = 1;
10611064

@@ -1811,7 +1814,7 @@ PHP_FUNCTION(ibase_free_result)
18111814

18121815
ib_result = (ibase_result *)zend_fetch_resource_ex(result_arg, LE_RESULT, le_result);
18131816
zend_list_delete(Z_RES_P(result_arg));
1814-
1817+
18151818
/*
18161819
* Bugfix of issue #40
18171820
* Reset pointer after freeing to NULL

0 commit comments

Comments
 (0)