mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
patch
client/mysqldump.c: Add description of quote_for_like Add quoting of \ to \\\\ in quote_for_like Add DBUG_* Rearranged code in dump_selected_tables so the first thing it will do is to check that the tables to dump are available Unless --force is used, program will exit if not all specified tables can be found Add files to dump to HASH table for easy iteration Simpler handling of ignore_table list. Add new error code used when table user selected to dump can not be found in db client/mysqltest.c: Make it possible to exec a command that fails by setting --error <errno> before the command to exec. Check that the error returned from executed program matches the expected error. Add DBUG_* printouts mysql-test/mysql-test-run.sh: export MYSQL_DUMP_DIR used in "--replace_result" mysql-test/r/mysqldump.result: Added test for illegal / nonexisting table and database names mysql-test/t/mysqldump.test: Added test for illegal / nonexisting table and database names
This commit is contained in:
@ -781,7 +781,7 @@ int var_set(const char *var_name, const char *var_name_end,
|
||||
}
|
||||
else
|
||||
v = var_reg + digit;
|
||||
return eval_expr(v, var_val, (const char**)&var_val_end);
|
||||
DBUG_RETURN(eval_expr(v, var_val, (const char**)&var_val_end));
|
||||
}
|
||||
|
||||
|
||||
@ -955,9 +955,38 @@ static void do_exec(struct st_query* q)
|
||||
replace_dynstr_append_mem(ds, buf, strlen(buf));
|
||||
}
|
||||
error= pclose(res_file);
|
||||
|
||||
if (error != 0)
|
||||
die("command \"%s\" failed", cmd);
|
||||
{
|
||||
uint status= WEXITSTATUS(error);
|
||||
if(q->abort_on_error)
|
||||
die("At line %u: command \"%s\" failed", start_lineno, cmd);
|
||||
else
|
||||
{
|
||||
DBUG_PRINT("info",
|
||||
("error: %d, status: %d", error, status));
|
||||
bool ok= 0;
|
||||
uint i;
|
||||
for (i=0 ; (uint) i < q->expected_errors ; i++)
|
||||
{
|
||||
DBUG_PRINT("info", ("expected error: %d", q->expected_errno[i].code.errnum));
|
||||
if ((q->expected_errno[i].type == ERR_ERRNO) &&
|
||||
(q->expected_errno[i].code.errnum == status))
|
||||
ok= 1;
|
||||
verbose_msg("At line %u: command \"%s\" failed with expected error: %d",
|
||||
start_lineno, cmd, status);
|
||||
}
|
||||
if (!ok)
|
||||
die("At line: %u: command \"%s\" failed with wrong error: %d",
|
||||
start_lineno, cmd, status);
|
||||
}
|
||||
}
|
||||
else if (q->expected_errno[0].type == ERR_ERRNO &&
|
||||
q->expected_errno[0].code.errnum != 0)
|
||||
{
|
||||
/* Error code we wanted was != 0, i.e. not an expected success */
|
||||
die("At line: %u: command \"%s\" succeeded - should have failed with errno %d...",
|
||||
start_lineno, cmd, q->expected_errno[0].code.errnum);
|
||||
}
|
||||
|
||||
if (!disable_result_log)
|
||||
{
|
||||
|
Reference in New Issue
Block a user