~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.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:
3631
3631
        }
3632
3632
 
3633
3633
        n_fields = (ulint)table->s->fields; /* number of columns */
3634
 
        n_stored_fields= (ulint)table->s->fields; /* number of stored columns */
 
3634
        n_stored_fields= (ulint)table->s->stored_fields; /* number of stored columns */
3635
3635
 
3636
3636
        if (!prebuilt->mysql_template) {
3637
3637
                prebuilt->mysql_template = (mysql_row_templ_t*)
3663
3663
        for (sql_idx = 0; sql_idx < n_fields; sql_idx++) {
3664
3664
                templ = prebuilt->mysql_template + n_requested_fields;
3665
3665
                field = table->field[sql_idx];
 
3666
                if (!field->is_stored)
 
3667
                       goto skip_field;
3666
3668
 
3667
3669
                if (UNIV_LIKELY(templ_type == ROW_MYSQL_REC_FIELDS)) {
3668
3670
                        /* Decide which columns we should fetch
3670
3672
                        register const ibool    index_contains_field =
3671
3673
                                dict_index_contains_col_or_prefix(index, innodb_idx);
3672
3674
                        register const ibool    index_covers_field = 
3673
 
                                field->part_of_key.test(file->active_index);
 
3675
                                field->part_of_key.is_set(file->active_index);
3674
3676
 
3675
3677
 
3676
3678
                        if (!index_contains_field && prebuilt->read_just_key) {
3686
3688
                                goto include_field;
3687
3689
                        }
3688
3690
 
3689
 
                        if (field->isRead() || field->isWrite())
 
3691
                        if (table->read_set->test(sql_idx) ||
 
3692
                            table->write_set->test(sql_idx)) {
3690
3693
                                /* This field is needed in the query */
 
3694
 
3691
3695
                                goto include_field;
3692
 
 
3693
 
                        assert(table->read_set->test(sql_idx) == field->isRead());
3694
 
                        assert(table->write_set->test(sql_idx) == field->isWrite());
 
3696
                        }
3695
3697
 
3696
3698
                        if (fetch_primary_key_cols
3697
3699
                                && dict_table_col_in_clustered_key(
3764
3766
                        prebuilt->templ_contains_blob = TRUE;
3765
3767
                }
3766
3768
skip_field:
3767
 
                innodb_idx++;
 
3769
                if (field->is_stored)
 
3770
                {
 
3771
                  innodb_idx++;
 
3772
                }
3768
3773
                if (need_second_pass && (sql_idx+1 == n_fields))
3769
3774
                {
3770
3775
                  prebuilt->n_index_fields= n_requested_fields;
4253
4258
 
4254
4259
        for (sql_idx = 0; sql_idx < n_fields; sql_idx++) {
4255
4260
                field = table->field[sql_idx];
 
4261
                if (!field->is_stored)
 
4262
                  continue;
4256
4263
 
4257
4264
                o_ptr = (const byte*) old_row + get_field_offset(table, field);
4258
4265
                n_ptr = (const byte*) new_row + get_field_offset(table, field);
4347
4354
                                &prebuilt->table->cols[innodb_idx], clust_index);
4348
4355
                        n_changed++;
4349
4356
                }
4350
 
                innodb_idx++;
 
4357
                if (field->is_stored)
 
4358
                  innodb_idx++;
4351
4359
        }
4352
4360
 
4353
4361
        uvect->n_fields = n_changed;
5330
5338
        /* We pass 0 as the space id, and determine at a lower level the space
5331
5339
        id where to store the table */
5332
5340
 
5333
 
        table = dict_mem_table_create(table_name, 0, form->s->fields, flags);
 
5341
        table = dict_mem_table_create(table_name, 0, form->s->stored_fields, flags);
5334
5342
 
5335
5343
        if (path_of_temp_table) {
5336
5344
                table->dir_path_of_temp_table =
5339
5347
 
5340
5348
        for (i = 0; i < n_cols; i++) {
5341
5349
                field = form->field[i];
 
5350
                if (!field->is_stored)
 
5351
                  continue;
5342
5352
 
5343
5353
                col_type = get_innobase_type_from_mysql_type(&unsigned_type,
5344
5354
                                                                        field);