diff options
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index d2f1e9ed0d9..998936639cb 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -183,6 +183,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; @@ -269,8 +271,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); @@ -1432,7 +1434,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) || @@ -1445,7 +1447,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) || @@ -1458,7 +1460,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) @@ -1473,7 +1475,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 |