~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/dict/dict0crea.c

  • Committer: Lee Bieber
  • Date: 2010-12-03 01:16:19 UTC
  • mfrom: (1819.9.81 update-innobase)
  • Revision ID: kalebral@gmail.com-20101203011619-n6v584rijwdet05b
Merge Stewart - update Innobase plugin based on InnoDB 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
        ibool           is_path;
241
241
        mtr_t           mtr;
242
242
        ulint           space = 0;
 
243
        ibool           file_per_table;
243
244
 
244
245
        ut_ad(mutex_own(&(dict_sys->mutex)));
245
246
 
246
247
        table = node->table;
247
248
 
248
 
        dict_hdr_get_new_id(&table->id, NULL,
249
 
                            srv_file_per_table ? &space : NULL);
 
249
        /* Cache the global variable "srv_file_per_table" to
 
250
        a local variable before using it. Please note
 
251
        "srv_file_per_table" is not under dict_sys mutex
 
252
        protection, and could be changed while executing
 
253
        this function. So better to cache the current value
 
254
        to a local variable, and all future reference to
 
255
        "srv_file_per_table" should use this local variable. */
 
256
        file_per_table = srv_file_per_table;
 
257
 
 
258
        dict_hdr_get_new_id(&table->id, NULL, NULL);
250
259
 
251
260
        thr_get_trx(thr)->table_id = table->id;
252
261
 
253
 
        if (srv_file_per_table) {
 
262
        if (file_per_table) {
 
263
                /* Get a new space id if srv_file_per_table is set */
 
264
                dict_hdr_get_new_id(NULL, NULL, &space);
 
265
 
254
266
                if (UNIV_UNLIKELY(space == ULINT_UNDEFINED)) {
255
267
                        return(DB_ERROR);
256
268
                }
578
590
        ins_node_set_new_row(node->ind_def, row);
579
591
 
580
592
        /* Note that the index was created by this transaction. */
581
 
        index->trx_id = (ib_uint64_t) ut_conv_dulint_to_longlong(trx->id);
 
593
        index->trx_id = trx->id;
582
594
 
583
595
        return(DB_SUCCESS);
584
596
}
749
761
        ibool           drop = !space;
750
762
        ulint           zip_size;
751
763
        ulint           type;
752
 
        dulint          index_id;
 
764
        index_id_t      index_id;
753
765
        rec_t*          rec;
754
766
        const byte*     ptr;
755
767
        ulint           len;
842
854
        for (index = UT_LIST_GET_FIRST(table->indexes);
843
855
             index;
844
856
             index = UT_LIST_GET_NEXT(indexes, index)) {
845
 
                if (!ut_dulint_cmp(index->id, index_id)) {
 
857
                if (index->id == index_id) {
846
858
                        root_page_no = btr_create(type, space, zip_size,
847
859
                                                  index_id, index, mtr);
848
860
                        index->page = (unsigned int) root_page_no;
852
864
 
853
865
        ut_print_timestamp(stderr);
854
866
        fprintf(stderr,
855
 
                "  InnoDB: Index %lu %lu of table %s is missing\n"
 
867
                "  InnoDB: Index %llu of table %s is missing\n"
856
868
                "InnoDB: from the data dictionary during TRUNCATE!\n",
857
 
                ut_dulint_get_high(index_id),
858
 
                ut_dulint_get_low(index_id),
 
869
                (ullint) index_id,
859
870
                table->name);
860
871
 
861
872
        return(FIL_NULL);
1107
1118
 
1108
1119
        if (node->state == INDEX_ADD_TO_CACHE) {
1109
1120
 
1110
 
                dulint  index_id = node->index->id;
 
1121
                index_id_t      index_id = node->index->id;
1111
1122
 
1112
1123
                err = dict_index_add_to_cache(
1113
1124
                        node->table, node->index, FIL_NULL,