~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/dict/dict0load.c

  • Committer: Monty Taylor
  • Date: 2008-09-15 17:24:04 UTC
  • Revision ID: monty@inaugust.com-20080915172404-ygh6hiyu0q7qpa9x
Removed strndup calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
*******************************************************/
9
9
 
10
10
#include "dict0load.h"
11
 
#ifndef UNIV_HOTBACKUP
12
 
#if defined(BUILD_DRIZZLE)
13
 
# include <config.h>
14
 
#else
15
 
# include "mysql_version.h"
16
 
#endif /* DRIZZLE */
17
 
#endif /* !UNIV_HOTBACKUP */
18
11
 
19
12
#ifdef UNIV_NONINL
20
13
#include "dict0load.ic"
51
44
 
52
45
/************************************************************************
53
46
Finds the first table name in the given database. */
54
 
UNIV_INTERN
 
47
 
55
48
char*
56
49
dict_get_first_table_name_in_db(
57
50
/*============================*/
66
59
        dtuple_t*       tuple;
67
60
        mem_heap_t*     heap;
68
61
        dfield_t*       dfield;
69
 
        const rec_t*    rec;
70
 
        const byte*     field;
 
62
        rec_t*          rec;
 
63
        byte*           field;
71
64
        ulint           len;
72
65
        mtr_t           mtr;
73
66
 
92
85
loop:
93
86
        rec = btr_pcur_get_rec(&pcur);
94
87
 
95
 
        if (!btr_pcur_is_on_user_rec(&pcur)) {
 
88
        if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
96
89
                /* Not found */
97
90
 
98
91
                btr_pcur_close(&pcur);
136
129
/************************************************************************
137
130
Prints to the standard output information on all tables found in the data
138
131
dictionary system table. */
139
 
UNIV_INTERN
 
132
 
140
133
void
141
134
dict_print(void)
142
135
/*============*/
145
138
        dict_index_t*   sys_index;
146
139
        dict_table_t*   table;
147
140
        btr_pcur_t      pcur;
148
 
        const rec_t*    rec;
149
 
        const byte*     field;
 
141
        rec_t*          rec;
 
142
        byte*           field;
150
143
        ulint           len;
151
144
        mtr_t           mtr;
152
145
 
171
164
 
172
165
        rec = btr_pcur_get_rec(&pcur);
173
166
 
174
 
        if (!btr_pcur_is_on_user_rec(&pcur)) {
 
167
        if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
175
168
                /* end of index */
176
169
 
177
170
                btr_pcur_close(&pcur);
227
220
}
228
221
 
229
222
/************************************************************************
230
 
Determine the flags of a table described in SYS_TABLES. */
231
 
static
232
 
ulint
233
 
dict_sys_tables_get_flags(
234
 
/*======================*/
235
 
                                /* out: compressed page size in kilobytes;
236
 
                                or 0 if the tablespace is uncompressed,
237
 
                                ULINT_UNDEFINED on error */
238
 
        const rec_t*    rec)    /* in: a record of SYS_TABLES */
239
 
{
240
 
        const byte*     field;
241
 
        ulint           len;
242
 
        ulint           n_cols;
243
 
        ulint           flags;
244
 
 
245
 
        field = rec_get_nth_field_old(rec, 5, &len);
246
 
        ut_a(len == 4);
247
 
 
248
 
        flags = mach_read_from_4(field);
249
 
 
250
 
        if (UNIV_LIKELY(flags == DICT_TABLE_ORDINARY)) {
251
 
                return(0);
252
 
        }
253
 
 
254
 
        field = rec_get_nth_field_old(rec, 4, &len);
255
 
        n_cols = mach_read_from_4(field);
256
 
 
257
 
        if (UNIV_UNLIKELY(!(n_cols & 0x80000000UL))) {
258
 
                /* New file formats require ROW_FORMAT=COMPACT. */
259
 
                return(ULINT_UNDEFINED);
260
 
        }
261
 
 
262
 
        switch (flags & (DICT_TF_FORMAT_MASK | DICT_TF_COMPACT)) {
263
 
        default:
264
 
        case DICT_TF_FORMAT_51 << DICT_TF_FORMAT_SHIFT:
265
 
        case DICT_TF_FORMAT_51 << DICT_TF_FORMAT_SHIFT | DICT_TF_COMPACT:
266
 
                /* flags should be DICT_TABLE_ORDINARY,
267
 
                or DICT_TF_FORMAT_MASK should be nonzero. */
268
 
                return(ULINT_UNDEFINED);
269
 
 
270
 
        case DICT_TF_FORMAT_ZIP << DICT_TF_FORMAT_SHIFT | DICT_TF_COMPACT:
271
 
#if DICT_TF_FORMAT_MAX > DICT_TF_FORMAT_ZIP
272
 
# error "missing case labels for DICT_TF_FORMAT_ZIP .. DICT_TF_FORMAT_MAX"
273
 
#endif
274
 
                /* We support this format. */
275
 
                break;
276
 
        }
277
 
 
278
 
        if (UNIV_UNLIKELY((flags & DICT_TF_ZSSIZE_MASK)
279
 
                          > (DICT_TF_ZSSIZE_MAX << DICT_TF_ZSSIZE_SHIFT))) {
280
 
                /* Unsupported compressed page size. */
281
 
                return(ULINT_UNDEFINED);
282
 
        }
283
 
 
284
 
        if (UNIV_UNLIKELY(flags & (~0 << DICT_TF_BITS))) {
285
 
                /* Some unused bits are set. */
286
 
                return(ULINT_UNDEFINED);
287
 
        }
288
 
 
289
 
        return(flags);
290
 
}
291
 
 
292
 
/************************************************************************
293
223
In a crash recovery we already have all the tablespace objects created.
294
224
This function compares the space id information in the InnoDB data dictionary
295
225
to what we already read with fil_load_single_table_tablespaces().
297
227
In a normal startup, we create the tablespace objects for every table in
298
228
InnoDB's data dictionary, if the corresponding .ibd file exists.
299
229
We also scan the biggest space id, and store it to fil_system. */
300
 
UNIV_INTERN
 
230
 
301
231
void
302
232
dict_check_tablespaces_and_store_max_id(
303
233
/*====================================*/
306
236
        dict_table_t*   sys_tables;
307
237
        dict_index_t*   sys_index;
308
238
        btr_pcur_t      pcur;
309
 
        const rec_t*    rec;
 
239
        rec_t*          rec;
 
240
        byte*           field;
 
241
        ulint           len;
 
242
        ulint           space_id;
310
243
        ulint           max_space_id    = 0;
311
244
        mtr_t           mtr;
312
245
 
325
258
 
326
259
        rec = btr_pcur_get_rec(&pcur);
327
260
 
328
 
        if (!btr_pcur_is_on_user_rec(&pcur)) {
 
261
        if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
329
262
                /* end of index */
330
263
 
331
264
                btr_pcur_close(&pcur);
343
276
                return;
344
277
        }
345
278
 
 
279
        field = rec_get_nth_field_old(rec, 0, &len);
 
280
 
346
281
        if (!rec_get_deleted_flag(rec, 0)) {
347
282
 
348
283
                /* We found one */
349
 
                const byte*     field;
350
 
                ulint           len;
351
 
                ulint           space_id;
352
 
                ulint           flags;
353
 
                char*           name;
354
 
 
355
 
                field = rec_get_nth_field_old(rec, 0, &len);
356
 
                name = mem_strdupl((char*) field, len);
357
 
 
358
 
                flags = dict_sys_tables_get_flags(rec);
359
 
                if (UNIV_UNLIKELY(flags == ULINT_UNDEFINED)) {
360
 
 
361
 
                        field = rec_get_nth_field_old(rec, 5, &len);
362
 
                        flags = mach_read_from_4(field);
363
 
 
364
 
                        ut_print_timestamp(stderr);
365
 
                        fputs("  InnoDB: Error: table ", stderr);
366
 
                        ut_print_filename(stderr, name);
367
 
                        fprintf(stderr, "\n"
368
 
                                "InnoDB: in InnoDB data dictionary"
369
 
                                " has unknown type %lx.\n",
370
 
                                (ulong) flags);
371
 
 
372
 
                        goto loop;
373
 
                }
 
284
 
 
285
                char*   name = mem_strdupl((char*) field, len);
374
286
 
375
287
                field = rec_get_nth_field_old(rec, 9, &len);
376
288
                ut_a(len == 4);
394
306
                        object and check that the .ibd file exists. */
395
307
 
396
308
                        fil_open_single_table_tablespace(FALSE, space_id,
397
 
                                                         flags, name);
 
309
                                                         name);
398
310
                }
399
311
 
400
312
                mem_free(name);
425
337
        btr_pcur_t      pcur;
426
338
        dtuple_t*       tuple;
427
339
        dfield_t*       dfield;
428
 
        const rec_t*    rec;
429
 
        const byte*     field;
 
340
        rec_t*          rec;
 
341
        byte*           field;
430
342
        ulint           len;
431
343
        byte*           buf;
432
344
        char*           name;
459
371
 
460
372
                rec = btr_pcur_get_rec(&pcur);
461
373
 
462
 
                ut_a(btr_pcur_is_on_user_rec(&pcur));
 
374
                ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr));
463
375
 
464
376
                ut_a(!rec_get_deleted_flag(rec, 0));
465
377
 
492
404
 
493
405
                                prtype = dtype_form_prtype(
494
406
                                        prtype,
495
 
                                        DATA_MYSQL_BINARY_CHARSET_COLL);
 
407
                                        DATA_DRIZZLE_BINARY_CHARSET_COLL);
496
408
                        } else {
497
409
                                /* Use the default charset for
498
410
                                other than binary columns. */
518
430
}
519
431
 
520
432
/************************************************************************
 
433
Report that an index field or index for a table has been delete marked. */
 
434
static
 
435
void
 
436
dict_load_report_deleted_index(
 
437
/*===========================*/
 
438
        const char*     name,   /* in: table name */
 
439
        ulint           field)  /* in: index field, or ULINT_UNDEFINED */
 
440
{
 
441
        fprintf(stderr, "InnoDB: Error: data dictionary entry"
 
442
                " for table %s is corrupt!\n", name);
 
443
        if (field != ULINT_UNDEFINED) {
 
444
                fprintf(stderr,
 
445
                        "InnoDB: Index field %lu is delete marked.\n", field);
 
446
        } else {
 
447
                fputs("InnoDB: An index is delete marked.\n", stderr);
 
448
        }
 
449
}
 
450
 
 
451
/************************************************************************
521
452
Loads definitions for index fields. */
522
453
static
523
454
void
524
455
dict_load_fields(
525
456
/*=============*/
 
457
        dict_table_t*   table,  /* in: table */
526
458
        dict_index_t*   index,  /* in: index whose fields to load */
527
459
        mem_heap_t*     heap)   /* in: memory heap for temporary storage */
528
460
{
533
465
        dfield_t*       dfield;
534
466
        ulint           pos_and_prefix_len;
535
467
        ulint           prefix_len;
536
 
        const rec_t*    rec;
537
 
        const byte*     field;
 
468
        rec_t*          rec;
 
469
        byte*           field;
538
470
        ulint           len;
539
471
        byte*           buf;
540
472
        ulint           i;
563
495
 
564
496
                rec = btr_pcur_get_rec(&pcur);
565
497
 
566
 
                ut_a(btr_pcur_is_on_user_rec(&pcur));
567
 
 
568
 
                /* There could be delete marked records in SYS_FIELDS
569
 
                because SYS_FIELDS.INDEX_ID can be updated
570
 
                by ALTER TABLE ADD INDEX. */
571
 
 
 
498
                ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr));
572
499
                if (rec_get_deleted_flag(rec, 0)) {
573
 
 
574
 
                        goto next_rec;
 
500
                        dict_load_report_deleted_index(table->name, i);
575
501
                }
576
502
 
577
503
                field = rec_get_nth_field_old(rec, 0, &len);
578
504
                ut_ad(len == 8);
 
505
                ut_a(ut_memcmp(buf, field, len) == 0);
579
506
 
580
507
                field = rec_get_nth_field_old(rec, 1, &len);
581
508
                ut_a(len == 4);
610
537
                                                          (char*) field, len),
611
538
                                         prefix_len);
612
539
 
613
 
next_rec:
614
540
                btr_pcur_move_to_next_user_rec(&pcur, &mtr);
615
541
        }
616
542
 
638
564
        btr_pcur_t      pcur;
639
565
        dtuple_t*       tuple;
640
566
        dfield_t*       dfield;
641
 
        const rec_t*    rec;
642
 
        const byte*     field;
 
567
        rec_t*          rec;
 
568
        byte*           field;
643
569
        ulint           len;
644
570
        ulint           name_len;
645
571
        char*           name_buf;
680
606
        btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
681
607
                                  BTR_SEARCH_LEAF, &pcur, &mtr);
682
608
        for (;;) {
683
 
                if (!btr_pcur_is_on_user_rec(&pcur)) {
 
609
                if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
684
610
 
685
611
                        break;
686
612
                }
692
618
 
693
619
                if (ut_memcmp(buf, field, len) != 0) {
694
620
                        break;
695
 
                } else if (rec_get_deleted_flag(rec, 0)) {
696
 
                        /* Skip delete marked records */
697
 
                        goto next_rec;
 
621
                }
 
622
 
 
623
                if (rec_get_deleted_flag(rec, 0)) {
 
624
                        dict_load_report_deleted_index(table->name,
 
625
                                                       ULINT_UNDEFINED);
 
626
 
 
627
                        error = DB_CORRUPTION;
 
628
                        goto func_exit;
698
629
                }
699
630
 
700
631
                field = rec_get_nth_field_old(rec, 1, &len);
744
675
                } else if ((type & DICT_CLUSTERED) == 0
745
676
                            && NULL == dict_table_get_first_index(table)) {
746
677
 
747
 
                        fputs("InnoDB: Error: trying to load index ",
748
 
                              stderr);
749
 
                        ut_print_name(stderr, NULL, FALSE, name_buf);
750
 
                        fputs(" for table ", stderr);
751
 
                        ut_print_name(stderr, NULL, TRUE, table->name);
752
 
                        fputs("\nInnoDB: but the first index"
753
 
                              " is not clustered!\n", stderr);
 
678
                        fprintf(stderr,
 
679
                                "InnoDB: Error: trying to load index %s"
 
680
                                " for table %s\n"
 
681
                                "InnoDB: but the first index"
 
682
                                " is not clustered!\n",
 
683
                                name_buf, table->name);
754
684
 
755
685
                        error = DB_CORRUPTION;
756
686
                        goto func_exit;
768
698
                                                      space, type, n_fields);
769
699
                        index->id = id;
770
700
 
771
 
                        dict_load_fields(index, heap);
772
 
                        error = dict_index_add_to_cache(table, index, page_no);
773
 
                        /* The data dictionary tables should never contain
774
 
                        invalid index definitions.  If we ignored this error
775
 
                        and simply did not load this index definition, the
776
 
                        .frm file would disagree with the index definitions
777
 
                        inside InnoDB. */
778
 
                        if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
779
 
 
780
 
                                goto func_exit;
781
 
                        }
 
701
                        dict_load_fields(table, index, heap);
 
702
                        dict_index_add_to_cache(table, index, page_no);
782
703
                }
783
704
 
784
 
next_rec:
785
705
                btr_pcur_move_to_next_user_rec(&pcur, &mtr);
786
706
        }
787
707
 
798
718
all foreign key constraints where the foreign key is in the table or where
799
719
a foreign key references columns in this table. Adds all these to the data
800
720
dictionary cache. */
801
 
UNIV_INTERN
 
721
 
802
722
dict_table_t*
803
723
dict_load_table(
804
724
/*============*/
818
738
        dtuple_t*       tuple;
819
739
        mem_heap_t*     heap;
820
740
        dfield_t*       dfield;
821
 
        const rec_t*    rec;
822
 
        const byte*     field;
 
741
        rec_t*          rec;
 
742
        byte*           field;
823
743
        ulint           len;
824
744
        ulint           space;
825
745
        ulint           n_cols;
847
767
                                  BTR_SEARCH_LEAF, &pcur, &mtr);
848
768
        rec = btr_pcur_get_rec(&pcur);
849
769
 
850
 
        if (!btr_pcur_is_on_user_rec(&pcur)
 
770
        if (!btr_pcur_is_on_user_rec(&pcur, &mtr)
851
771
            || rec_get_deleted_flag(rec, 0)) {
852
772
                /* Not found */
853
773
err_exit:
873
793
 
874
794
        /* Check if the tablespace exists and has the right name */
875
795
        if (space != 0) {
876
 
                flags = dict_sys_tables_get_flags(rec);
877
 
 
878
 
                if (UNIV_UNLIKELY(flags == ULINT_UNDEFINED)) {
879
 
                        field = rec_get_nth_field_old(rec, 5, &len);
880
 
                        flags = mach_read_from_4(field);
881
 
 
882
 
                        ut_print_timestamp(stderr);
883
 
                        fputs("  InnoDB: Error: table ", stderr);
884
 
                        ut_print_filename(stderr, name);
885
 
                        fprintf(stderr, "\n"
886
 
                                "InnoDB: in InnoDB data dictionary"
887
 
                                " has unknown type %lx.\n",
888
 
                                (ulong) flags);
889
 
                        goto err_exit;
890
 
                }
891
 
 
892
796
                if (fil_space_for_table_exists_in_mem(space, name, FALSE,
893
797
                                                      FALSE, FALSE)) {
894
798
                        /* Ok; (if we did a crash recovery then the tablespace
905
809
                                " Retrying an open.\n",
906
810
                                name, (ulong)space);
907
811
                        /* Try to open the tablespace */
908
 
                        if (!fil_open_single_table_tablespace(
909
 
                                    TRUE, space, flags, name)) {
 
812
                        if (!fil_open_single_table_tablespace(TRUE,
 
813
                                                              space, name)) {
910
814
                                /* We failed to find a sensible tablespace
911
815
                                file */
912
816
 
913
817
                                ibd_file_missing = TRUE;
914
818
                        }
915
819
                }
916
 
        } else {
917
 
                flags = 0;
918
820
        }
919
821
 
920
822
        ut_a(name_of_col_is(sys_tables, sys_index, 4, "N_COLS"));
922
824
        field = rec_get_nth_field_old(rec, 4, &len);
923
825
        n_cols = mach_read_from_4(field);
924
826
 
 
827
        flags = 0;
 
828
 
925
829
        /* The high-order bit of N_COLS is the "compact format" flag. */
926
830
        if (n_cols & 0x80000000UL) {
927
831
                flags |= DICT_TF_COMPACT;
937
841
        field = rec_get_nth_field_old(rec, 3, &len);
938
842
        table->id = mach_read_from_8(field);
939
843
 
 
844
        field = rec_get_nth_field_old(rec, 5, &len);
 
845
        if (UNIV_UNLIKELY(mach_read_from_4(field) != DICT_TABLE_ORDINARY)) {
 
846
                ut_print_timestamp(stderr);
 
847
                fprintf(stderr,
 
848
                        "  InnoDB: table %s: unknown table type %lu\n",
 
849
                        name, (ulong) mach_read_from_4(field));
 
850
                goto err_exit;
 
851
        }
 
852
 
940
853
        btr_pcur_close(&pcur);
941
854
        mtr_commit(&mtr);
942
855
 
947
860
        mem_heap_empty(heap);
948
861
 
949
862
        err = dict_load_indexes(table, heap);
950
 
#ifndef UNIV_HOTBACKUP
 
863
 
951
864
        /* If the force recovery flag is set, we open the table irrespective
952
865
        of the error condition, since the user may want to dump data from the
953
866
        clustered index. However we load the foreign key information only if
958
871
        } else if (err == DB_SUCCESS) {
959
872
                err = dict_load_foreigns(table->name, TRUE);
960
873
        }
961
 
# if 0
 
874
#if 0
962
875
        if (err != DB_SUCCESS && table != NULL) {
963
876
 
964
877
                mutex_enter(&dict_foreign_err_mutex);
981
894
 
982
895
                mutex_exit(&dict_foreign_err_mutex);
983
896
        }
984
 
# endif /* 0 */
985
 
#endif /* !UNIV_HOTBACKUP */
 
897
#endif /* 0 */
986
898
        mem_heap_free(heap);
987
899
 
988
900
        return(table);
990
902
 
991
903
/***************************************************************************
992
904
Loads a table object based on the table id. */
993
 
UNIV_INTERN
 
905
 
994
906
dict_table_t*
995
907
dict_load_table_on_id(
996
908
/*==================*/
1004
916
        dfield_t*       dfield;
1005
917
        dict_index_t*   sys_table_ids;
1006
918
        dict_table_t*   sys_tables;
1007
 
        const rec_t*    rec;
1008
 
        const byte*     field;
 
919
        rec_t*          rec;
 
920
        byte*           field;
1009
921
        ulint           len;
1010
922
        dict_table_t*   table;
1011
923
        mtr_t           mtr;
1038
950
                                  BTR_SEARCH_LEAF, &pcur, &mtr);
1039
951
        rec = btr_pcur_get_rec(&pcur);
1040
952
 
1041
 
        if (!btr_pcur_is_on_user_rec(&pcur)
 
953
        if (!btr_pcur_is_on_user_rec(&pcur, &mtr)
1042
954
            || rec_get_deleted_flag(rec, 0)) {
1043
955
                /* Not found */
1044
956
 
1083
995
This function is called when the database is booted. Loads system table
1084
996
index definitions except for the clustered index which is added to the
1085
997
dictionary cache at booting before calling this function. */
1086
 
UNIV_INTERN
 
998
 
1087
999
void
1088
1000
dict_load_sys_table(
1089
1001
/*================*/
1100
1012
        mem_heap_free(heap);
1101
1013
}
1102
1014
 
1103
 
#ifndef UNIV_HOTBACKUP
1104
1015
/************************************************************************
1105
1016
Loads foreign key constraint col names (also for the referenced table). */
1106
1017
static
1116
1027
        btr_pcur_t      pcur;
1117
1028
        dtuple_t*       tuple;
1118
1029
        dfield_t*       dfield;
1119
 
        const rec_t*    rec;
1120
 
        const byte*     field;
 
1030
        rec_t*          rec;
 
1031
        byte*           field;
1121
1032
        ulint           len;
1122
1033
        ulint           i;
1123
1034
        mtr_t           mtr;
1147
1058
 
1148
1059
                rec = btr_pcur_get_rec(&pcur);
1149
1060
 
1150
 
                ut_a(btr_pcur_is_on_user_rec(&pcur));
 
1061
                ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr));
1151
1062
                ut_a(!rec_get_deleted_flag(rec, 0));
1152
1063
 
1153
1064
                field = rec_get_nth_field_old(rec, 0, &len);
1192
1103
        dtuple_t*       tuple;
1193
1104
        mem_heap_t*     heap2;
1194
1105
        dfield_t*       dfield;
1195
 
        const rec_t*    rec;
1196
 
        const byte*     field;
 
1106
        rec_t*          rec;
 
1107
        byte*           field;
1197
1108
        ulint           len;
1198
1109
        ulint           n_fields_and_type;
1199
1110
        mtr_t           mtr;
1218
1129
                                  BTR_SEARCH_LEAF, &pcur, &mtr);
1219
1130
        rec = btr_pcur_get_rec(&pcur);
1220
1131
 
1221
 
        if (!btr_pcur_is_on_user_rec(&pcur)
 
1132
        if (!btr_pcur_is_on_user_rec(&pcur, &mtr)
1222
1133
            || rec_get_deleted_flag(rec, 0)) {
1223
1134
                /* Not found */
1224
1135
 
1304
1215
constraints to the data dictionary. Note that we know that the dictionary
1305
1216
cache already contains all constraints where the other relevant table is
1306
1217
already in the dictionary cache. */
1307
 
UNIV_INTERN
 
1218
 
1308
1219
ulint
1309
1220
dict_load_foreigns(
1310
1221
/*===============*/
1319
1230
        dfield_t*       dfield;
1320
1231
        dict_index_t*   sec_index;
1321
1232
        dict_table_t*   sys_foreign;
1322
 
        const rec_t*    rec;
1323
 
        const byte*     field;
 
1233
        rec_t*          rec;
 
1234
        byte*           field;
1324
1235
        ulint           len;
1325
1236
        char*           id ;
1326
1237
        ulint           err;
1362
1273
loop:
1363
1274
        rec = btr_pcur_get_rec(&pcur);
1364
1275
 
1365
 
        if (!btr_pcur_is_on_user_rec(&pcur)) {
 
1276
        if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
1366
1277
                /* End of index */
1367
1278
 
1368
1279
                goto load_next_index;
1444
1355
 
1445
1356
        return(DB_SUCCESS);
1446
1357
}
1447
 
#endif /* !UNIV_HOTBACKUP */