diff options
author | holyfoot/hf@mysql.com/hfmain.(none) <> | 2007-07-27 18:42:25 +0500 |
---|---|---|
committer | holyfoot/hf@mysql.com/hfmain.(none) <> | 2007-07-27 18:42:25 +0500 |
commit | 03dfd986d744e60c32d29cd227840131f43a0bab (patch) | |
tree | 20477688cf716b9cf6b80d50f62dc7bdebcee7ad /sql/item.h | |
parent | 14cbdecf7c061dbd4321d3fdc16a33751ebb22cf (diff) | |
download | mariadb-git-03dfd986d744e60c32d29cd227840131f43a0bab.tar.gz |
Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
Item_func_user doesn't calculate anything in it's val_str() method,
just returns saved str_value.
Though Item::save_in_field method can destroy str_value, relying on
val_str() return. As a result we get the garbage stored in field.
We cannot use Item::save_in_field implementation for Item_func_user,
reimplement it in simpler way.
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/item.h b/sql/item.h index 5b1a80a5f03..72236cb5e63 100644 --- a/sql/item.h +++ b/sql/item.h @@ -612,6 +612,7 @@ public: int save_time_in_field(Field *field); int save_date_in_field(Field *field); + int save_str_value_in_field(Field *field, String *result); virtual Field *get_tmp_table_field() { return 0; } /* This is also used to create fields in CREATE ... SELECT: */ @@ -2166,7 +2167,10 @@ public: my_decimal *val_decimal(my_decimal *); void make_field(Send_field *field) { item->make_field(field); } void copy(); - int save_in_field(Field *field, bool no_conversions); + int save_in_field(Field *field, bool no_conversions) + { + return save_str_value_in_field(field, &str_value); + } table_map used_tables() const { return (table_map) 1L; } bool const_item() const { return 0; } bool is_null() { return null_value; } |