~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-28 17:30:49 UTC
  • mto: This revision was merged to the branch mainline in revision 2362.
  • Revision ID: olafvdspek@gmail.com-20110628173049-tubak2je3jz52wod
Remove unused Item::orig_name
Add some const

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
  is_expensive_cache(-1),
285
285
  name(0), 
286
286
  name_length(0),
287
 
  orig_name(0), 
288
287
  max_length(0), 
289
288
  marker(0),
290
289
  decimals(0),
322
321
  str_value(item->str_value),
323
322
  name(item->name),
324
323
  name_length(item->name_length),
325
 
  orig_name(item->orig_name),
326
324
  max_length(item->max_length),
327
325
  marker(item->marker),
328
326
  decimals(item->decimals),
385
383
{
386
384
  fixed= false;
387
385
  marker= 0;
388
 
  if (orig_name)
389
 
    name= orig_name;
390
 
  return;
391
 
}
392
 
 
393
 
void Item::rename(char *new_name)
394
 
{
395
 
  /*
396
 
    we can compare pointers to names here, because if name was not changed,
397
 
    pointer will be same
398
 
  */
399
 
  if (! orig_name && new_name != name)
400
 
    orig_name= name;
401
 
  name= new_name;
402
386
}
403
387
 
404
388
Item* Item::transform(Item_transformer transformer, unsigned char *arg)
1478
1462
  Item *new_item= NULL;
1479
1463
  if (item->basic_const_item())
1480
1464
    return; /* Can't be better */
1481
 
  Item_result res_type=item_cmp_type(comp_item->result_type(),
1482
 
                                     item->result_type());
1483
 
  char *name=item->name; /* Alloced by memory::sql_alloc */
 
1465
  Item_result res_type=item_cmp_type(comp_item->result_type(), item->result_type());
 
1466
  const char *name=item->name; /* Alloced by memory::sql_alloc */
1484
1467
 
1485
 
  switch (res_type) {
 
1468
  switch (res_type) 
 
1469
  {
1486
1470
  case STRING_RESULT:
1487
1471
    {
1488
1472
      char buff[MAX_FIELD_WIDTH];