@@ -1343,8 +1343,10 @@ PHP_METHOD(PDOStatement, fetchAll)
1343
1343
1344
1344
case PDO_FETCH_FUNC : /* Cannot be a default fetch mode */
1345
1345
if (ZEND_NUM_ARGS () != 2 ) {
1346
+ zend_string * func = get_active_function_or_method_name ();
1346
1347
zend_argument_count_error ("%s() expects exactly 2 argument for PDO::FETCH_FUNC, %d given" ,
1347
- ZSTR_VAL (get_active_function_or_method_name ()), ZEND_NUM_ARGS ());
1348
+ ZSTR_VAL (func ), ZEND_NUM_ARGS ());
1349
+ zend_string_release (func );
1348
1350
RETURN_THROWS ();
1349
1351
}
1350
1352
if (arg2 == NULL ) {
@@ -1360,8 +1362,10 @@ PHP_METHOD(PDOStatement, fetchAll)
1360
1362
1361
1363
case PDO_FETCH_COLUMN :
1362
1364
if (ZEND_NUM_ARGS () > 2 ) {
1365
+ zend_string * func = get_active_function_or_method_name ();
1363
1366
zend_argument_count_error ("%s() expects at most 2 argument for the fetch mode provided, %d given" ,
1364
- ZSTR_VAL (get_active_function_or_method_name ()), ZEND_NUM_ARGS ());
1367
+ ZSTR_VAL (func ), ZEND_NUM_ARGS ());
1368
+ zend_string_release (func );
1365
1369
RETURN_THROWS ();
1366
1370
}
1367
1371
/* Is column index passed? */
@@ -1384,8 +1388,10 @@ PHP_METHOD(PDOStatement, fetchAll)
1384
1388
default :
1385
1389
/* No support for PDO_FETCH_INTO which takes 2 args??? */
1386
1390
if (ZEND_NUM_ARGS () > 1 ) {
1391
+ zend_string * func = get_active_function_or_method_name ();
1387
1392
zend_argument_count_error ("%s() expects exactly 1 argument for the fetch mode provided, %d given" ,
1388
- ZSTR_VAL (get_active_function_or_method_name ()), ZEND_NUM_ARGS ());
1393
+ ZSTR_VAL (func ), ZEND_NUM_ARGS ());
1394
+ zend_string_release (func );
1389
1395
RETURN_THROWS ();
1390
1396
}
1391
1397
}
@@ -1767,16 +1773,20 @@ bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, uint32_t total_num_args, zend_l
1767
1773
case PDO_FETCH_NAMED :
1768
1774
case PDO_FETCH_KEY_PAIR :
1769
1775
if (total_num_args != mode_arg_num ) {
1776
+ zend_string * func = get_active_function_or_method_name ();
1770
1777
zend_argument_count_error ("%s() expects exactly %d argument for the fetch mode provided, %d given" ,
1771
- ZSTR_VAL (get_active_function_or_method_name ()), mode_arg_num , total_num_args );
1778
+ ZSTR_VAL (func ), mode_arg_num , total_num_args );
1779
+ zend_string_release (func );
1772
1780
return false;
1773
1781
}
1774
1782
break ;
1775
1783
1776
1784
case PDO_FETCH_COLUMN :
1777
1785
if (total_num_args != arg1_arg_num ) {
1786
+ zend_string * func = get_active_function_or_method_name ();
1778
1787
zend_argument_count_error ("%s() expects exactly %d argument for the fetch mode provided, %d given" ,
1779
- ZSTR_VAL (get_active_function_or_method_name ()), arg1_arg_num , total_num_args );
1788
+ ZSTR_VAL (func ), arg1_arg_num , total_num_args );
1789
+ zend_string_release (func );
1780
1790
return false;
1781
1791
}
1782
1792
if (Z_TYPE_P (arg1 ) != IS_LONG ) {
@@ -1796,17 +1806,21 @@ bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, uint32_t total_num_args, zend_l
1796
1806
/* Gets its class name from 1st column */
1797
1807
if ((flags & PDO_FETCH_CLASSTYPE ) == PDO_FETCH_CLASSTYPE ) {
1798
1808
if (arg1 || constructor_args ) {
1809
+ zend_string * func = get_active_function_or_method_name ();
1799
1810
zend_argument_count_error ("%s() expects exactly %d argument for the fetch mode provided, %d given" ,
1800
- ZSTR_VAL (get_active_function_or_method_name ()), mode_arg_num , total_num_args );
1811
+ ZSTR_VAL (func ), mode_arg_num , total_num_args );
1812
+ zend_string_release (func );
1801
1813
return false;
1802
1814
}
1803
1815
stmt -> fetch .cls .ce = NULL ;
1804
1816
} else {
1805
1817
zend_class_entry * cep ;
1806
1818
1807
1819
if (!arg1 || total_num_args > constructor_arg_num ) {
1820
+ zend_string * func = get_active_function_or_method_name ();
1808
1821
zend_argument_count_error ("%s() expects exactly %d argument for the fetch mode provided, %d given" ,
1809
- ZSTR_VAL (get_active_function_or_method_name ()), constructor_arg_num , total_num_args );
1822
+ ZSTR_VAL (func ), constructor_arg_num , total_num_args );
1823
+ zend_string_release (func );
1810
1824
return false;
1811
1825
}
1812
1826
if (Z_TYPE_P (arg1 ) != IS_STRING ) {
@@ -1829,8 +1843,10 @@ bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, uint32_t total_num_args, zend_l
1829
1843
1830
1844
case PDO_FETCH_INTO :
1831
1845
if (total_num_args != arg1_arg_num ) {
1846
+ zend_string * func = get_active_function_or_method_name ();
1832
1847
zend_argument_count_error ("%s() expects exactly %d argument for the fetch mode provided, %d given" ,
1833
- ZSTR_VAL (get_active_function_or_method_name ()), arg1_arg_num , total_num_args );
1848
+ ZSTR_VAL (func ), arg1_arg_num , total_num_args );
1849
+ zend_string_release (func );
1834
1850
return false;
1835
1851
}
1836
1852
if (Z_TYPE_P (arg1 ) != IS_OBJECT ) {
@@ -1886,7 +1902,7 @@ PHP_METHOD(PDOStatement, setFetchMode)
1886
1902
1887
1903
/* {{{ Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeeded, false otherwise */
1888
1904
1889
- static int pdo_stmt_do_next_rowset (pdo_stmt_t * stmt )
1905
+ static bool pdo_stmt_do_next_rowset (pdo_stmt_t * stmt )
1890
1906
{
1891
1907
/* un-describe */
1892
1908
if (stmt -> columns ) {
0 commit comments