~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/key.cc

  • Committer: Brian Aker
  • Date: 2010-10-28 01:45:34 UTC
  • mfrom: (1878.5.8 catalogs)
  • Revision ID: brian@tangent.org-20101028014534-b6qp4wp6crj60h7k
Merge in catalog tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
/* Functions to handle keys and fields in forms */
18
18
 
19
 
#include <config.h>
20
 
#include <drizzled/table.h>
21
 
#include <drizzled/key.h>
22
 
#include <drizzled/field/blob.h>
23
 
#include <drizzled/util/test.h>
24
 
#include <drizzled/plugin/storage_engine.h>
 
19
#include "config.h"
 
20
#include "drizzled/table.h"
 
21
#include "drizzled/key.h"
 
22
#include "drizzled/field/blob.h"
 
23
#include "drizzled/util/test.h"
25
24
 
26
25
#include <boost/dynamic_bitset.hpp>
27
26
 
64
63
int find_ref_key(KeyInfo *key, uint32_t key_count, unsigned char *record, Field *field,
65
64
                 uint32_t *key_length, uint32_t *keypart)
66
65
{
67
 
  int i;
68
 
  KeyInfo *key_info;
 
66
  register int i;
 
67
  register KeyInfo *key_info;
69
68
  uint32_t fieldpos;
70
69
 
71
70
  fieldpos= field->offset(record);
330
329
     idx        Key number
331
330
*/
332
331
 
333
 
void key_unpack(String *to, const Table *table, uint32_t idx)
 
332
void key_unpack(String *to, Table *table, uint32_t idx)
334
333
{
335
334
  KeyPartInfo *key_part,*key_part_end;
336
335
  Field *field;
356
355
    {
357
356
      const CHARSET_INFO * const cs= field->charset();
358
357
      field->setReadSet();
359
 
      field->val_str_internal(&tmp);
 
358
      field->val_str(&tmp);
360
359
      if (cs->mbmaxlen > 1 &&
361
360
          table->getField(key_part->fieldnr - 1)->field_length !=
362
361
          key_part->length)
450
449
    if (key_part->null_bit)
451
450
    {
452
451
      /* This key part allows null values; NULL is lower than everything */
453
 
      bool field_is_null= key_part->field->is_null();
 
452
      register bool field_is_null= key_part->field->is_null();
454
453
      if (*key)                                 // If range key is null
455
454
      {
456
455
        /* the range is expecting a null value */