~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field.h

  • Committer: Brian Aker
  • Date: 2008-08-15 15:01:59 UTC
  • mto: This revision was merged to the branch mainline in revision 346.
  • Revision ID: brian@tangent.org-20080815150159-vpx04493xvokzrkv
First pass in encapsulating table (it is now an object, no longer a structure).

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    Note that you can use table->in_use as replacement for current_thd member 
62
62
    only inside of val_*() and store() members (e.g. you can't use it in cons)
63
63
  */
64
 
  struct st_table *table;               // Pointer for table
65
 
  struct st_table *orig_table;          // Pointer to original table
 
64
  Table *table;         // Pointer for table
 
65
  Table *orig_table;            // Pointer to original table
66
66
  const char    **table_name, *field_name;
67
67
  LEX_STRING    comment;
68
68
  /* Field is part of the following keys */
205
205
  virtual void reset_fields() {}
206
206
  virtual void set_default()
207
207
  {
208
 
    my_ptrdiff_t l_offset= (my_ptrdiff_t) (table->s->default_values - table->record[0]);
 
208
    my_ptrdiff_t l_offset= (my_ptrdiff_t) (table->getDefaultValues() - table->record[0]);
209
209
    memcpy(ptr, ptr + l_offset, pack_length());
210
210
    if (null_ptr)
211
211
      *null_ptr= ((*null_ptr & (uchar) ~null_bit) | (null_ptr[l_offset] & null_bit));
285
285
   */
286
286
  size_t last_null_byte() const {
287
287
    size_t bytes= do_last_null_byte();
288
 
    assert(bytes <= table->s->null_bytes);
 
288
    assert(bytes <= table->getNullBytes());
289
289
    return bytes;
290
290
  }
291
291
 
301
301
  */
302
302
  virtual bool can_be_compared_as_int64_t() const { return false; }
303
303
  virtual void free() {}
304
 
  virtual Field *new_field(MEM_ROOT *root, struct st_table *new_table,
 
304
  virtual Field *new_field(MEM_ROOT *root, Table *new_table,
305
305
                           bool keep_type);
306
 
  virtual Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
 
306
  virtual Field *new_key_field(MEM_ROOT *root, Table *new_table,
307
307
                               uchar *new_ptr, uchar *new_null_ptr,
308
308
                               uint new_null_bit);
309
 
  Field *clone(MEM_ROOT *mem_root, struct st_table *new_table);
 
309
  Field *clone(MEM_ROOT *mem_root, Table *new_table);
310
310
  inline void move_field(uchar *ptr_arg,uchar *null_ptr_arg,uchar null_bit_arg)
311
311
  {
312
312
    ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg;
496
496
 
497
497
  /* Hash value */
498
498
  virtual void hash(uint32_t *nr, uint32_t *nr2);
499
 
  friend bool reopen_table(THD *,struct st_table *,bool);
 
499
  friend bool reopen_table(THD *,Table *,bool);
500
500
  friend int cre_myisam(char * name, register TABLE *form, uint options,
501
501
                        uint64_t auto_increment_value);
502
502
  friend class Copy_field;
705
705
  {
706
706
      flags|=ENUM_FLAG;
707
707
  }
708
 
  Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
 
708
  Field *new_field(MEM_ROOT *root, Table *new_table, bool keep_type);
709
709
  enum_field_types type() const { return DRIZZLE_TYPE_ENUM; }
710
710
  enum Item_result cmp_type () const { return INT_RESULT; }
711
711
  enum Item_result cast_to_int_type () const { return INT_RESULT; }