diff options
author | Marcin Babij <marcin.babij@oracle.com> | 2014-06-30 12:31:44 +0200 |
---|---|---|
committer | Marcin Babij <marcin.babij@oracle.com> | 2014-06-30 12:31:44 +0200 |
commit | 1edfef74a8b45db6202770f88ac36137515eb598 (patch) | |
tree | 09e6b2b67185cac02076b919643ab46708a95d04 /client | |
parent | b1c03f5419ee4946ea01cdf23905503a7b894c92 (diff) | |
download | mariadb-git-1edfef74a8b45db6202770f88ac36137515eb598.tar.gz |
BUG#18779944: MYSQLDUMP BUFFER OVERFLOW
Reverted change due to mtr test failure.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 2a873903d60..c19b0b1822a 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -5538,36 +5538,19 @@ int main(int argc, char **argv) dump_all_tablespaces(); dump_all_databases(); } + else if (argc > 1 && !opt_databases) + { + /* Only one database and selected table(s) */ + if (!opt_alltspcs && !opt_notspcs) + dump_tablespaces_for_tables(*argv, (argv + 1), (argc -1)); + dump_selected_tables(*argv, (argv + 1), (argc - 1)); + } else { - // Check all arguments meet length condition. Currently database and table - // names are limited to NAME_LEN bytes and stack-based buffers assumes - // that escaped name will be not longer than NAME_LEN*2 + 2 bytes long. - int argument; - for (argument= 0; argument < argc; argument++) - { - size_t argument_length= strlen(argv[argument]); - if (argument_length > NAME_LEN) - { - die(EX_CONSCHECK, "[ERROR] Argument '%s' is too long, it cannot be " - "name for any table or database.\n", argv[argument]); - } - } - - if (argc > 1 && !opt_databases) - { - /* Only one database and selected table(s) */ - if (!opt_alltspcs && !opt_notspcs) - dump_tablespaces_for_tables(*argv, (argv + 1), (argc - 1)); - dump_selected_tables(*argv, (argv + 1), (argc - 1)); - } - else - { - /* One or more databases, all tables */ - if (!opt_alltspcs && !opt_notspcs) - dump_tablespaces_for_databases(argv); - dump_databases(argv); - } + /* One or more databases, all tables */ + if (!opt_alltspcs && !opt_notspcs) + dump_tablespaces_for_databases(argv); + dump_databases(argv); } /* if --dump-slave , start the slave sql thread */ |