~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.h

Merged vcol stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
887
887
  { return 0; }
888
888
  virtual bool register_field_in_read_map(unsigned char *arg __attribute__((unused)))
889
889
  { return 0; }
 
890
  /*
 
891
    The next function differs from the previous one that a bitmap to be updated
 
892
    is passed as unsigned char *arg.
 
893
  */
 
894
  virtual bool register_field_in_bitmap(unsigned char *arg __attribute__((unused)))
 
895
  { return 0; }
890
896
  virtual bool subst_argument_checker(unsigned char **arg)
891
897
  {
892
898
    if (*arg)
894
900
    return true;
895
901
  }
896
902
 
 
903
  /*
 
904
    Check if an expression/function is allowed for a virtual column
 
905
    SYNOPSIS
 
906
      check_vcol_func_processor()
 
907
      arg is just ignored
 
908
    RETURN VALUE
 
909
      TRUE                           Function not accepted
 
910
      FALSE                          Function accepted
 
911
  */
 
912
  virtual bool check_vcol_func_processor(unsigned char *arg __attribute__((unused))) 
 
913
  { return true; }
 
914
 
897
915
  virtual Item *equal_fields_propagator(unsigned char * arg __attribute__((unused))) { return this; }
898
916
  virtual bool set_no_const_sub(unsigned char *arg __attribute__((unused))) { return false; }
899
917
  virtual Item *replace_equal_field(unsigned char * arg __attribute__((unused))) { return this; }
900
918
 
 
919
 
901
920
  /*
902
921
    For SP local variable returns pointer to Item representing its
903
922
    current value and pointer to current Item otherwise.
1154
1173
  bool collect_item_field_processor(unsigned char * arg);
1155
1174
  bool find_item_in_field_list_processor(unsigned char *arg);
1156
1175
  bool register_field_in_read_map(unsigned char *arg);
 
1176
  bool register_field_in_bitmap(unsigned char *arg);
 
1177
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1178
  { return false; }
1157
1179
  void cleanup();
1158
1180
  bool result_as_int64_t()
1159
1181
  {
1209
1231
  }
1210
1232
 
1211
1233
  Item *safe_charset_converter(const CHARSET_INFO * const tocs);
 
1234
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1235
  { return false; }
1212
1236
};
1213
1237
 
1214
1238
class Item_null_result :public Item_null
1221
1245
  {
1222
1246
    save_in_field(result_field, no_conversions);
1223
1247
  }
 
1248
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1249
  { return true; }
1224
1250
};  
1225
1251
 
1226
1252
/* Item represents one placeholder ('?') of prepared statement */
1396
1422
  uint32_t decimal_precision() const
1397
1423
  { return (uint)(max_length - test(value < 0)); }
1398
1424
  bool eq(const Item *, bool binary_cmp) const;
 
1425
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1426
  { return false; }
1399
1427
};
1400
1428
 
1401
1429
 
1413
1441
  virtual void print(String *str, enum_query_type query_type);
1414
1442
  Item_num *neg ();
1415
1443
  uint32_t decimal_precision() const { return max_length; }
 
1444
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1445
  { return false; }
1416
1446
};
1417
1447
 
1418
1448
 
1454
1484
  uint32_t decimal_precision() const { return decimal_value.precision(); }
1455
1485
  bool eq(const Item *, bool binary_cmp) const;
1456
1486
  void set_decimal_value(my_decimal *value_par);
 
1487
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1488
  { return false; }
1457
1489
};
1458
1490
 
1459
1491
 
1521
1553
  }
1522
1554
 
1523
1555
  Item *safe_charset_converter(const CHARSET_INFO * const tocs);
 
1556
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1557
  { return false; }
1524
1558
};
1525
1559
 
1526
1560
 
1650
1684
  {
1651
1685
    m_cs_specified= cs_specified;
1652
1686
  }
 
1687
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1688
  { return false; }
1653
1689
 
1654
1690
private:
1655
1691
  bool m_cs_specified;
1672
1708
  {
1673
1709
    str->append(func_name);
1674
1710
  }
 
1711
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1712
  { return true; }
1675
1713
};
1676
1714
 
1677
1715
 
1751
1789
  virtual void print(String *str, enum_query_type query_type);
1752
1790
  bool eq(const Item *item, bool binary_cmp) const;
1753
1791
  virtual Item *safe_charset_converter(const CHARSET_INFO * const tocs);
 
1792
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1793
  { return false; }
1754
1794
};
1755
1795
 
1756
1796
 
1782
1822
    save_in_field(result_field, no_conversions);
1783
1823
  }
1784
1824
  void cleanup();
 
1825
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
1826
  { return false; }
1785
1827
};
1786
1828
 
1787
1829
 
2269
2311
    return arg->walk(processor, walk_subquery, args) ||
2270
2312
            (this->*processor)(args);
2271
2313
  }
 
2314
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
 
2315
  { return true; }
2272
2316
};
2273
2317
 
2274
2318