diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/item.cc b/sql/item.cc index f1362e7e5da..adf70312b37 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. + Copyright (c) 2000, 2016, Oracle and/or its affiliates. Copyright (c) 2010, 2016, MariaDB This program is free software; you can redistribute it and/or modify @@ -1219,8 +1219,8 @@ Item *Item_param::safe_charset_converter(THD *thd, CHARSET_INFO *tocs) to it's possible that the converter will not be needed at all: PREPARE stmt FROM 'SELECT * FROM t1 WHERE field = ?'; - SET @@arg= 1; - EXECUTE stms USING @arg; + SET @arg= 1; + EXECUTE stmt USING @arg; In the above example result_type is STRING_RESULT at prepare time, and INT_RESULT at execution time. @@ -3701,7 +3701,7 @@ Item_param::eq(const Item *item, bool binary_cmp) const void Item_param::print(String *str, enum_query_type query_type) { - if (state == NO_VALUE) + if (state == NO_VALUE || query_type & QT_NO_DATA_EXPANSION) { str->append('?'); } @@ -6649,7 +6649,8 @@ Item *Item_field::update_value_transformer(THD *thd, uchar *select_arg) void Item_field::print(String *str, enum_query_type query_type) { - if (field && field->table->const_table) + if (field && field->table->const_table && + !(query_type & QT_NO_DATA_EXPANSION)) { print_value(str); return; |