summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMatthias Leich <Matthias.Leich@sun.com>2009-05-20 21:58:29 +0200
committerMatthias Leich <Matthias.Leich@sun.com>2009-05-20 21:58:29 +0200
commit8b5ea27aacd6482e24fa813a72e10ee9a3d298a9 (patch)
treec0cf6e4aac0a313613ec63865353543c9a327910 /sql
parent5f57ca86e62940bf68e99e63abe778da80fb0dec (diff)
parent6922ead265b844cd4bba63aec22535c821f7c5aa (diff)
downloadmariadb-git-8b5ea27aacd6482e24fa813a72e10ee9a3d298a9.tar.gz
Merge of latest modfications into GCA tree, no conflicts
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc28
-rw-r--r--sql/sql_prepare.cc3
2 files changed, 17 insertions, 14 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 5017464f968..a9bfea1b806 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -189,7 +189,6 @@ enum_field_types agg_field_type(Item **items, uint nitems)
collect_cmp_types()
items Array of items to collect types from
nitems Number of items in the array
- with_sum_func a sum function is referenced
DESCRIPTION
This function collects different result types for comparison of the first
@@ -200,7 +199,7 @@ enum_field_types agg_field_type(Item **items, uint nitems)
Bitmap of collected types - otherwise
*/
-static uint collect_cmp_types(Item **items, uint nitems, my_bool with_sum_func)
+static uint collect_cmp_types(Item **items, uint nitems)
{
uint i;
uint found_types;
@@ -216,16 +215,6 @@ static uint collect_cmp_types(Item **items, uint nitems, my_bool with_sum_func)
found_types|= 1<< (uint)item_cmp_type(left_result,
items[i]->result_type());
}
- if (with_sum_func || current_thd->lex->current_select->group_list.elements)
- {
- /*
- See TODO commentary in the setup_copy_fields function:
- item in a group may be wrapped with an Item_copy_string item.
- That item has a STRING_RESULT result type, so we need
- to take this type into account.
- */
- found_types |= (1 << item_cmp_type(left_result, STRING_RESULT));
- }
return found_types;
}
@@ -2733,8 +2722,19 @@ void Item_func_case::fix_length_and_dec()
for (nagg= 0; nagg < ncases/2 ; nagg++)
agg[nagg+1]= args[nagg*2];
nagg++;
- if (!(found_types= collect_cmp_types(agg, nagg, with_sum_func)))
+ if (!(found_types= collect_cmp_types(agg, nagg)))
return;
+ if (with_sum_func || current_thd->lex->current_select->group_list.elements)
+ {
+ /*
+ See TODO commentary in the setup_copy_fields function:
+ item in a group may be wrapped with an Item_copy_string item.
+ That item has a STRING_RESULT result type, so we need
+ to take this type into account.
+ */
+ found_types |= (1 << item_cmp_type(left_result_type, STRING_RESULT));
+ }
+
for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
{
if (found_types & (1 << i) && !cmp_items[i])
@@ -3525,7 +3525,7 @@ void Item_func_in::fix_length_and_dec()
uint type_cnt= 0, i;
Item_result cmp_type= STRING_RESULT;
left_result_type= args[0]->result_type();
- if (!(found_types= collect_cmp_types(args, arg_count, with_sum_func)))
+ if (!(found_types= collect_cmp_types(args, arg_count)))
return;
for (arg= args + 1, arg_end= args + arg_count; arg != arg_end ; arg++)
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index cd11b6d4c24..cc7ea75dbbf 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2461,6 +2461,9 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
stmt->execute_loop(&expanded_query, open_cursor, packet, packet_end);
+ /* Close connection socket; for use with client testing (Bug#43560). */
+ DBUG_EXECUTE_IF("close_conn_after_stmt_execute", vio_close(thd->net.vio););
+
DBUG_VOID_RETURN;
}