~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/item.h

  • Committer: Brian Aker
  • Date: 2008-07-10 19:37:55 UTC
  • mfrom: (51.1.67 remove-dbug)
  • Revision ID: brian@tangent.org-20080710193755-f5g761uieqa3wxmt
Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
586
586
  */
587
587
  virtual longlong val_int_endpoint(bool left_endp __attribute__((__unused__)),
588
588
                                    bool *incl_endp __attribute__((__unused__)))
589
 
  { DBUG_ASSERT(0); return 0; }
 
589
  { assert(0); return 0; }
590
590
 
591
591
 
592
592
  /* valXXX methods must return NULL or 0 or 0.0 if null_value is set. */
1343
1343
  { return state != NO_VALUE ? (table_map)0 : PARAM_TABLE_BIT; }
1344
1344
  virtual void print(String *str, enum_query_type query_type);
1345
1345
  bool is_null()
1346
 
  { DBUG_ASSERT(state != NO_VALUE); return state == NULL_VALUE; }
 
1346
  { assert(state != NO_VALUE); return state == NULL_VALUE; }
1347
1347
  bool basic_const_item() const;
1348
1348
  /*
1349
1349
    This method is used to make a copy of a basic constant item when
1387
1387
  enum Type type() const { return INT_ITEM; }
1388
1388
  enum Item_result result_type () const { return INT_RESULT; }
1389
1389
  enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; }
1390
 
  longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
1391
 
  double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; }
 
1390
  longlong val_int() { assert(fixed == 1); return value; }
 
1391
  double val_real() { assert(fixed == 1); return (double) value; }
1392
1392
  my_decimal *val_decimal(my_decimal *);
1393
1393
  String *val_str(String*);
1394
1394
  int save_in_field(Field *field, bool no_conversions);
1409
1409
  Item_uint(ulonglong i) :Item_int((ulonglong) i, 10) {}
1410
1410
  Item_uint(const char *str_arg, longlong i, uint length);
1411
1411
  double val_real()
1412
 
    { DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); }
 
1412
    { assert(fixed == 1); return ulonglong2double((ulonglong)value); }
1413
1413
  String *val_str(String*);
1414
1414
  Item *clone_item() { return new Item_uint(name, value, max_length); }
1415
1415
  int save_in_field(Field *field, bool no_conversions);
1483
1483
  int save_in_field(Field *field, bool no_conversions);
1484
1484
  enum Type type() const { return REAL_ITEM; }
1485
1485
  enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; }
1486
 
  double val_real() { DBUG_ASSERT(fixed == 1); return value; }
 
1486
  double val_real() { assert(fixed == 1); return value; }
1487
1487
  longlong val_int()
1488
1488
  {
1489
 
    DBUG_ASSERT(fixed == 1);
 
1489
    assert(fixed == 1);
1490
1490
    if (value <= (double) LONGLONG_MIN)
1491
1491
    {
1492
1492
       return LONGLONG_MIN;
1593
1593
  longlong val_int();
1594
1594
  String *val_str(String*)
1595
1595
  {
1596
 
    DBUG_ASSERT(fixed == 1);
 
1596
    assert(fixed == 1);
1597
1597
    return (String*) &str_value;
1598
1598
  }
1599
1599
  my_decimal *val_decimal(my_decimal *);
1740
1740
  enum Type type() const { return VARBIN_ITEM; }
1741
1741
  double val_real()
1742
1742
  { 
1743
 
    DBUG_ASSERT(fixed == 1); 
 
1743
    assert(fixed == 1); 
1744
1744
    return (double) (ulonglong) Item_hex_string::val_int();
1745
1745
  }
1746
1746
  longlong val_int();
1747
1747
  bool basic_const_item() const { return 1; }
1748
 
  String *val_str(String*) { DBUG_ASSERT(fixed == 1); return &str_value; }
 
1748
  String *val_str(String*) { assert(fixed == 1); return &str_value; }
1749
1749
  my_decimal *val_decimal(my_decimal *);
1750
1750
  int save_in_field(Field *field, bool no_conversions);
1751
1751
  enum Item_result result_type () const { return STRING_RESULT; }
2359
2359
 
2360
2360
  void store(Item *item);
2361
2361
  void store(Item *item, longlong val_arg);
2362
 
  double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; }
2363
 
  longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
 
2362
  double val_real() { assert(fixed == 1); return (double) value; }
 
2363
  longlong val_int() { assert(fixed == 1); return value; }
2364
2364
  String* val_str(String *str);
2365
2365
  my_decimal *val_decimal(my_decimal *);
2366
2366
  enum Item_result result_type() const { return INT_RESULT; }
2375
2375
  Item_cache_real(): Item_cache(), value(0) {}
2376
2376
 
2377
2377
  void store(Item *item);
2378
 
  double val_real() { DBUG_ASSERT(fixed == 1); return value; }
 
2378
  double val_real() { assert(fixed == 1); return value; }
2379
2379
  longlong val_int();
2380
2380
  String* val_str(String *str);
2381
2381
  my_decimal *val_decimal(my_decimal *);
2416
2416
  void store(Item *item);
2417
2417
  double val_real();
2418
2418
  longlong val_int();
2419
 
  String* val_str(String *) { DBUG_ASSERT(fixed == 1); return value; }
 
2419
  String* val_str(String *) { assert(fixed == 1); return value; }
2420
2420
  my_decimal *val_decimal(my_decimal *);
2421
2421
  enum Item_result result_type() const { return STRING_RESULT; }
2422
2422
  CHARSET_INFO *charset() const { return value->charset(); };
2480
2480
  void keep_array() { save_array= 1; }
2481
2481
  void cleanup()
2482
2482
  {
2483
 
    DBUG_ENTER("Item_cache_row::cleanup");
2484
2483
    Item_cache::cleanup();
2485
2484
    if (save_array)
2486
2485
      bzero(values, item_count*sizeof(Item**));
2487
2486
    else
2488
2487
      values= 0;
2489
 
    DBUG_VOID_RETURN;
 
2488
    return;
2490
2489
  }
2491
2490
};
2492
2491