~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2009-05-05 00:22:46 UTC
  • mfrom: (1003.1.6 merge)
  • Revision ID: brian@gaz-20090505002246-m4ol528i6me7vikf
Merge Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1127
1127
            null_fields--;
1128
1128
          sql_field->flags=             dup_field->flags;
1129
1129
          sql_field->interval=          dup_field->interval;
1130
 
          sql_field->is_stored=      dup_field->is_stored;
1131
1130
          it2.remove();                 // Remove first (create) definition
1132
1131
          select_field_pos--;
1133
1132
          break;
1159
1158
    sql_field->offset= record_offset;
1160
1159
    if (MTYP_TYPENR(sql_field->unireg_check) == Field::NEXT_NUMBER)
1161
1160
      auto_increment++;
1162
 
    /*
1163
 
          For now skip fields that are not physically stored in the database
1164
 
          (virtual fields) and update their offset later
1165
 
          (see the next loop).
1166
 
        */
1167
 
    if (sql_field->is_stored)
1168
 
      record_offset+= sql_field->pack_length;
1169
 
  }
1170
 
  /* Update virtual fields' offset */
1171
 
  it.rewind();
1172
 
  while ((sql_field=it++))
1173
 
  {
1174
 
    if (not sql_field->is_stored)
1175
 
    {
1176
 
      sql_field->offset= record_offset;
1177
 
      record_offset+= sql_field->pack_length;
1178
 
    }
1179
1161
  }
1180
1162
  if (timestamps_with_niladic > 1)
1181
1163
  {
1413
1395
            return(true);
1414
1396
          }
1415
1397
        }
1416
 
        if (not sql_field->is_stored)
1417
 
        {
1418
 
          /* Key fields must always be physically stored. */
1419
 
          my_error(ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN, MYF(0));
1420
 
          return(true);
1421
 
        }
1422
1398
        if (!(sql_field->flags & NOT_NULL_FLAG))
1423
1399
        {
1424
1400
          if (key->type == Key::PRIMARY)
3995
3971
    if (def)
3996
3972
    {                                           // Field is changed
3997
3973
      def->field=field;
3998
 
      if (field->is_stored != def->is_stored)
3999
 
      {
4000
 
        my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN,
4001
 
                 MYF(0),
4002
 
                 "Changing the STORED status");
4003
 
        goto err;
4004
 
      }
4005
3974
      if (!def->after)
4006
3975
      {
4007
3976
        new_create_list.push_back(def);