Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1353

LP #1589972: pt-online-schema-change segfault with syntax error on alter

    XMLWordPrintable

    Details

      Description

      **Reported in Launchpad by Kenny Gryp last update 06-06-2017 04:17:55

      If I make a syntax error with this alter table, then pt-osc segfaults::

      pt-online-schema-change --alter "ADD INDEX idx_profile_id_id (profile_id, id), DROP INDEX (idx_profile_id)" D=prod,t=table --user management --ask-pass --dry-run

      Enter MySQL password:
      Enter MySQL password:
      Operation, tries, wait:
      copy_rows, 10, 0.25
      create_triggers, 10, 1
      drop_triggers, 10, 1
      swap_tables, 10, 1
      update_foreign_keys, 10, 1
      Starting a dry run. `prod`.`table` will not be altered. Specify --execute instead of --dry-run to alter the table.
      Creating new table...
      Created new table prod._table_new OK.
      Altering new table...
      2016-06-07T14:49:57 Dropping new table...
      2016-06-07T14:49:57 Dropped new table OK.
      Dry run complete. `prod`.`table` was not altered.
      Segmentation fault (core dumped)

      If I do it correctly, it works:

      pt-online-schema-change --alter "ADD INDEX idx_profile_id_id (profile_id, id), DROP INDEX idx_profile_id" D=prod,t=table --user management --ask-pass --dry-run
      Enter MySQL password:
      Enter MySQL password:
      Operation, tries, wait:
      copy_rows, 10, 0.25
      create_triggers, 10, 1
      drop_triggers, 10, 1
      swap_tables, 10, 1
      update_foreign_keys, 10, 1
      Starting a dry run. `prod`.`table` will not be altered. Specify --execute instead of --dry-run to alter the table.
      Creating new table...
      Created new table prod._table_new OK.
      Altering new table...
      Altered `prod`.`_table_new` OK.
      Not creating triggers because this is a dry run.
      Not copying rows because this is a dry run.
      Not swapping tables because this is a dry run.
      Not dropping old table because this is a dry run.
      Not dropping triggers because this is a dry run.
      2016-06-07T14:50:31 Dropping new table...
      2016-06-07T14:50:31 Dropped new table OK.
      Dry run complete. `prod`.`table` was not altered.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Smart Checklist