~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field.h

  • Committer: Brian Aker
  • Date: 2011-02-20 21:00:32 UTC
  • mfrom: (2181.2.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110220210032-fc9g8qugt0n1yjr6
Brian Aker 2011-02-20 Merge in additional header bits for strerror_r
Brian Aker 2011-02-20 Create CONST on additional Field methods.
Brian Aker 2011-02-19 Further commit const on field.
Brian Aker 2011-02-18 This fixes DEBUG based compiles.
Brian Aker 2011-02-18 Protect all of the val_* methods from modification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
      Needs to be changed if/when we want to support different time formats.
218
218
  */
219
219
  virtual int store_time(type::Time &ltime, type::timestamp_t t_type);
220
 
  virtual double val_real()=0;
221
 
  virtual int64_t val_int()=0;
222
 
  virtual type::Decimal *val_decimal(type::Decimal *);
223
 
  String *val_str_internal(String *str)
 
220
  virtual double val_real() const=0;
 
221
  virtual int64_t val_int() const =0;
 
222
  virtual type::Decimal *val_decimal(type::Decimal *) const;
 
223
  String *val_str_internal(String *str) const
224
224
  {
225
225
    return val_str(str, str);
226
226
  }
237
237
     an unnecessary free (and later, may be an alloc).
238
238
     This trickery is used to decrease a number of malloc calls.
239
239
  */
240
 
  virtual String *val_str(String*, String *)=0;
 
240
  virtual String *val_str(String*, String *) const =0;
241
241
 
242
242
  /*
243
243
   str_needs_quotes() returns true if the value returned by val_str() needs
363
363
  // For new field
364
364
  virtual uint32_t size_of() const =0;
365
365
 
366
 
  bool is_null(ptrdiff_t row_offset= 0);
367
 
  bool is_real_null(ptrdiff_t row_offset= 0);
368
 
  bool is_null_in_record(const unsigned char *record);
369
 
  bool is_null_in_record_with_offset(ptrdiff_t offset);
 
366
  bool is_null(ptrdiff_t row_offset= 0) const;
 
367
  bool is_real_null(ptrdiff_t row_offset= 0) const;
 
368
  bool is_null_in_record(const unsigned char *record) const;
 
369
  bool is_null_in_record_with_offset(ptrdiff_t offset) const;
370
370
  void set_null(ptrdiff_t row_offset= 0);
371
371
  void set_notnull(ptrdiff_t row_offset= 0);
372
 
  bool maybe_null(void);
373
 
  bool real_maybe_null(void);
 
372
  bool maybe_null(void) const;
 
373
  bool real_maybe_null(void) const;
374
374
 
375
375
  virtual void make_field(SendField *);
376
376
  virtual void sort_string(unsigned char *buff,uint32_t length)=0;
596
596
  }
597
597
  void copy_from_tmp(int offset);
598
598
  uint32_t fill_cache_field(CacheField *copy);
599
 
  virtual bool get_date(type::Time &ltime,uint32_t fuzzydate);
600
 
  virtual bool get_time(type::Time &ltime);
 
599
  virtual bool get_date(type::Time &ltime,uint32_t fuzzydate) const;
 
600
  virtual bool get_time(type::Time &ltime) const;
601
601
  virtual const CHARSET_INFO *charset(void) const { return &my_charset_bin; }
602
602
  virtual const CHARSET_INFO *sort_charset(void) const { return charset(); }
603
603
  virtual bool has_charset(void) const { return false; }
738
738
  }
739
739
 
740
740
  /* Hash value */
741
 
  virtual void hash(uint32_t *nr, uint32_t *nr2);
 
741
  virtual void hash(uint32_t *nr, uint32_t *nr2) const;
742
742
  friend bool reopen_table(Session *,Table *,bool);
743
743
 
744
744
  friend class CopyField;
754
754
  friend class Item_sum_max;
755
755
  friend class Item_func_group_concat;
756
756
 
757
 
  bool isReadSet();
 
757
  bool isReadSet() const;
758
758
  bool isWriteSet();
759
759
  void setReadSet(bool arg= true);
760
760
  void setWriteSet(bool arg= true);