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

Alert the user of db table permissions errors #123

Open
1 task done
Benunc opened this issue May 30, 2019 · 1 comment
Open
1 task done

Alert the user of db table permissions errors #123

Benunc opened this issue May 30, 2019 · 1 comment

Comments

@Benunc
Copy link

Benunc commented May 30, 2019

Feature Request

Use Case and user story

When there are database table permissions errors, search-replace should be able to alert the user.

I was working with an older DB that I had manually imported the wp_posts table with the wrong DB permissions. (the table was read-only)

When I did a dry-run of the search-replace it worked great, showed me all the replacements to be made, etc.

Then when I did a live run, it went through the process and still reported that there were 527 changes to make, but instead of making them it returned Success: 0 Replacements made

I downloaded a more blunt tool for forcing the DB updates through, and that's when I discovered that the table in question is read-only. Once I knew that, the workaround was simple: export the DB to a fresh DB using wp db export and then import that fresh database, which resets the permissions, then search-replace worked like a charm.

I also tried with --verbose and --debug but the critical piece (when the actual SQL is running) is not outputting anything useful.

Output of the Dry Run

527 Replacements to be made

Output of the --debug argument on a live run

Success: made 0 replacements

Proposed solution

It would be more helpful if table permission errors are preventing the actual changing, that this is output.

I'd propose an additional argument of --errors or adding this output to the existing --debug argument.

@schlessera
Copy link
Member

schlessera commented Jun 14, 2019

Thanks for the report, @Benunc! I think it might make even more sense to actually forward errors or warnings, and in this case show an error that a read-only db/table cannot be changed.

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

No branches or pull requests

2 participants