| 903 | */ |
| 904 | |
| 905 | static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array, |
| 906 | uchar *read_pos, uchar *data_end, |
| 907 | String *query) |
| 908 | { |
| 909 | THD *thd= stmt->thd; |
| 910 | Item_param **begin= stmt->param_array; |
| 911 | Item_param **end= begin + stmt->param_count; |
| 912 | Copy_query_with_rewrite acc(thd, stmt->query(), stmt->query_length(), query); |
| 913 | DBUG_ENTER("insert_params_with_log"); |
| 914 | |
| 915 | for (Item_param **it= begin; it < end; ++it) |
| 916 | { |
| 917 | Item_param *param= *it; |
| 918 | if (!param->has_long_data_value()) |
| 919 | { |
| 920 | if (is_param_null(null_array, (uint) (it - begin))) |
| 921 | param->set_null(); |
| 922 | else |
| 923 | { |
| 924 | if (read_pos >= data_end) |
| 925 | DBUG_RETURN(1); |
| 926 | param->set_param_func(&read_pos, (uint) (data_end - read_pos)); |
| 927 | if (param->has_no_value()) |
| 928 | DBUG_RETURN(1); |
| 929 | |
| 930 | if (param->limit_clause_param && !param->has_int_value()) |
| 931 | { |
| 932 | if (param->set_limit_clause_param(param->val_int())) |
| 933 | DBUG_RETURN(1); |
| 934 | } |
| 935 | } |
| 936 | } |
| 937 | /* |
| 938 | A long data stream was supplied for this parameter marker. |
| 939 | This was done after prepare, prior to providing a placeholder |
| 940 | type (the types are supplied at execute). Check that the |
| 941 | supplied type of placeholder can accept a data stream. |
| 942 | */ |
| 943 | else if (!param->type_handler()->is_param_long_data_type()) |
| 944 | DBUG_RETURN(1); |
| 945 | |
| 946 | if (acc.append(param)) |
| 947 | DBUG_RETURN(1); |
| 948 | |
| 949 | if (param->convert_str_value(thd)) |
| 950 | DBUG_RETURN(1); /* out of memory */ |
| 951 | |
| 952 | param->sync_clones(); |
| 953 | } |
| 954 | if (acc.finalize()) |
| 955 | DBUG_RETURN(1); |
| 956 | |
| 957 | DBUG_RETURN(0); |
| 958 | } |
| 959 | |
| 960 | |
| 961 | static bool insert_params(Prepared_statement *stmt, uchar *null_array, |
nothing calls this directly
no test coverage detected