~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Monty Taylor
  • Date: 2009-05-08 19:07:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1009.
  • Revision ID: mordred@inaugust.com-20090508190739-rwas5y9xjg1a92p6
Reverted a crap-ton of padraig's work.

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;
1130
1131
          it2.remove();                 // Remove first (create) definition
1131
1132
          select_field_pos--;
1132
1133
          break;
1158
1159
    sql_field->offset= record_offset;
1159
1160
    if (MTYP_TYPENR(sql_field->unireg_check) == Field::NEXT_NUMBER)
1160
1161
      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
    }
1161
1179
  }
1162
1180
  if (timestamps_with_niladic > 1)
1163
1181
  {
1395
1413
            return(true);
1396
1414
          }
1397
1415
        }
 
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
        }
1398
1422
        if (!(sql_field->flags & NOT_NULL_FLAG))
1399
1423
        {
1400
1424
          if (key->type == Key::PRIMARY)
3971
3995
    if (def)
3972
3996
    {                                           // Field is changed
3973
3997
      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
      }
3974
4005
      if (!def->after)
3975
4006
      {
3976
4007
        new_create_list.push_back(def);