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

Use helper methods introduced in MDEV-7824 all around the code

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.1
    • 10.1.8
    • OTHER
    • None
    • 10.1.6-2, 10.1.8-1

    Description

      The patch for MDEV-7824 is going to add a few useful helper methods.
      During review, Sergei suggested to use these new methods in the other code parts:

      This is ok, but then, please, see what other places in the code you can
      change to use your new helpers. In a separate commit, of course. I
      suspect there's a lot of code that's doing, like

            /* Get the value from default_values */
            diff= (my_ptrdiff_t) (orig_field->table->s->default_values-
                                  orig_field->table->record[0]);
            orig_field->move_field_offset(diff);      // Points now at default_values
            if (orig_field->is_real_null())
              field->set_null();
            else
            {
              field->set_notnull();
              memcpy(field->ptr, orig_field->ptr, field->pack_length());
            }
            orig_field->move_field_offset(-diff);     // Back to record[0]

      (this is from create_tmp_table() in sql_select.cc)

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.