diff options
author | unknown <sergefp@mysql.com> | 2005-02-22 21:58:10 +0300 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2005-02-22 21:58:10 +0300 |
commit | 6850c17f94e8f3c7a29eab75df643a7e96c8ba29 (patch) | |
tree | 87d65af643018b77177c3c06b4906713bc6e29de /sql | |
parent | 61f2abba64d06273688b468fe2327cbf2066ac83 (diff) | |
download | mariadb-git-6850c17f94e8f3c7a29eab75df643a7e96c8ba29.tar.gz |
Fix for BUG#8397 (second commit after review):
In Item_cache_decimal::store(item) the call item->val_decimal_result()
returns NULL if the passed item has an SQL null value. Don't try copying
NULL into Item_cache_decimal::val in this case.
mysql-test/r/type_decimal.result:
Test for BUG#8397
mysql-test/t/type_decimal.test:
Test for BUG#8397
sql/item.cc:
Fix for BUG#8397: In Item_cache_decimal::store(item) the call
item->val_decimal_result() returns NULL if the passed item has an SQL null
value. Don't try copying NULL into Item_cache_decimal::val in this case.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index 33e6d7cfc42..da9c98862b7 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4349,7 +4349,7 @@ my_decimal *Item_cache_real::val_decimal(my_decimal *decimal_val) void Item_cache_decimal::store(Item *item) { my_decimal *val= item->val_decimal_result(&decimal_value); - if (val != &decimal_value) + if (val != &decimal_value && !item->null_value) my_decimal2decimal(val, &decimal_value); null_value= item->null_value; } |