~ubuntu-branches/ubuntu/hardy/mysql-dfsg-5.0/hardy-updates

« back to all changes in this revision

Viewing changes to sql/item_func.h

  • Committer: Bazaar Package Importer
  • Author(s): sean finney
  • Date: 2007-05-13 12:32:45 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20070513123245-8c3l187dk34cz2ar
Tags: 5.0.41-2
the previous "translation changes" inadvertently introduced unrelated
changes in the package control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1308
1308
  FT_INFO *ft_handler;
1309
1309
  TABLE *table;
1310
1310
  Item_func_match *master;   // for master-slave optimization
1311
 
  Item *concat;              // Item_func_concat_ws
1312
 
  String value;              // value of concat
 
1311
  Item *concat_ws;           // Item_func_concat_ws
 
1312
  String value;              // value of concat_ws
1313
1313
  String search_value;       // key_item()'s value converted to cmp_collation
1314
1314
 
1315
1315
  Item_func_match(List<Item> &a, uint b): Item_real_func(a), key(0), flags(b),
1316
 
       join_key(0), ft_handler(0), table(0), master(0), concat(0) { }
 
1316
       join_key(0), ft_handler(0), table(0), master(0), concat_ws(0) { }
1317
1317
  void cleanup()
1318
1318
  {
1319
1319
    DBUG_ENTER("Item_func_match");
1321
1321
    if (!master && ft_handler)
1322
1322
      ft_handler->please->close_search(ft_handler);
1323
1323
    ft_handler= 0;
1324
 
    concat= 0;
 
1324
    concat_ws= 0;
1325
1325
    DBUG_VOID_RETURN;
1326
1326
  }
1327
1327
  enum Functype functype() const { return FT_FUNC; }
1405
1405
  sp_name *m_name;
1406
1406
  mutable sp_head *m_sp;
1407
1407
  TABLE *dummy_table;
1408
 
  Field *result_field;
1409
1408
  char result_buf[64];
 
1409
  /*
 
1410
     The result field of the concrete stored function.
 
1411
  */
 
1412
  Field *sp_result_field;
1410
1413
 
1411
 
  bool execute(Field **flp);
1412
 
  bool execute_impl(THD *thd, Field *return_value_fld);
1413
 
  Field *sp_result_field(void) const;
 
1414
  bool execute();
 
1415
  bool execute_impl(THD *thd);
 
1416
  bool init_result_field(THD *thd);
1414
1417
 
1415
1418
public:
1416
1419
 
1436
1439
 
1437
1440
  longlong val_int()
1438
1441
  {
1439
 
    if (execute(&result_field))
 
1442
    if (execute())
1440
1443
      return (longlong) 0;
1441
 
    return result_field->val_int();
 
1444
    return sp_result_field->val_int();
1442
1445
  }
1443
1446
 
1444
1447
  double val_real()
1445
1448
  {
1446
 
    if (execute(&result_field))
 
1449
    if (execute())
1447
1450
      return 0.0;
1448
 
    return result_field->val_real();
 
1451
    return sp_result_field->val_real();
1449
1452
  }
1450
1453
 
1451
1454
  my_decimal *val_decimal(my_decimal *dec_buf)
1452
1455
  {
1453
 
    if (execute(&result_field))
 
1456
    if (execute())
1454
1457
      return NULL;
1455
 
    return result_field->val_decimal(dec_buf);
 
1458
    return sp_result_field->val_decimal(dec_buf);
1456
1459
  }
1457
1460
 
1458
1461
  String *val_str(String *str)
1461
1464
    char buff[20];
1462
1465
    buf.set(buff, 20, str->charset());
1463
1466
    buf.length(0);
1464
 
    if (execute(&result_field))
 
1467
    if (execute())
1465
1468
      return NULL;
1466
1469
    /*
1467
1470
      result_field will set buf pointing to internal buffer
1469
1472
      when SP is executed. In order to prevent occasional
1470
1473
      corruption of returned value, we make here a copy.
1471
1474
    */
1472
 
    result_field->val_str(&buf);
 
1475
    sp_result_field->val_str(&buf);
1473
1476
    str->copy(buf);
1474
1477
    return str;
1475
1478
  }
1477
1480
  virtual bool change_context_processor(byte *cntx)
1478
1481
    { context= (Name_resolution_context *)cntx; return FALSE; }
1479
1482
 
1480
 
  void fix_length_and_dec();
1481
 
  bool find_and_check_access(THD * thd);
 
1483
  bool sp_check_access(THD * thd);
1482
1484
  virtual enum Functype functype() const { return FUNC_SP; }
1483
1485
 
1484
1486
  bool fix_fields(THD *thd, Item **ref);
 
1487
  void fix_length_and_dec(void);
1485
1488
  bool is_expensive() { return 1; }
1486
1489
};
1487
1490