Comment 1 for bug 1003939

Revision history for this message
Baron Schwartz (baron-xaprb) wrote :

The problem is that there's no way to win with the way we are currently doing this. Here is the history: we used to not try to check privileges. But then the tool would do a lot of work and "fail late." We were trying to "fail early" for a better user experience. So we tried SHOW FULL COLUMNS, and a bunch of other things like a LIMIT 0 update/delete against the table.

But SHOW FULL COLUMNS actually lies about the privileges. I don't have any bugs handy to reference, but I know I've seen this before. (Maybe someone has even reported it before against this tool, or pt-table-sync.) And a LIMIT 0 change to the table will throw an error about statement-based logging blah blah. This might be fixable by starting a transaction, issuing the change, and then rolling it back... but that won't work for MyISAM blah blah. Oh, so we could do SHOW GRANTS and ... ugh, that's going to be even worse and less reliable.

So we are stuck in a hell of special cases and no-win and so on. We just have to bite the bullet and go back to the following approach, in my opinion: don't check. Just do it. If it fails it fails, and the user will have to fix it.