~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2009-12-01 01:54:04 UTC
  • mto: (1234.1.4 push)
  • mto: This revision was merged to the branch mainline in revision 1235.
  • Revision ID: brian@gaz-20091201015404-19qmqriauoeve2x5
Move max key stuff up to engine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
793
793
 
794
794
  select_field_pos= alter_info->create_list.elements - select_field_count;
795
795
  null_fields=blob_columns=0;
796
 
  max_key_length= cursor->max_key_length();
 
796
  max_key_length= cursor->getEngine()->max_key_length();
797
797
 
798
798
  for (field_no=0; (sql_field=it++) ; field_no++)
799
799
  {
1082
1082
      continue;
1083
1083
    }
1084
1084
    (*key_count)++;
1085
 
    tmp=cursor->max_key_parts();
 
1085
    tmp=cursor->getEngine()->max_key_parts();
1086
1086
    if (key->columns.elements > tmp)
1087
1087
    {
1088
1088
      my_error(ER_TOO_MANY_KEY_PARTS,MYF(0),tmp);
1131
1131
      return(true);
1132
1132
    }
1133
1133
  }
1134
 
  tmp=cursor->max_keys();
 
1134
  tmp=cursor->getEngine()->max_keys();
1135
1135
  if (*key_count > tmp)
1136
1136
  {
1137
1137
    my_error(ER_TOO_MANY_KEYS,MYF(0),tmp);
1308
1308
        if (sql_field->sql_type == DRIZZLE_TYPE_BLOB)
1309
1309
        {
1310
1310
          if ((length=column->length) > max_key_length ||
1311
 
              length > cursor->max_key_part_length())
 
1311
              length > cursor->getEngine()->max_key_part_length())
1312
1312
          {
1313
 
            length= min(max_key_length, cursor->max_key_part_length());
 
1313
            length= min(max_key_length, cursor->getEngine()->max_key_part_length());
1314
1314
            if (key->type == Key::MULTIPLE)
1315
1315
            {
1316
1316
              /* not a critical problem */
1345
1345
        my_error(ER_WRONG_KEY_COLUMN, MYF(0), column->field_name.str);
1346
1346
          return(true);
1347
1347
      }
1348
 
      if (length > cursor->max_key_part_length())
 
1348
      if (length > cursor->getEngine()->max_key_part_length())
1349
1349
      {
1350
 
        length= cursor->max_key_part_length();
 
1350
        length= cursor->getEngine()->max_key_part_length();
1351
1351
        if (key->type == Key::MULTIPLE)
1352
1352
        {
1353
1353
          /* not a critical problem */