50
50
#define IBDEBUG (a )
51
51
#endif
52
52
53
- #define ISC_LONG_MIN (1 << (8*sizeof(ISC_LONG)-1))
54
- #define ISC_LONG_MAX ~ISC_LONG_MIN
53
+ #define ISC_LONG_MIN INT_MIN
54
+ #define ISC_LONG_MAX INT_MAX
55
55
56
56
#define QUERY_RESULT 1
57
57
#define EXECUTE_RESULT 2
@@ -872,7 +872,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
872
872
{
873
873
char hash [16 ], * args [] = { NULL , NULL , NULL , NULL , NULL };
874
874
int i , len [] = { 0 , 0 , 0 , 0 , 0 };
875
- long largs [] = { 0 , SQL_DIALECT_CURRENT };
875
+ long largs [] = { 0 , 0 };
876
876
PHP_MD5_CTX hash_context ;
877
877
list_entry new_index_ptr , * le ;
878
878
isc_db_handle db_handle = NULL ;
@@ -2373,7 +2373,7 @@ PHP_FUNCTION(ibase_query)
2373
2373
ib_link -> dialect = SQL_DIALECT_CURRENT ;
2374
2374
ib_link -> tr_list = NULL ;
2375
2375
ib_link -> event_head = NULL ;
2376
-
2376
+
2377
2377
ZEND_REGISTER_RESOURCE (return_value , ib_link , le_link );
2378
2378
zend_list_addref (Z_LVAL_P (return_value ));
2379
2379
IBG (default_link ) = Z_LVAL_P (return_value );
@@ -2518,11 +2518,9 @@ PHP_FUNCTION(ibase_num_rows)
2518
2518
* - num_rows() for SELECT ... FOR UPDATE is broken -> never returns a
2519
2519
* higher number than the number of records fetched so far (no pre-fetch);
2520
2520
* - the result of num_rows() for other statements is merely a lower bound
2521
- * on the number of records => calling ibase_num_rows() again after a couple
2522
- * of fetches will most likely return a new (higher) figure for large result
2523
- * sets.
2524
- *
2525
- * 12-aug-2003 Ard Biesheuvel
2521
+ * on the number of records => calling ibase_num_rows() again after a couple
2522
+ * of fetches will most likely return a new (higher) figure for large result
2523
+ * sets.
2526
2524
*/
2527
2525
2528
2526
zval * * result_arg ;
@@ -3466,7 +3464,7 @@ PHP_FUNCTION(ibase_gen_id)
3466
3464
}
3467
3465
3468
3466
/* don't return the generator value as a string unless it doesn't fit in a long */
3469
- #ifdef SQL_INT64
3467
+ #if SQL_INT64 && SIZEOF_LONG < 8
3470
3468
if (result < LONG_MIN || result > LONG_MAX ) {
3471
3469
char res [24 ];
3472
3470
@@ -3478,7 +3476,7 @@ PHP_FUNCTION(ibase_gen_id)
3478
3476
}
3479
3477
3480
3478
/* }}} */
3481
-
3479
+
3482
3480
#endif /* HAVE_IBASE */
3483
3481
3484
3482
/*
0 commit comments