diff options
Diffstat (limited to 'innobase/row/row0row.c')
-rw-r--r-- | innobase/row/row0row.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/innobase/row/row0row.c b/innobase/row/row0row.c index 6820cb5bccd..680539764fd 100644 --- a/innobase/row/row0row.c +++ b/innobase/row/row0row.c @@ -390,7 +390,6 @@ row_build_row_ref_in_tuple( at least s-latched and the latch held as long as the row reference is used! */ { - dict_table_t* table; dict_index_t* clust_index; dfield_t* dfield; byte* field; @@ -401,21 +400,21 @@ row_build_row_ref_in_tuple( ut_a(ref && index && rec); - table = index->table; - - if (!table) { - fprintf(stderr, "InnoDB: table %s for index %s not found\n", - index->table_name, index->name); + if (!index->table) { + fputs("InnoDB: table ", stderr); + notfound: + ut_print_name(stderr, index->table_name); + fputs(" for index ", stderr); + ut_print_name(stderr, index->name); + fputs(" not found\n", stderr); ut_error; } - clust_index = dict_table_get_first_index(table); + clust_index = dict_table_get_first_index(index->table); if (!clust_index) { - fprintf(stderr, - "InnoDB: clust index for table %s for index %s not found\n", - index->table_name, index->name); - ut_error; + fputs("InnoDB: clust index for table ", stderr); + goto notfound; } ref_len = dict_index_get_n_unique(clust_index); @@ -568,7 +567,7 @@ row_get_clust_rec( found = row_search_on_row_ref(&pcur, mode, table, ref, mtr); - clust_rec = btr_pcur_get_rec(&pcur); + clust_rec = found ? btr_pcur_get_rec(&pcur) : NULL; mem_heap_free(heap); @@ -576,11 +575,6 @@ row_get_clust_rec( *clust_index = dict_table_get_first_index(table); - if (!found) { - - return(NULL); - } - return(clust_rec); } |