@@ -470,10 +470,8 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ
470
470
}
471
471
472
472
if (colno >= stmt -> column_count ) {
473
- /* TODO Should this be a ValueError? */
474
- pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "Invalid column index" );
475
- ZVAL_FALSE (dest );
476
-
473
+ zend_value_error ("Invalid column index" );
474
+ ZVAL_NULL (dest );
477
475
return ;
478
476
}
479
477
@@ -697,7 +695,7 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
697
695
zend_type_error ("%s" , is_callable_error );
698
696
efree (is_callable_error );
699
697
} else {
700
- zend_type_error ("user -supplied function must be a valid callback" );
698
+ zend_type_error ("User -supplied function must be a valid callback" );
701
699
}
702
700
return false;
703
701
}
@@ -824,9 +822,9 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
824
822
zend_value_error ("Column index must be greater than or equal to 0" );
825
823
return false;
826
824
}
827
- /* TODO Always a ValueError? */
825
+
828
826
if (colno >= stmt -> column_count ) {
829
- pdo_raise_impl_error ( stmt -> dbh , stmt , "HY000" , "Invalid column index" );
827
+ zend_value_error ( "Invalid column index" );
830
828
return false;
831
829
}
832
830
@@ -1150,14 +1148,14 @@ static bool pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode
1150
1148
switch (mode ) {
1151
1149
case PDO_FETCH_FUNC :
1152
1150
if (!fetch_all ) {
1153
- zend_argument_value_error ( mode_arg_num , "can only use PDO::FETCH_FUNC in PDOStatement::fetchAll()" );
1151
+ zend_value_error ( "Can only use PDO::FETCH_FUNC in PDOStatement::fetchAll()" );
1154
1152
return 0 ;
1155
1153
}
1156
1154
return 1 ;
1157
1155
1158
1156
case PDO_FETCH_LAZY :
1159
1157
if (fetch_all ) {
1160
- zend_argument_value_error ( mode_arg_num , "cannot use PDO::FETCH_LAZY in PDOStatement::fetchAll()" );
1158
+ zend_value_error ( "Cannot be PDO::FETCH_LAZY in PDOStatement::fetchAll()" );
1161
1159
return 0 ;
1162
1160
}
1163
1161
/* fall through */
@@ -1171,7 +1169,6 @@ static bool pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode
1171
1169
return 0 ;
1172
1170
}
1173
1171
if (mode >= PDO_FETCH__MAX ) {
1174
- /* TODO Better error message? */
1175
1172
zend_argument_value_error (mode_arg_num , "must be a bitmask of PDO::FETCH_* constants" );
1176
1173
return 0 ;
1177
1174
}
@@ -1228,8 +1225,9 @@ PHP_METHOD(PDOStatement, fetchObject)
1228
1225
PHP_STMT_GET_OBJ ;
1229
1226
PDO_STMT_CLEAR_ERR ();
1230
1227
1231
- /* use pdo_stmt_verify_mode() to set fetch mode for this specific statement */
1232
- ZEND_ASSERT (pdo_stmt_verify_mode (stmt , PDO_FETCH_CLASS , 0 , false ));
1228
+ /* Use pdo_stmt_verify_mode() to set fetch mode for this specific statement */
1229
+ /* This should NOT fail */
1230
+ pdo_stmt_verify_mode (stmt , PDO_FETCH_CLASS , 0 , false);
1233
1231
1234
1232
old_ce = stmt -> fetch .cls .ce ;
1235
1233
ZVAL_COPY_VALUE (& old_ctor_args , & stmt -> fetch .cls .ctor_args );
0 commit comments