summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-02-15 14:18:09 +0200
committerMichael Widenius <monty@askmonty.org>2013-02-15 14:18:09 +0200
commit35bc8f9f4353b64da215e52ff6f1612a8ce66f43 (patch)
treec60d86f82cc2030f821508dd42e56ae56e7df371 /sql
parent036ef7fe44b86131b73614dc438090818e23298c (diff)
parenta555ceb2fb75c9958e39c963ca2a83e615629711 (diff)
downloadmariadb-git-35bc8f9f4353b64da215e52ff6f1612a8ce66f43.tar.gz
Automatic merge
Diffstat (limited to 'sql')
-rw-r--r--sql/item_subselect.cc11
-rw-r--r--sql/mysqld.cc14
2 files changed, 14 insertions, 11 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index f2485fd50a1..87e96da8f62 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -2306,7 +2306,7 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join,
ref_pointer_array+i,
(char *)"<no matter>",
(char *)"<list ref>"));
- if (!abort_on_null)
+ if (!abort_on_null && select_lex->ref_pointer_array[i]->maybe_null)
{
Item *having_col_item=
new Item_is_not_null_test(this,
@@ -2325,10 +2325,6 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join,
(char *)"<no matter>",
(char *)"<list ref>"));
item= new Item_cond_or(item, item_isnull);
- /*
- TODO: why we create the above for cases where the right part
- cant be NULL?
- */
if (left_expr->element_index(i)->maybe_null)
{
if (!(item= new Item_func_trig_cond(item, get_cond_guard(i))))
@@ -2339,6 +2335,11 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join,
}
*having_item= and_items(*having_item, having_col_item);
}
+ if (!abort_on_null && left_expr->element_index(i)->maybe_null)
+ {
+ if (!(item= new Item_func_trig_cond(item, get_cond_guard(i))))
+ DBUG_RETURN(true);
+ }
*where_item= and_items(*where_item, item);
}
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index b20e0423281..2607297f2c9 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3654,6 +3654,14 @@ static int init_common_variables()
umask(((~my_umask) & 0666));
my_decimal_set_zero(&decimal_zero); // set decimal_zero constant;
+ if (pthread_key_create(&THR_THD,NULL) ||
+ pthread_key_create(&THR_MALLOC,NULL))
+ {
+ sql_print_error("Can't create thread-keys");
+ return 1;
+ }
+
+ set_current_thd(0);
set_malloc_size_cb(my_malloc_size_cb_func);
tzset(); // Set tzname
@@ -4200,12 +4208,6 @@ static int init_thread_environment()
PTHREAD_CREATE_DETACHED);
pthread_attr_setscope(&connection_attrib, PTHREAD_SCOPE_SYSTEM);
- if (pthread_key_create(&THR_THD,NULL) ||
- pthread_key_create(&THR_MALLOC,NULL))
- {
- sql_print_error("Can't create thread-keys");
- DBUG_RETURN(1);
- }
DBUG_RETURN(0);
}