~drizzle-trunk/drizzle/development

« back to all changes in this revision

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