diff options
Diffstat (limited to 'storage/innobase/row/row0sel.c')
-rw-r--r-- | storage/innobase/row/row0sel.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index 7bec0a26225..b46b2eacd9d 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -2487,6 +2487,9 @@ row_sel_convert_mysql_key_to_innobase( dfield++; } + DBUG_EXECUTE_IF("innodb_srch_key_buffer_full", + ut_a(buf == (original_buf + buf_len));); + ut_a(buf <= original_buf + buf_len); /* We set the length of tuple to n_fields: we assume that the memory @@ -3915,6 +3918,11 @@ wait_table_again: } rec_loop: + if (trx_is_interrupted(trx)) { + err = DB_INTERRUPTED; + goto normal_return; + } + /*-------------------------------------------------------------*/ /* PHASE 4: Look for matching records in a loop */ @@ -4839,11 +4847,15 @@ row_search_autoinc_read_column( rec_offs_init(offsets_); - offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); + offsets = rec_get_offsets(rec, index, offsets, col_no + 1, &heap); - data = rec_get_nth_field(rec, offsets, col_no, &len); + if (rec_offs_nth_sql_null(offsets, col_no)) { + /* There is no non-NULL value in the auto-increment column. */ + value = 0; + goto func_exit; + } - ut_a(len != UNIV_SQL_NULL); + data = rec_get_nth_field(rec, offsets, col_no, &len); switch (mtype) { case DATA_INT: @@ -4865,14 +4877,15 @@ row_search_autoinc_read_column( ut_error; } - if (UNIV_LIKELY_NULL(heap)) { - mem_heap_free(heap); - } - if (!unsigned_type && (ib_int64_t) value < 0) { value = 0; } +func_exit: + if (UNIV_LIKELY_NULL(heap)) { + mem_heap_free(heap); + } + return(value); } |