[MDEV-8647] mysqldump should exit with an error when used with wrong parameter "-flush-logs" Created: 2015-08-19 Updated: 2015-08-19 Resolved: 2015-08-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Stoykov (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When mysqldump is used with flush-logs switch, but with one single dash no error is returned at all:
|
| Comments |
| Comment by Hartmut Holzgraefe [ 2015-08-19 ] | ||
|
in case of "-flush-logs", with a single instead of a double dash, all letters following the dash are interpreted as "short" single letter options, and "f" is the short option for
So the "--force" behavior should maybe be changed to only take effect after option parsing has been completed, not right away as soon as the option is seen? | ||
| Comment by Elena Stepanova [ 2015-08-19 ] | ||
|
hholzgra, @ ivan.stoykov@skysql.com : | ||
| Comment by Stoykov (Inactive) [ 2015-08-19 ] | ||
|
I still think this is not proper handling of that argument
should be interpreted in the same way as
- as a non valid mysqldump argument | ||
| Comment by Elena Stepanova [ 2015-08-19 ] | ||
|
But it is interpreted exactly the same way as -ignore-table. How exactly do you suggest to handle it properly? Prohibit the widely used syntax ps -aux etc., and only allow single-letter options? I doubt the users will appreciate it... Parse the options to search for common words and forbid the command line if we found any? It's kind of weird and not reliable anyway. | ||
| Comment by Stoykov (Inactive) [ 2015-08-19 ] | ||
|
like: | ||
| Comment by Elena Stepanova [ 2015-08-19 ] | ||
|
Matching the command line to complete option names does not solve the general problem; In order to achieve anything at all with this, we would also have to prohibit prefixes, like ''ord'' for 'order-by-primary' and such, and I doubt users will be happy about that. It's one thing to disapprove using contractions in server options – as server starts rarely, usually with a config file and minimal command line, – and quite another to make users write complete, sometimes very long options for frequently used command-line client tools. All in all, I vote against it, but it's not my decision to make, I am converting it to an FR and passing over to serg for further consideration (or maybe he can invent a better solution). | ||
| Comment by Sergei Golubchik [ 2015-08-19 ] | ||
|
This is not a bug, but expected and documented behavior. See elenst explanation above. |