diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-04-20 15:25:55 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-04-20 15:25:55 +0200 |
commit | b069d19284b70ead3ceb62618acdc8ef93a2703e (patch) | |
tree | 0d5f6764825d51db3b8a37c8043d837c06e3e086 /sql/item.cc | |
parent | 1bc0b0b5245977172e2c3a3c64a42a2c4e762e06 (diff) | |
parent | e7061f7e5a96c66cb2e0bf46bec7f6ff35801a69 (diff) | |
download | mariadb-git-b069d19284b70ead3ceb62618acdc8ef93a2703e.tar.gz |
Merge branch 'mysql/5.5' into 5.5
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc index 3d3f472afc5..3d339334b0d 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 @@ -1272,6 +1272,11 @@ Item *Item_param::safe_charset_converter(CHARSET_INFO *tocs) { uint cnv_errors; String *ostr= val_str(&cnvstr); + if (null_value) + { + Item_null *n= new Item_null(); + return n ? n->safe_charset_converter(tocs) : NULL; + } cnvitem->str_value.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &cnv_errors); if (cnv_errors) @@ -3888,7 +3893,7 @@ Item_param::eq(const Item *arg, 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('?'); } @@ -6753,7 +6758,8 @@ Item *Item_field::update_value_transformer(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; |