@@ -62,6 +62,7 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
62
62
param -> name = zend_string_init (name , strlen (name ), 0 );
63
63
return 1 ;
64
64
}
65
+ /* TODO Error? */
65
66
pdo_raise_impl_error (stmt -> dbh , stmt , "HY093" , "parameter was not defined" );
66
67
return 0 ;
67
68
}
@@ -72,12 +73,14 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
72
73
continue ;
73
74
}
74
75
if (param -> paramno >= 0 ) {
76
+ /* TODO Error? */
75
77
pdo_raise_impl_error (stmt -> dbh , stmt , "IM001" , "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead" );
76
78
return -1 ;
77
79
}
78
80
param -> paramno = position ;
79
81
return 1 ;
80
82
} ZEND_HASH_FOREACH_END ();
83
+ /* TODO Error? */
81
84
pdo_raise_impl_error (stmt -> dbh , stmt , "HY093" , "parameter was not defined" );
82
85
return 0 ;
83
86
}
@@ -267,6 +270,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
267
270
if (param -> paramno == -1 ) {
268
271
/* Should this always be an Error? */
269
272
char * tmp ;
273
+ /* TODO Error? */
270
274
spprintf (& tmp , 0 , "Did not find column name '%s' in the defined columns; it will not be bound" , ZSTR_VAL (param -> name ));
271
275
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , tmp );
272
276
efree (tmp );
@@ -674,7 +678,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */
674
678
fcc -> called_scope = ce ;
675
679
return 1 ;
676
680
} else if (!Z_ISUNDEF (stmt -> fetch .cls .ctor_args )) {
677
- /* Promote to Error? */
681
+ /* TODO Error? */
678
682
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it" );
679
683
return 0 ;
680
684
} else {
@@ -868,6 +872,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
868
872
}
869
873
ce = stmt -> fetch .cls .ce ;
870
874
if (!ce ) {
875
+ /* TODO ArgumentCountError? */
871
876
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "No fetch class specified" );
872
877
return 0 ;
873
878
}
@@ -885,6 +890,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
885
890
stmt -> fetch .cls .fci .object = Z_OBJ_P (return_value );
886
891
stmt -> fetch .cls .fcc .object = Z_OBJ_P (return_value );
887
892
if (zend_call_function (& stmt -> fetch .cls .fci , & stmt -> fetch .cls .fcc ) == FAILURE ) {
893
+ /* TODO Error? */
888
894
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "could not call class constructor" );
889
895
return 0 ;
890
896
} else {
@@ -899,6 +905,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
899
905
900
906
case PDO_FETCH_INTO :
901
907
if (Z_ISUNDEF (stmt -> fetch .into )) {
908
+ /* TODO ArgumentCountError? */
902
909
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "No fetch-into object specified." );
903
910
return 0 ;
904
911
break ;
@@ -913,6 +920,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
913
920
914
921
case PDO_FETCH_FUNC :
915
922
if (Z_ISUNDEF (stmt -> fetch .func .function )) {
923
+ /* TODO ArgumentCountError? */
916
924
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "No fetch function specified" );
917
925
return 0 ;
918
926
}
@@ -1059,6 +1067,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
1059
1067
stmt -> fetch .cls .fci .object = Z_OBJ_P (return_value );
1060
1068
stmt -> fetch .cls .fcc .object = Z_OBJ_P (return_value );
1061
1069
if (zend_call_function (& stmt -> fetch .cls .fci , & stmt -> fetch .cls .fcc ) == FAILURE ) {
1070
+ /* TODO Error? */
1062
1071
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "could not call class constructor" );
1063
1072
return 0 ;
1064
1073
} else {
@@ -1079,6 +1088,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
1079
1088
stmt -> fetch .func .fci .param_count = idx ;
1080
1089
stmt -> fetch .func .fci .retval = & retval ;
1081
1090
if (zend_call_function (& stmt -> fetch .func .fci , & stmt -> fetch .func .fcc ) == FAILURE ) {
1091
+ /* TODO Error? */
1082
1092
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "could not call user-supplied function" );
1083
1093
return 0 ;
1084
1094
} else {
@@ -2031,6 +2041,7 @@ static zval *dbstmt_prop_write(zend_object *object, zend_string *name, zval *val
2031
2041
pdo_stmt_t * stmt = php_pdo_stmt_fetch_object (object );
2032
2042
2033
2043
if (strcmp (ZSTR_VAL (name ), "queryString" ) == 0 ) {
2044
+ /* TODO Error? */
2034
2045
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "property queryString is read only" );
2035
2046
return value ;
2036
2047
} else {
@@ -2043,6 +2054,7 @@ static void dbstmt_prop_delete(zend_object *object, zend_string *name, void **ca
2043
2054
pdo_stmt_t * stmt = php_pdo_stmt_fetch_object (object );
2044
2055
2045
2056
if (strcmp (ZSTR_VAL (name ), "queryString" ) == 0 ) {
2057
+ /* TODO Error? */
2046
2058
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "property queryString is read only" );
2047
2059
} else {
2048
2060
zend_std_unset_property (object , name , cache_slot );
0 commit comments