Commit 923d7d0a authored by Elena Stepanova's avatar Elena Stepanova

Set sys_errno upon exec command

parent c46d1409
...@@ -3341,6 +3341,8 @@ void do_exec(struct st_command *command) ...@@ -3341,6 +3341,8 @@ void do_exec(struct st_command *command)
DBUG_ENTER("do_exec"); DBUG_ENTER("do_exec");
DBUG_PRINT("enter", ("cmd: '%s'", cmd)); DBUG_PRINT("enter", ("cmd: '%s'", cmd));
var_set_int("$sys_errno",0);
/* Skip leading space */ /* Skip leading space */
while (*cmd && my_isspace(charset_info, *cmd)) while (*cmd && my_isspace(charset_info, *cmd))
cmd++; cmd++;
...@@ -3457,6 +3459,7 @@ void do_exec(struct st_command *command) ...@@ -3457,6 +3459,7 @@ void do_exec(struct st_command *command)
report_or_die("command \"%s\" failed with wrong error: %d", report_or_die("command \"%s\" failed with wrong error: %d",
command->first_argument, status); command->first_argument, status);
} }
var_set_int("$sys_errno",status);
} }
else if (command->expected_errors.err[0].type == ERR_ERRNO && else if (command->expected_errors.err[0].type == ERR_ERRNO &&
command->expected_errors.err[0].code.errnum != 0) command->expected_errors.err[0].code.errnum != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment