| 959 | |
| 960 | |
| 961 | static bool insert_params(Prepared_statement *stmt, uchar *null_array, |
| 962 | uchar *read_pos, uchar *data_end, |
| 963 | String *expanded_query) |
| 964 | { |
| 965 | Item_param **begin= stmt->param_array; |
| 966 | Item_param **end= begin + stmt->param_count; |
| 967 | |
| 968 | DBUG_ENTER("insert_params"); |
| 969 | |
| 970 | for (Item_param **it= begin; it < end; ++it) |
| 971 | { |
| 972 | Item_param *param= *it; |
| 973 | param->indicator= STMT_INDICATOR_NONE; // only for bulk parameters |
| 974 | if (!param->has_long_data_value()) |
| 975 | { |
| 976 | if (is_param_null(null_array, (uint) (it - begin))) |
| 977 | param->set_null(); |
| 978 | else |
| 979 | { |
| 980 | if (read_pos >= data_end) |
| 981 | DBUG_RETURN(1); |
| 982 | param->set_param_func(&read_pos, (uint) (data_end - read_pos)); |
| 983 | if (param->has_no_value()) |
| 984 | DBUG_RETURN(1); |
| 985 | } |
| 986 | } |
| 987 | /* |
| 988 | A long data stream was supplied for this parameter marker. |
| 989 | This was done after prepare, prior to providing a placeholder |
| 990 | type (the types are supplied at execute). Check that the |
| 991 | supplied type of placeholder can accept a data stream. |
| 992 | */ |
| 993 | else if (!param->type_handler()->is_param_long_data_type()) |
| 994 | DBUG_RETURN(1); |
| 995 | if (param->convert_str_value(stmt->thd)) |
| 996 | DBUG_RETURN(1); /* out of memory */ |
| 997 | param->sync_clones(); |
| 998 | } |
| 999 | DBUG_RETURN(0); |
| 1000 | } |
| 1001 | |
| 1002 | |
| 1003 | static bool insert_bulk_params(Prepared_statement *stmt, |
nothing calls this directly
no test coverage detected