~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/item_func.h

Removed/replaced DBUG symbols and fixed TRUE/FALSEs

Show diffs side-by-side

added added

removed removed

Lines of Context:
207
207
  String *val_str(String*str);
208
208
  my_decimal *val_decimal(my_decimal *decimal_value);
209
209
  longlong val_int()
210
 
    { DBUG_ASSERT(fixed == 1); return (longlong) rint(val_real()); }
 
210
    { assert(fixed == 1); return (longlong) rint(val_real()); }
211
211
  enum Item_result result_type () const { return REAL_RESULT; }
212
212
  void fix_length_and_dec()
213
213
  { decimals= NOT_FIXED_DEC; max_length= float_length(decimals); }
286
286
  void fix_num_length_and_dec();
287
287
  void find_num_type();
288
288
  String *str_op(String *str __attribute__((__unused__)))
289
 
  { DBUG_ASSERT(0); return 0; }
 
289
  { assert(0); return 0; }
290
290
};
291
291
 
292
292
 
304
304
 
305
305
  void find_num_type();
306
306
  String *str_op(String *str __attribute__((__unused__)))
307
 
  { DBUG_ASSERT(0); return 0; }
 
307
  { assert(0); return 0; }
308
308
};
309
309
 
310
310
 
334
334
  const char *func_name() const { return "connection_id"; }
335
335
  void fix_length_and_dec();
336
336
  bool fix_fields(THD *thd, Item **ref);
337
 
  longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
 
337
  longlong val_int() { assert(fixed == 1); return value; }
338
338
};
339
339
 
340
340
 
432
432
public:
433
433
  uint prec_increment;
434
434
  Item_func_div(Item *a,Item *b) :Item_num_op(a,b) {}
435
 
  longlong int_op() { DBUG_ASSERT(0); return 0; }
 
435
  longlong int_op() { assert(0); return 0; }
436
436
  double real_op();
437
437
  my_decimal *decimal_op(my_decimal *);
438
438
  const char *func_name() const { return "/"; }
731
731
  enum_field_types cached_field_type;
732
732
public:
733
733
  Item_func_min_max(List<Item> &list,int cmp_sign_arg) :Item_func(list),
734
 
    cmp_type(INT_RESULT), cmp_sign(cmp_sign_arg), compare_as_dates(FALSE),
 
734
    cmp_type(INT_RESULT), cmp_sign(cmp_sign_arg), compare_as_dates(false),
735
735
    datetime_item(0) {}
736
736
  double val_real();
737
737
  longlong val_int();
805
805
public:
806
806
  Item_func_bit_length(Item *a) :Item_func_length(a) {}
807
807
  longlong val_int()
808
 
    { DBUG_ASSERT(fixed == 1); return Item_func_length::val_int()*8; }
 
808
    { assert(fixed == 1); return Item_func_length::val_int()*8; }
809
809
  const char *func_name() const { return "bit_length"; }
810
810
};
811
811
 
994
994
protected:
995
995
  udf_handler udf;
996
996
  bool is_expensive_processor(uchar *arg __attribute__((__unused__)))
997
 
  { return TRUE; }
 
997
  { return true; }
998
998
 
999
999
public:
1000
1000
  Item_udf_func(udf_func *udf_arg)
1005
1005
  enum Functype functype() const   { return UDF_FUNC; }
1006
1006
  bool fix_fields(THD *thd, Item **ref __attribute__((__unused__)))
1007
1007
  {
1008
 
    DBUG_ASSERT(fixed == 0);
 
1008
    assert(fixed == 0);
1009
1009
    bool res= udf.fix_fields(thd, this, arg_count, args);
1010
1010
    used_tables_cache= udf.used_tables_cache;
1011
1011
    const_item_cache= udf.const_item_cache;
1079
1079
    :Item_udf_func(udf_arg, list) {}
1080
1080
  longlong val_int()
1081
1081
  {
1082
 
    DBUG_ASSERT(fixed == 1);
 
1082
    assert(fixed == 1);
1083
1083
    return (longlong) rint(Item_func_udf_float::val_real());
1084
1084
  }
1085
1085
  my_decimal *val_decimal(my_decimal *dec_buf)
1173
1173
    :Item_real_func() {}
1174
1174
  Item_func_udf_float(udf_func *udf_arg, List<Item> &list)
1175
1175
    :Item_real_func(list) {}
1176
 
  double val_real() { DBUG_ASSERT(fixed == 1); return 0.0; }
 
1176
  double val_real() { assert(fixed == 1); return 0.0; }
1177
1177
};
1178
1178
 
1179
1179
 
1184
1184
    :Item_int_func() {}
1185
1185
  Item_func_udf_int(udf_func *udf_arg, List<Item> &list)
1186
1186
    :Item_int_func(list) {}
1187
 
  longlong val_int() { DBUG_ASSERT(fixed == 1); return 0; }
 
1187
  longlong val_int() { assert(fixed == 1); return 0; }
1188
1188
};
1189
1189
 
1190
1190
 
1195
1195
    :Item_int_func() {}
1196
1196
  Item_func_udf_decimal(udf_func *udf_arg, List<Item> &list)
1197
1197
    :Item_int_func(list) {}
1198
 
  my_decimal *val_decimal(my_decimal *) { DBUG_ASSERT(fixed == 1); return 0; }
 
1198
  my_decimal *val_decimal(my_decimal *) { assert(fixed == 1); return 0; }
1199
1199
};
1200
1200
 
1201
1201
 
1207
1207
  Item_func_udf_str(udf_func *udf_arg, List<Item> &list)
1208
1208
    :Item_func(list) {}
1209
1209
  String *val_str(String *)
1210
 
    { DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
1211
 
  double val_real() { DBUG_ASSERT(fixed == 1); null_value= 1; return 0.0; }
1212
 
  longlong val_int() { DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
 
1210
    { assert(fixed == 1); null_value=1; return 0; }
 
1211
  double val_real() { assert(fixed == 1); null_value= 1; return 0.0; }
 
1212
  longlong val_int() { assert(fixed == 1); null_value=1; return 0; }
1213
1213
  enum Item_result result_type () const { return STRING_RESULT; }
1214
1214
  void fix_length_and_dec() { maybe_null=1; max_length=0; }
1215
1215
};
1362
1362
    Stubs for pure virtual methods. Should never be called: this
1363
1363
    item is always substituted with a constant in fix_fields().
1364
1364
  */
1365
 
  double val_real()         { DBUG_ASSERT(0); return 0.0; }
1366
 
  longlong val_int()        { DBUG_ASSERT(0); return 0; }
1367
 
  String* val_str(String*)  { DBUG_ASSERT(0); return 0; }
1368
 
  void fix_length_and_dec() { DBUG_ASSERT(0); }
 
1365
  double val_real()         { assert(0); return 0.0; }
 
1366
  longlong val_int()        { assert(0); return 0; }
 
1367
  String* val_str(String*)  { assert(0); return 0; }
 
1368
  void fix_length_and_dec() { assert(0); }
1369
1369
  /* TODO: fix to support views */
1370
1370
  const char *func_name() const { return "get_system_var"; }
1371
1371
  /**