diff options
author | monty@mysql.com <> | 2005-02-15 19:35:28 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2005-02-15 19:35:28 +0200 |
commit | 7bc48798fce1b4010adbd074aa18784fcf0eb07e (patch) | |
tree | 596e92c0368c67ad6d1a8b0700f0b9745f015360 /sql/item_cmpfunc.cc | |
parent | 556cf40db14528048501b84e36744747da9a862d (diff) | |
download | mariadb-git-7bc48798fce1b4010adbd074aa18784fcf0eb07e.tar.gz |
Safety fix
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 96e91ea27ad..0fa7ffcdda8 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2047,7 +2047,8 @@ int cmp_item_row::compare(cmp_item *c) void cmp_item_decimal::store_value(Item *item) { my_decimal *val= item->val_decimal(&value); - if (val != &value) + /* val may be zero if item is nnull */ + if (val && val != &value) my_decimal2decimal(val, &value); } @@ -2061,9 +2062,9 @@ int cmp_item_decimal::cmp(Item *arg) } -int cmp_item_decimal::compare(cmp_item *c) +int cmp_item_decimal::compare(cmp_item *arg) { - cmp_item_decimal *cmp= (cmp_item_decimal *)c; + cmp_item_decimal *cmp= (cmp_item_decimal*) arg; return my_decimal_cmp(&value, &cmp->value); } |