@@ -463,53 +463,6 @@ static int php_firebird_preprocess(const zend_string* sql, char* sql_out, HashTa
463
463
464
464
#if FB_API_VER >= 40
465
465
/* set coercing a data type */
466
- static void set_coercing_input_data_types (XSQLDA * sqlda )
467
- {
468
- /* Data types introduced in Firebird 4.0 are difficult to process using the Firebird Legacy API. */
469
- /* These data types include DECFLOAT(16), DECFLOAT(34), INT128 (NUMERIC/DECIMAL(38, x)), */
470
- /* TIMESTAMP WITH TIME ZONE, and TIME WITH TIME ZONE. */
471
- /* This function allows you to ensure minimal performance */
472
- /* of queries if they contain parameters of the above types. */
473
- unsigned int i ;
474
- short dtype ;
475
- short nullable ;
476
- XSQLVAR * var ;
477
- for (i = 0 , var = sqlda -> sqlvar ; i < sqlda -> sqld ; i ++ , var ++ ) {
478
- dtype = (var -> sqltype & ~1 ); /* drop flag bit */
479
- nullable = (var -> sqltype & 1 );
480
- switch (dtype ) {
481
- case SQL_INT128 :
482
- var -> sqltype = SQL_VARYING + nullable ;
483
- var -> sqllen = 46 ;
484
- var -> sqlscale = 0 ;
485
- break ;
486
-
487
- case SQL_DEC16 :
488
- var -> sqltype = SQL_VARYING + nullable ;
489
- var -> sqllen = 24 ;
490
- break ;
491
-
492
- case SQL_DEC34 :
493
- var -> sqltype = SQL_VARYING + nullable ;
494
- var -> sqllen = 43 ;
495
- break ;
496
-
497
- case SQL_TIMESTAMP_TZ :
498
- var -> sqltype = SQL_VARYING + nullable ;
499
- var -> sqllen = 58 ;
500
- break ;
501
-
502
- case SQL_TIME_TZ :
503
- var -> sqltype = SQL_VARYING + nullable ;
504
- var -> sqllen = 46 ;
505
- break ;
506
-
507
- default :
508
- break ;
509
- }
510
- }
511
- }
512
-
513
466
static void set_coercing_output_data_types (XSQLDA * sqlda )
514
467
{
515
468
/* Data types introduced in Firebird 4.0 are difficult to process using the Firebird Legacy API. */
@@ -602,14 +555,12 @@ void php_firebird_set_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *state,
602
555
einfo -> errmsg_length = read_len ;
603
556
einfo -> errmsg = pestrndup (buf , read_len , dbh -> is_persistent );
604
557
605
- #if FB_API_VER >= 25
606
558
char sqlstate [sizeof (pdo_error_type )];
607
559
fb_sqlstate (sqlstate , H -> isc_status );
608
560
if (sqlstate != NULL && strlen (sqlstate ) < sizeof (pdo_error_type )) {
609
561
strcpy (* error_code , sqlstate );
610
562
goto end ;
611
563
}
612
- #endif
613
564
} else if (msg && msg_len ) {
614
565
einfo -> errmsg_length = msg_len ;
615
566
einfo -> errmsg = pestrndup (msg , einfo -> errmsg_length , dbh -> is_persistent );
@@ -730,11 +681,6 @@ static bool firebird_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, /* {{{ */
730
681
if (isc_dsql_describe_bind (H -> isc_status , & s , PDO_FB_SQLDA_VERSION , S -> in_sqlda )) {
731
682
break ;
732
683
}
733
-
734
- #if FB_API_VER >= 40
735
- /* set coercing a data type */
736
- set_coercing_input_data_types (S -> in_sqlda );
737
- #endif
738
684
}
739
685
740
686
stmt -> driver_data = S ;
@@ -1043,12 +989,6 @@ static int php_firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const zend_string *sq
1043
989
pdo_firebird_db_handle * H = (pdo_firebird_db_handle * )dbh -> driver_data ;
1044
990
char * new_sql ;
1045
991
1046
- /* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */
1047
- if (ZSTR_LEN (sql ) > 65536 ) {
1048
- php_firebird_error_with_info (dbh , "01004" , strlen ("01004" ), NULL , 0 );
1049
- return 0 ;
1050
- }
1051
-
1052
992
/* allocate the statement */
1053
993
if (isc_dsql_allocate_statement (H -> isc_status , & H -> db , s )) {
1054
994
php_firebird_error (dbh );
@@ -1333,7 +1273,6 @@ static int pdo_firebird_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val)
1333
1273
}
1334
1274
/* }}} */
1335
1275
1336
- #if FB_API_VER >= 30
1337
1276
/* called by PDO to check liveness */
1338
1277
static zend_result pdo_firebird_check_liveness (pdo_dbh_t * dbh ) /* {{{ */
1339
1278
{
@@ -1343,7 +1282,6 @@ static zend_result pdo_firebird_check_liveness(pdo_dbh_t *dbh) /* {{{ */
1343
1282
return fb_ping (H -> isc_status , & H -> db ) ? FAILURE : SUCCESS ;
1344
1283
}
1345
1284
/* }}} */
1346
- #endif
1347
1285
1348
1286
/* called by PDO to retrieve driver-specific information about an error that has occurred */
1349
1287
static void pdo_firebird_fetch_error_func (pdo_dbh_t * dbh , pdo_stmt_t * stmt , zval * info ) /* {{{ */
@@ -1383,11 +1321,7 @@ static const struct pdo_dbh_methods firebird_methods = { /* {{{ */
1383
1321
NULL , /* last_id not supported */
1384
1322
pdo_firebird_fetch_error_func ,
1385
1323
pdo_firebird_get_attribute ,
1386
- #if FB_API_VER >= 30
1387
1324
pdo_firebird_check_liveness ,
1388
- #else
1389
- NULL ,
1390
- #endif
1391
1325
NULL , /* get driver methods */
1392
1326
NULL , /* request shutdown */
1393
1327
pdo_firebird_in_manually_transaction ,
0 commit comments