diff options
author | ramil/ram@mysql.com/ramil.myoffice.izhnet.ru <> | 2007-11-29 14:01:07 +0400 |
---|---|---|
committer | ramil/ram@mysql.com/ramil.myoffice.izhnet.ru <> | 2007-11-29 14:01:07 +0400 |
commit | 7bc2d42752814eaed50b151654f1101ae0b57582 (patch) | |
tree | 24d303febedced21c6b5f852457577f348de3b6e /sql/item.cc | |
parent | 92d4ea79ef7d5c5edff0a1f6a597b9293d9ba547 (diff) | |
parent | ac034767c0482ea234ac624ddda4a0cdcff46a8e (diff) | |
download | mariadb-git-7bc2d42752814eaed50b151654f1101ae0b57582.tar.gz |
Merge mysql.com:/home/ram/work/mysql-5.0-engines
into mysql.com:/home/ram/work/b32559/b32559.5.0
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index 431d82af331..a75d0159848 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1209,7 +1209,17 @@ bool Item_name_const::is_null() Item::Type Item_name_const::type() const { - return value_item->type(); + /* + As + 1. one can try to create the Item_name_const passing non-constant + arguments, although it's incorrect and + 2. the type() method can be called before the fix_fields() to get + type information for a further type cast, e.g. + if (item->type() == FIELD_ITEM) + ((Item_field *) item)->... + we return NULL_ITEM in the case to avoid wrong casting. + */ + return valid_args ? value_item->type() : NULL_ITEM; } |