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

remove the need for dbug_tmp_use_all_columns() in handlers

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: 10.1
    • Component/s: None
    • Labels:

      Description

      We have bitmaps in the TABLE object to mark columns that can be written to or read from. There are asserts in the Field class to verify that the field is marked appropriately (a read or write bit is set for this field, depending on whether it's a read or write method of the Field class).

      But storage engines use fields to convert the data from the internal engine format to the server record format. That is, when a server wants to read a field value, the engine populates the record buffer using the field's write method. And when a server writes a record to the engine, the engine uses field's read method to get the value from the record buffer.

      In other words, engines use read-marked fields for writing and write-marked fields for reading, always hitting the assert. Thus all engines that use fields this way have adopted a rule of wrapping reading/writing code in the following incantation:

        my_bitmap_map *orig= dbug_tmp_use_all_columns(table, table->read_set);
        // ... use fields ...
        dbug_tmp_restore_column_map(table->read_set, orig);
      

      which temporarily resets the bitmap. This is ugly — engines should not care about server internal debugging asserts.

      To fix this the server should reset bitmaps in handler::ha_write_row() and other methods, providing the clear API to the engine not contaminated by internal server debugging tools.

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                serg Sergei Golubchik
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 1 day
                  1d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified