diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-05 10:23:14 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-05 10:23:14 +0300 |
commit | b132b8895e2e59df457e063451f186b53576b034 (patch) | |
tree | 565a5529facdca326b36d4418fae3522d8715e02 /sql/handler.cc | |
parent | 27980b0f83529725435dc8f37cb51878eb074d1d (diff) | |
parent | 4d59f45260547b3230f177498b6fa07a12647fdc (diff) | |
download | mariadb-git-b132b8895e2e59df457e063451f186b53576b034.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index bb97302c0b9..12a05aba90d 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2835,8 +2835,7 @@ int handler::ha_rnd_pos(uchar *buf, uchar *pos) DBUG_ENTER("handler::ha_rnd_pos"); DBUG_ASSERT(table_share->tmp_table != NO_TMP_TABLE || m_lock_type != F_UNLCK); - /* TODO: Find out how to solve ha_rnd_pos when finding duplicate update. */ - /* DBUG_ASSERT(inited == RND); */ + DBUG_ASSERT(inited == RND); TABLE_IO_WAIT(tracker, m_psi, PSI_TABLE_FETCH_ROW, MAX_KEY, 0, { result= rnd_pos(buf, pos); }) @@ -3515,6 +3514,10 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nr; int error; MY_BITMAP *old_read_set; + bool rnd_inited= (inited == RND); + + if (rnd_inited && ha_rnd_end()) + return; old_read_set= table->prepare_for_keyread(table->s->next_number_index); @@ -3524,6 +3527,10 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment, DBUG_ASSERT(0); (void) extra(HA_EXTRA_NO_KEYREAD); *first_value= ULONGLONG_MAX; + if (rnd_inited && ha_rnd_init_with_error(0)) + { + //TODO: it would be nice to return here an error + } return; } @@ -3570,6 +3577,10 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment, ha_index_end(); table->restore_column_maps_after_keyread(old_read_set); *first_value= nr; + if (rnd_inited && ha_rnd_init_with_error(0)) + { + //TODO: it would be nice to return here an error + } return; } |