Set sys_errno upon exec command

This commit is contained in:
Elena Stepanova 2017-01-29 00:50:28 +02:00
commit 923d7d0ad2

View file

@ -3341,6 +3341,8 @@ void do_exec(struct st_command *command)
DBUG_ENTER("do_exec");
DBUG_PRINT("enter", ("cmd: '%s'", cmd));
var_set_int("$sys_errno",0);
/* Skip leading space */
while (*cmd && my_isspace(charset_info, *cmd))
cmd++;
@ -3457,6 +3459,7 @@ void do_exec(struct st_command *command)
report_or_die("command \"%s\" failed with wrong error: %d",
command->first_argument, status);
}
var_set_int("$sys_errno",status);
}
else if (command->expected_errors.err[0].type == ERR_ERRNO &&
command->expected_errors.err[0].code.errnum != 0)