Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

myway bug dropping non-existent indexes #32

Open
srcshelton opened this issue Nov 15, 2016 · 1 comment
Open

myway bug dropping non-existent indexes #32

srcshelton opened this issue Nov 15, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@srcshelton
Copy link
Owner

When in a schema script I try to drop an index which doesn't exist the error thrown by mysql is caught by myway and ignored. The rest of the script (and any other script) is run in afterwards. This occurs whether or not other statements were included in the ALTER TABLE. For example the script:

CREATE TABLE `test` (`id` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`));
ALTER TABLE `test`
DROP INDEX `idx_does_not_exist`,
ADD COLUMN `will_not_be_created` INT UNSIGNED NOT NULL;

... produces the following myway console output:

DBD::mysql::db do failed: Can't DROP 'idx_does_not_exist'; check that column/key exists at /usr/local/bin/myway.pl line 2730.

INFO:   Load completed

In this case the column will not be added which could cause unexpected errors in the future.
It would be preferred that myway does not silently hide these errors at all as they imply an assumption made by the developer is not true.

@srcshelton srcshelton added the bug label Nov 15, 2016
@srcshelton srcshelton added this to the 1.4.0.1 milestone Nov 15, 2016
@srcshelton srcshelton self-assigned this Nov 15, 2016
@srcshelton
Copy link
Owner Author

srcshelton commented Nov 16, 2016

Fixed in f0341e1 on branch latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant