MCPcopy Create free account
hub / github.com/MariaDB/server / insert_params

Function insert_params

sql/sql_prepare.cc:961–1000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

959
960
961static 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
1003static bool insert_bulk_params(Prepared_statement *stmt,

Callers

nothing calls this directly

Calls 9

is_param_nullFunction · 0.85
has_long_data_valueMethod · 0.80
set_param_funcMethod · 0.80
has_no_valueMethod · 0.80
convert_str_valueMethod · 0.80
sync_clonesMethod · 0.80
set_nullMethod · 0.45
type_handlerMethod · 0.45

Tested by

no test coverage detected