summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-12-06 21:11:27 +0200
committerunknown <monty@mashka.mysql.fi>2002-12-06 21:11:27 +0200
commitae4323e0d9fcbbca12b65f811cadb993b816d636 (patch)
tree969377c9c94475e559670dfcc0a8c4f7ed16b388 /sql/item_sum.cc
parent6d33f73416b5576b4e48412fd3a7342385c1c747 (diff)
downloadmariadb-git-ae4323e0d9fcbbca12b65f811cadb993b816d636.tar.gz
After merge fixes
Added THD to add_to_xxx_list() functions for faster parsing. heap/_check.c: After merge fix mysql-test/r/distinct.result: After merge fix mysql-test/r/multi_update.result: Make timestamp test portable mysql-test/t/multi_update.test: Make timestamp test portable sql/field.cc: After merge fix sql/item_sum.cc: After merge fix sql/log_event.cc: Remove compiler warning sql/mysql_priv.h: Added THD to add_to_list (Faster parsing) sql/sql_derived.cc: Fixed parameters to create_tmp_table() sql/sql_lex.cc: Added THD to add_to_list (Faster parsing) sql/sql_lex.h: Added THD to add_to_list (Faster parsing) sql/sql_parse.cc: Added THD to add_to_list (Faster parsing) sql/sql_select.cc: After merge fixes Fixed return values from JOIN::optimize() Replaced test_function_query with '!tables_list' Optimized arguments to create_tmp_table() sql/sql_select.h: Removed test_function_query variable Updated prototypes sql/sql_union.cc: Updated argument lists. sql/sql_update.cc: After merge fixes sql/sql_yacc.yy: Added THD to all add_xxx_to_list() functions sql/table.h: After merge fix
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index fe7523a5fc5..a1f772f4d46 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -43,7 +43,8 @@ Item_sum::Item_sum(List<Item> &list)
void Item_sum::mark_as_sum_func()
{
- current_thd->lex.current_select->with_sum_func= with_sum_func= 1;
+ current_thd->lex.current_select->with_sum_func=1;
+ with_sum_func= 1;
}
void Item_sum::make_field(Send_field *tmp_field)
@@ -991,9 +992,9 @@ bool Item_sum_count_distinct::setup(THD *thd)
tmp_table_param->cleanup();
}
if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1,
- 0, 0,
+ 0,
select_lex->options | thd->options,
- select_lex->master_unit())))
+ HA_POS_ERROR)))
return 1;
table->file->extra(HA_EXTRA_NO_ROWS); // Don't update rows
table->no_rows=1;
@@ -1091,7 +1092,7 @@ bool Item_sum_count_distinct::setup(THD *thd)
int Item_sum_count_distinct::tree_to_myisam()
{
- if (create_myisam_from_heap(table, tmp_table_param,
+ if (create_myisam_from_heap(current_thd, table, tmp_table_param,
HA_ERR_RECORD_FILE_FULL, 1) ||
tree_walk(&tree, (tree_walk_action)&dump_leaf, (void*)this,
left_root_right))
@@ -1137,7 +1138,8 @@ bool Item_sum_count_distinct::add()
if (tree_to_myisam())
return 1;
}
- else if (!tree_insert(&tree, table->record[0] + rec_offset, 0, tree.custom_arg))
+ else if (!tree_insert(&tree, table->record[0] + rec_offset, 0,
+ tree.custom_arg))
return 1;
}
else if ((error=table->file->write_row(table->record[0])))
@@ -1145,13 +1147,15 @@ bool Item_sum_count_distinct::add()
if (error != HA_ERR_FOUND_DUPP_KEY &&
error != HA_ERR_FOUND_DUPP_UNIQUE)
{
- if (create_myisam_from_heap(table, tmp_table_param, error,1))
+ if (create_myisam_from_heap(current_thd, table, tmp_table_param, error,
+ 1))
return 1; // Not a table_is_full error
}
}
return 0;
}
+
longlong Item_sum_count_distinct::val_int()
{
if (!table) // Empty query