summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 0794d4c797a..d9f930b3cfb 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -182,6 +182,8 @@ THD::THD()
clear_next_insert_id(0), in_lock_tables(0), bootstrap(0),
derived_tables_processing(FALSE), spcont(NULL)
{
+ ulong tmp;
+
stmt_arena= this;
thread_stack= 0;
db= 0;
@@ -268,8 +270,8 @@ THD::THD()
protocol_prep.init(this);
tablespace_op=FALSE;
- ulong tmp=sql_rnd_with_mutex();
- randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::query_id);
+ tmp= sql_rnd_with_mutex();
+ randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::global_query_id);
substitute_null_with_insert_id = FALSE;
thr_lock_info_init(&lock_info); /* safety: will be reset after start */
thr_lock_owner_init(&main_lock_id, &lock_info);
@@ -1438,7 +1440,7 @@ bool select_max_min_finder_subselect::send_data(List<Item> &items)
bool select_max_min_finder_subselect::cmp_real()
{
- Item *maxmin= ((Item_singlerow_subselect *)item)->el(0);
+ Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
double val1= cache->val_real(), val2= maxmin->val_real();
if (fmax)
return (cache->null_value && !maxmin->null_value) ||
@@ -1451,7 +1453,7 @@ bool select_max_min_finder_subselect::cmp_real()
bool select_max_min_finder_subselect::cmp_int()
{
- Item *maxmin= ((Item_singlerow_subselect *)item)->el(0);
+ Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
longlong val1= cache->val_int(), val2= maxmin->val_int();
if (fmax)
return (cache->null_value && !maxmin->null_value) ||
@@ -1464,7 +1466,7 @@ bool select_max_min_finder_subselect::cmp_int()
bool select_max_min_finder_subselect::cmp_decimal()
{
- Item *maxmin= ((Item_singlerow_subselect *)item)->el(0);
+ Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
my_decimal cval, *cvalue= cache->val_decimal(&cval);
my_decimal mval, *mvalue= maxmin->val_decimal(&mval);
if (fmax)
@@ -1479,7 +1481,7 @@ bool select_max_min_finder_subselect::cmp_decimal()
bool select_max_min_finder_subselect::cmp_str()
{
String *val1, *val2, buf1, buf2;
- Item *maxmin= ((Item_singlerow_subselect *)item)->el(0);
+ Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
/*
as far as both operand is Item_cache buf1 & buf2 will not be used,
but added for safety