diff options
author | gkodinov/kgeorge@magare.gmz <> | 2007-03-11 10:17:09 +0200 |
---|---|---|
committer | gkodinov/kgeorge@magare.gmz <> | 2007-03-11 10:17:09 +0200 |
commit | 316b9e3153ae8fe9acd472234462c1a7bd8b4fa7 (patch) | |
tree | beab5a286c7cf4dedc662dc3bf3dbee8400f8ef9 /sql/item.cc | |
parent | c03a483c514c90577ea2c45ced4e9333a0213377 (diff) | |
parent | 11d37efa5e117c5f64870a00ec56b438b7e4dca9 (diff) | |
download | mariadb-git-316b9e3153ae8fe9acd472234462c1a7bd8b4fa7.tar.gz |
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into magare.gmz:/home/kgeorge/mysql/autopush/WL3527-5.1-opt
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sql/item.cc b/sql/item.cc index c423f17f52b..dcedfcb6d84 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1791,9 +1791,10 @@ void Item_ident::print(String *str) } } - if (!table_name || !field_name) + if (!table_name || !field_name || !field_name[0]) { - const char *nm= field_name ? field_name : name ? name : "tmp_field"; + const char *nm= (field_name && field_name[0]) ? + field_name : name ? name : "tmp_field"; append_identifier(thd, str, nm, (uint) strlen(nm)); return; } @@ -5002,6 +5003,22 @@ Item *Item_field::update_value_transformer(byte *select_arg) } +void Item_field::print(String *str) +{ + if (field && field->table->const_table) + { + char buff[MAX_FIELD_WIDTH]; + String tmp(buff,sizeof(buff),str->charset()); + field->val_str(&tmp); + str->append('\''); + str->append(tmp); + str->append('\''); + return; + } + Item_ident::print(str); +} + + Item_ref::Item_ref(Name_resolution_context *context_arg, Item **item, const char *table_name_arg, const char *field_name_arg, |