summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-07-04 03:42:33 +0300
committermonty@mysql.com <>2005-07-04 03:42:33 +0300
commitec420bfb43b22db63a622d5c4f6498481070bb0c (patch)
tree502bf1c54d87aaf8e4cafea943108c20d146cacc /sql/item_cmpfunc.cc
parente4bb8377c7dcfc7516e9da21bad6392d4898b35e (diff)
downloadmariadb-git-ec420bfb43b22db63a622d5c4f6498481070bb0c.tar.gz
Fixes during review of new code
- Mostly indentation fixes - Added missing test - Ensure that Item_func_case() checks for stack overruns - Use real_item() instead of (Item_ref*) item - Fixed wrong error handling
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 58a7f3316d7..a3be5ec6cd1 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -275,7 +275,7 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
owner= item;
func= comparator_matrix[type]
[test(owner->functype() == Item_func::EQUAL_FUNC)];
- switch(type) {
+ switch (type) {
case ROW_RESULT:
{
uint n= (*a)->cols();
@@ -1581,6 +1581,21 @@ my_decimal *Item_func_case::val_decimal(my_decimal *decimal_value)
}
+bool Item_func_case::fix_fields(THD *thd, struct st_table_list *tables,
+ Item **ref)
+{
+ /*
+ buff should match stack usage from
+ Item_func_case::val_int() -> Item_func_case::find_item()
+ */
+ char buff[MAX_FIELD_WIDTH*2+sizeof(String)*2+sizeof(String*)*2+sizeof(double)*2+sizeof(longlong)*2];
+ if (check_stack_overrun(thd, STACK_MIN_SIZE, buff))
+ return TRUE; // Fatal error flag is set!
+ return Item_func::fix_fields(thd, tables, ref);
+}
+
+
+
void Item_func_case::fix_length_and_dec()
{
Item **agg;