@@ -341,13 +341,13 @@ PHP_METHOD(PDOStatement, execute)
341
341
{
342
342
zval * input_params = NULL ;
343
343
int ret = 1 ;
344
- PHP_STMT_GET_OBJ ;
345
344
346
345
ZEND_PARSE_PARAMETERS_START (0 , 1 )
347
346
Z_PARAM_OPTIONAL
348
347
Z_PARAM_ARRAY_OR_NULL (input_params )
349
348
ZEND_PARSE_PARAMETERS_END ();
350
349
350
+ PHP_STMT_GET_OBJ ;
351
351
PDO_STMT_CLEAR_ERR ();
352
352
353
353
if (input_params ) {
@@ -1163,7 +1163,6 @@ PHP_METHOD(PDOStatement, fetch)
1163
1163
zend_long how = PDO_FETCH_USE_DEFAULT ;
1164
1164
zend_long ori = PDO_FETCH_ORI_NEXT ;
1165
1165
zend_long off = 0 ;
1166
- PHP_STMT_GET_OBJ ;
1167
1166
1168
1167
ZEND_PARSE_PARAMETERS_START (0 , 3 )
1169
1168
Z_PARAM_OPTIONAL
@@ -1172,6 +1171,7 @@ PHP_METHOD(PDOStatement, fetch)
1172
1171
Z_PARAM_LONG (off )
1173
1172
ZEND_PARSE_PARAMETERS_END ();
1174
1173
1174
+ PHP_STMT_GET_OBJ ;
1175
1175
PDO_STMT_CLEAR_ERR ();
1176
1176
1177
1177
if (!pdo_stmt_verify_mode (stmt , how , 0 )) {
@@ -1196,14 +1196,13 @@ PHP_METHOD(PDOStatement, fetchObject)
1196
1196
zval old_ctor_args , * ctor_args = NULL ;
1197
1197
int error = 0 , old_arg_count ;
1198
1198
1199
- PHP_STMT_GET_OBJ ;
1200
-
1201
1199
ZEND_PARSE_PARAMETERS_START (0 , 2 )
1202
1200
Z_PARAM_OPTIONAL
1203
1201
Z_PARAM_STR_EX (class_name , 1 , 0 )
1204
1202
Z_PARAM_ARRAY (ctor_args )
1205
1203
ZEND_PARSE_PARAMETERS_END ();
1206
1204
1205
+ PHP_STMT_GET_OBJ ;
1207
1206
PDO_STMT_CLEAR_ERR ();
1208
1207
1209
1208
if (!pdo_stmt_verify_mode (stmt , how , 0 )) {
@@ -1255,13 +1254,13 @@ PHP_METHOD(PDOStatement, fetchObject)
1255
1254
PHP_METHOD (PDOStatement , fetchColumn )
1256
1255
{
1257
1256
zend_long col_n = 0 ;
1258
- PHP_STMT_GET_OBJ ;
1259
1257
1260
1258
ZEND_PARSE_PARAMETERS_START (0 , 1 )
1261
1259
Z_PARAM_OPTIONAL
1262
1260
Z_PARAM_LONG (col_n )
1263
1261
ZEND_PARSE_PARAMETERS_END ();
1264
1262
1263
+ PHP_STMT_GET_OBJ ;
1265
1264
PDO_STMT_CLEAR_ERR ();
1266
1265
1267
1266
if (!do_fetch_common (stmt , PDO_FETCH_ORI_NEXT , 0 , TRUE)) {
@@ -1282,7 +1281,6 @@ PHP_METHOD(PDOStatement, fetchAll)
1282
1281
zend_class_entry * old_ce ;
1283
1282
zval old_ctor_args , * ctor_args = NULL ;
1284
1283
int error = 0 , flags , old_arg_count ;
1285
- PHP_STMT_GET_OBJ ;
1286
1284
1287
1285
ZEND_PARSE_PARAMETERS_START (0 , 3 )
1288
1286
Z_PARAM_OPTIONAL
@@ -1291,6 +1289,7 @@ PHP_METHOD(PDOStatement, fetchAll)
1291
1289
Z_PARAM_ZVAL (ctor_args )
1292
1290
ZEND_PARSE_PARAMETERS_END ();
1293
1291
1292
+ PHP_STMT_GET_OBJ ;
1294
1293
if (!pdo_stmt_verify_mode (stmt , how , 1 )) {
1295
1294
RETURN_FALSE ;
1296
1295
}
@@ -1484,7 +1483,6 @@ PHP_METHOD(PDOStatement, bindValue)
1484
1483
struct pdo_bound_param_data param ;
1485
1484
zend_long param_type = PDO_PARAM_STR ;
1486
1485
zval * parameter ;
1487
- PHP_STMT_GET_OBJ ;
1488
1486
1489
1487
memset (& param , 0 , sizeof (param ));
1490
1488
param .paramno = -1 ;
@@ -1497,6 +1495,7 @@ PHP_METHOD(PDOStatement, bindValue)
1497
1495
}
1498
1496
}
1499
1497
1498
+ PHP_STMT_GET_OBJ ;
1500
1499
param .param_type = (int ) param_type ;
1501
1500
1502
1501
if (param .paramno > 0 ) {
@@ -1537,21 +1536,19 @@ PHP_METHOD(PDOStatement, bindColumn)
1537
1536
/* {{{ Returns the number of rows in a result set, or the number of rows affected by the last execute(). It is not always meaningful. */
1538
1537
PHP_METHOD (PDOStatement , rowCount )
1539
1538
{
1540
- PHP_STMT_GET_OBJ ;
1541
-
1542
1539
ZEND_PARSE_PARAMETERS_NONE ();
1543
1540
1541
+ PHP_STMT_GET_OBJ ;
1544
1542
RETURN_LONG (stmt -> row_count );
1545
1543
}
1546
1544
/* }}} */
1547
1545
1548
1546
/* {{{ Fetch the error code associated with the last operation on the statement handle */
1549
1547
PHP_METHOD (PDOStatement , errorCode )
1550
1548
{
1551
- PHP_STMT_GET_OBJ ;
1552
-
1553
1549
ZEND_PARSE_PARAMETERS_NONE ();
1554
1550
1551
+ PHP_STMT_GET_OBJ ;
1555
1552
if (stmt -> error_code [0 ] == '\0' ) {
1556
1553
RETURN_NULL ();
1557
1554
}
@@ -1567,10 +1564,9 @@ PHP_METHOD(PDOStatement, errorInfo)
1567
1564
int error_count_diff = 0 ;
1568
1565
int error_expected_count = 3 ;
1569
1566
1570
- PHP_STMT_GET_OBJ ;
1571
-
1572
1567
ZEND_PARSE_PARAMETERS_NONE ();
1573
1568
1569
+ PHP_STMT_GET_OBJ ;
1574
1570
array_init (return_value );
1575
1571
add_next_index_string (return_value , stmt -> error_code );
1576
1572
@@ -1596,13 +1592,13 @@ PHP_METHOD(PDOStatement, setAttribute)
1596
1592
{
1597
1593
zend_long attr ;
1598
1594
zval * value = NULL ;
1599
- PHP_STMT_GET_OBJ ;
1600
1595
1601
1596
ZEND_PARSE_PARAMETERS_START (2 , 2 )
1602
1597
Z_PARAM_LONG (attr )
1603
1598
Z_PARAM_ZVAL_EX (value , 1 , 0 )
1604
1599
ZEND_PARSE_PARAMETERS_END ();
1605
1600
1601
+ PHP_STMT_GET_OBJ ;
1606
1602
if (!stmt -> methods -> set_attribute ) {
1607
1603
goto fail ;
1608
1604
}
@@ -1637,12 +1633,12 @@ static int generic_stmt_attr_get(pdo_stmt_t *stmt, zval *return_value, zend_long
1637
1633
PHP_METHOD (PDOStatement , getAttribute )
1638
1634
{
1639
1635
zend_long attr ;
1640
- PHP_STMT_GET_OBJ ;
1641
1636
1642
1637
ZEND_PARSE_PARAMETERS_START (1 , 1 )
1643
1638
Z_PARAM_LONG (attr )
1644
1639
ZEND_PARSE_PARAMETERS_END ();
1645
1640
1641
+ PHP_STMT_GET_OBJ ;
1646
1642
if (!stmt -> methods -> get_attribute ) {
1647
1643
if (!generic_stmt_attr_get (stmt , return_value , attr )) {
1648
1644
pdo_raise_impl_error (stmt -> dbh , stmt , "IM001" ,
@@ -1676,10 +1672,9 @@ PHP_METHOD(PDOStatement, getAttribute)
1676
1672
/* {{{ Returns the number of columns in the result set */
1677
1673
PHP_METHOD (PDOStatement , columnCount )
1678
1674
{
1679
- PHP_STMT_GET_OBJ ;
1680
-
1681
1675
ZEND_PARSE_PARAMETERS_NONE ();
1682
1676
1677
+ PHP_STMT_GET_OBJ ;
1683
1678
RETURN_LONG (stmt -> column_count );
1684
1679
}
1685
1680
/* }}} */
@@ -1689,12 +1684,12 @@ PHP_METHOD(PDOStatement, getColumnMeta)
1689
1684
{
1690
1685
zend_long colno ;
1691
1686
struct pdo_column_data * col ;
1692
- PHP_STMT_GET_OBJ ;
1693
1687
1694
1688
ZEND_PARSE_PARAMETERS_START (1 , 1 )
1695
1689
Z_PARAM_LONG (colno )
1696
1690
ZEND_PARSE_PARAMETERS_END ();
1697
1691
1692
+ PHP_STMT_GET_OBJ ;
1698
1693
if (colno < 0 ) {
1699
1694
pdo_raise_impl_error (stmt -> dbh , stmt , "42P10" , "column number must be non-negative" );
1700
1695
RETURN_FALSE ;
@@ -1876,12 +1871,12 @@ PHP_METHOD(PDOStatement, setFetchMode)
1876
1871
zend_long fetch_mode ;
1877
1872
zval * args = NULL ;
1878
1873
uint32_t num_args = 0 ;
1879
- PHP_STMT_GET_OBJ ;
1880
1874
1881
1875
if (zend_parse_parameters (ZEND_NUM_ARGS (), "l*" , & fetch_mode , & args , & num_args ) == FAILURE ) {
1882
1876
RETURN_THROWS ();
1883
1877
}
1884
1878
1879
+ PHP_STMT_GET_OBJ ;
1885
1880
RETVAL_BOOL (pdo_stmt_setup_fetch_mode (stmt , fetch_mode , args , num_args ) == SUCCESS );
1886
1881
}
1887
1882
/* }}} */
@@ -1918,10 +1913,9 @@ static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt)
1918
1913
1919
1914
PHP_METHOD (PDOStatement , nextRowset )
1920
1915
{
1921
- PHP_STMT_GET_OBJ ;
1922
-
1923
1916
ZEND_PARSE_PARAMETERS_NONE ();
1924
1917
1918
+ PHP_STMT_GET_OBJ ;
1925
1919
if (!stmt -> methods -> next_rowset ) {
1926
1920
pdo_raise_impl_error (stmt -> dbh , stmt , "IM001" , "driver does not support multiple rowsets" );
1927
1921
RETURN_FALSE ;
@@ -1941,10 +1935,9 @@ PHP_METHOD(PDOStatement, nextRowset)
1941
1935
/* {{{ Closes the cursor, leaving the statement ready for re-execution. */
1942
1936
PHP_METHOD (PDOStatement , closeCursor )
1943
1937
{
1944
- PHP_STMT_GET_OBJ ;
1945
-
1946
1938
ZEND_PARSE_PARAMETERS_NONE ();
1947
1939
1940
+ PHP_STMT_GET_OBJ ;
1948
1941
if (!stmt -> methods -> cursor_closer ) {
1949
1942
/* emulate it by fetching and discarding rows */
1950
1943
do {
@@ -1981,10 +1974,10 @@ PHP_METHOD(PDOStatement, debugDumpParams)
1981
1974
1982
1975
php_stream * out = php_stream_open_wrapper ("php://output" , "w" , 0 , NULL );
1983
1976
struct pdo_bound_param_data * param ;
1984
- PHP_STMT_GET_OBJ ;
1985
1977
1986
1978
ZEND_PARSE_PARAMETERS_NONE ();
1987
1979
1980
+ PHP_STMT_GET_OBJ ;
1988
1981
if (out == NULL ) {
1989
1982
RETURN_FALSE ;
1990
1983
}
0 commit comments