Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-18293

row_sel_sec_rec_is_for_clust_rec() is being invoked for READ UNCOMMITTED

    XMLWordPrintable

    Details

      Description

      The function row_sel_get_clust_rec_for_mysql() is invoking row_sel_sec_rec_is_for_clust_rec() even at the READ UNCOMMITTED isolation level, where we should just assume that a non-delete-marked secondary index record does exist.

      One of the two calls is preceded by a condition that refers to the isolation level, but that condition seems wrong:

      		if (clust_rec
      		    && (old_vers
      			|| trx->isolation_level <= TRX_ISO_READ_UNCOMMITTED
      			|| rec_get_deleted_flag(rec, dict_table_is_comp(
      							sec_index->table)))
      		    && !row_sel_sec_rec_is_for_clust_rec(
      			    rec, sec_index, clust_rec, clust_index)) {
      			clust_rec = NULL;
      

      Because the lowest value for trx->isolation_level is

      #define TRX_ISO_READ_UNCOMMITTED	0
      

      the condition <= actually is equivalent to ==.

      I think that for READ UNCOMMITTED, we should only filter secondary index records by the delete-mark flag. If a record is delete-marked, pretend that it does not exist. This is exactly what we should already be doing for clustered index records.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thiru Thirunarayanan Balathandayuthapani
              Reporter:
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: