MCPcopy Create free account
hub / github.com/MariaDB/server / handle_command_error

Function handle_command_error

client/mysqltest.cc:1761–1808  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1759}
1760
1761void handle_command_error(struct st_command *command, uint error,
1762 int sys_errno)
1763{
1764 DBUG_ENTER("handle_command_error");
1765 DBUG_PRINT("enter", ("error: %d", error));
1766 var_set_int("$sys_errno",sys_errno);
1767 var_set_int("$errno",error);
1768 if (error != 0)
1769 {
1770 int i;
1771
1772 if (command->abort_on_error)
1773 {
1774 report_or_die("command \"%.*sB\" failed with error: %u my_errno: %d "
1775 "errno: %d",
1776 command->first_word_len, command->query, error, my_errno,
1777 sys_errno);
1778 DBUG_VOID_RETURN;
1779 }
1780
1781 i= match_expected_error(command, error, NULL);
1782
1783 if (i >= 0)
1784 {
1785 DBUG_PRINT("info", ("command \"%.*s\" failed with expected error: %u, errno: %d",
1786 command->first_word_len, command->query, error,
1787 sys_errno));
1788 revert_properties();
1789 DBUG_VOID_RETURN;
1790 }
1791 if (command->expected_errors.count > 0)
1792 report_or_die("command \"%.*sB\" failed with wrong error: %u "
1793 "my_errno: %d errno: %d",
1794 command->first_word_len, command->query, error, my_errno,
1795 sys_errno);
1796 }
1797 else if (command->expected_errors.err[0].type == ERR_ERRNO &&
1798 command->expected_errors.err[0].code.errnum != 0)
1799 {
1800 /* Error code we wanted was != 0, i.e. not an expected success */
1801 report_or_die("command \"%.*sB\" succeeded - should have failed with "
1802 "errno %d...",
1803 command->first_word_len, command->query,
1804 command->expected_errors.err[0].code.errnum);
1805 }
1806 revert_properties();
1807 DBUG_VOID_RETURN;
1808}
1809
1810
1811void close_connections()

Callers 14

do_remove_fileFunction · 0.85
do_remove_files_wildcardFunction · 0.85
do_copy_fileFunction · 0.85
do_move_fileFunction · 0.85
do_chmod_fileFunction · 0.85
do_file_existFunction · 0.85
do_mkdirFunction · 0.85
do_rmdirFunction · 0.85
do_list_filesFunction · 0.85
do_cat_fileFunction · 0.85
do_diff_filesFunction · 0.85

Calls 4

var_set_intFunction · 0.85
report_or_dieFunction · 0.85
match_expected_errorFunction · 0.85
revert_propertiesFunction · 0.85

Tested by

no test coverage detected