~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field.h

Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "drizzled/sql_list.h"
33
33
#include "drizzled/structs.h"
34
34
#include "drizzled/charset_info.h"
 
35
#include "drizzled/item_result.h"
35
36
 
36
37
#include <string>
37
38
#include <vector>
189
190
     This trickery is used to decrease a number of malloc calls.
190
191
  */
191
192
  virtual String *val_str(String*, String *)=0;
192
 
  /**
193
 
   * Interpret field value as an integer but return the result as a string.
194
 
   *
195
 
   * This is used for printing bit_fields as numbers while debugging.
196
 
   */
197
 
  String *val_int_as_str(String *val_buffer, bool unsigned_flag);
198
193
  /*
199
194
   str_needs_quotes() returns true if the value returned by val_str() needs
200
195
   to be quoted when used in constructing an SQL query.
262
257
   * table, which is located on disk).
263
258
   */
264
259
  virtual uint32_t pack_length_in_rec() const;
265
 
  /**
266
 
    Check to see if field size is compatible with destination.
267
 
 
268
 
    This method is used in row-based replication to verify that the slave's
269
 
    field size is less than or equal to the master's field size. The
270
 
    encoded field metadata (from the master or source) is decoded and compared
271
 
    to the size of this field (the slave or destination).
272
 
 
273
 
    @param   field_metadata   Encoded size in field metadata
274
 
 
275
 
    @retval 0 if this field's size is < the source field's size
276
 
    @retval 1 if this field's size is >= the source field's size
277
 
  */
278
 
  virtual int compatible_field_size(uint32_t field_metadata);
279
 
  virtual uint32_t pack_length_from_metadata(uint32_t field_metadata);
280
 
 
281
 
  /*
282
 
    This method is used to return the size of the data in a row-based
283
 
    replication row record. The default implementation of returning 0 is
284
 
    designed to allow fields that do not use metadata to return true (1)
285
 
    from compatible_field_size() which uses this function in the comparison.
286
 
    The default value for field metadata for fields that do not have
287
 
    metadata is 0. Thus, 0 == 0 means the fields are compatible in size.
288
 
 
289
 
    Note: While most classes that override this method return pack_length(),
290
 
    the classes Field_varstring, and Field_blob return
291
 
    field_length + 1, field_length, and pack_length_no_ptr() respectfully.
292
 
  */
293
 
  virtual uint32_t row_pack_length();
294
260
 
295
261
  /**
296
262
   * Return the "real size" of the data in memory.