~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Lee Bieber
  • Date: 2011-02-06 02:27:17 UTC
  • mfrom: (2147.2.3 build)
  • Revision ID: kalebral@gmail.com-20110206022717-dv2li8ky1wf49ju3
Merge Brian - table error updates
Merge Brian - parser updates
Merge Brian - more catalog work

Show diffs side-by-side

added added

removed removed

Lines of Context:
294
294
  with_sum_func(false),
295
295
  is_autogenerated_name(true),
296
296
  with_subselect(false),
297
 
  collation(&my_charset_bin, DERIVATION_COERCIBLE)
 
297
  collation(&my_charset_bin, DERIVATION_COERCIBLE),
 
298
  _session(*current_session)
298
299
{
299
300
  cmp_context= (Item_result)-1;
300
301
 
301
302
  /* Put item in free list so that we can free all items at end */
302
 
  Session *session= current_session;
303
 
  next= session->free_list;
304
 
  session->free_list= this;
 
303
  next= getSession().free_list;
 
304
  getSession().free_list= this;
305
305
 
306
306
  /*
307
307
    Item constructor can be called during execution other then SQL_COM
308
308
    command => we should check session->lex->current_select on zero (session->lex
309
309
    can be uninitialised)
310
310
  */
311
 
  if (session->lex->current_select)
 
311
  if (getSession().lex->current_select)
312
312
  {
313
 
    enum_parsing_place place= session->lex->current_select->parsing_place;
 
313
    enum_parsing_place place= getSession().getLex()->current_select->parsing_place;
314
314
    if (place == SELECT_LIST || place == IN_HAVING)
315
 
      session->lex->current_select->select_n_having_items++;
 
315
      getSession().getLex()->current_select->select_n_having_items++;
316
316
  }
317
317
}
318
318
 
333
333
  is_autogenerated_name(item->is_autogenerated_name),
334
334
  with_subselect(item->with_subselect),
335
335
  collation(item->collation),
336
 
  cmp_context(item->cmp_context)
 
336
  cmp_context(item->cmp_context),
 
337
  _session(*session)
337
338
{
338
339
  /* Put this item in the session's free list */
339
 
  next= session->free_list;
340
 
  session->free_list= this;
 
340
  next= getSession().free_list;
 
341
  getSession().free_list= this;
341
342
}
342
343
 
343
344
uint32_t Item::float_length(uint32_t decimals_par) const
518
519
{
519
520
  char buff[40];
520
521
  String tmp(buff,sizeof(buff),&my_charset_bin),*res;
521
 
  if (!(res=val_str(&tmp)) || str_to_time_with_warn(res->ptr(), res->length(), &ltime))
 
522
  if (!(res=val_str(&tmp)) or
 
523
      str_to_time_with_warn(current_session, res->ptr(), res->length(), &ltime))
522
524
  {
523
525
    ltime.reset();
524
526