Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
683a46a3
Commit
683a46a3
authored
Jun 01, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ER_SAFE() for cases when the error message could be out of bands
parent
7ec2d474
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
28 deletions
+29
-28
sql/slave.cc
sql/slave.cc
+26
-26
sql/unireg.h
sql/unireg.h
+3
-2
No files found.
sql/slave.cc
View file @
683a46a3
...
...
@@ -909,37 +909,37 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
// sanity check to make sure the master did not get a really bad
// error on the query
if
(
!
check_expected_error
(
thd
,
(
expected_error
=
qev
->
error_code
)))
if
(
!
check_expected_error
(
thd
,
(
expected_error
=
qev
->
error_code
)))
{
mysql_parse
(
thd
,
thd
->
query
,
q_len
);
if
(
expected_error
!=
(
actual_error
=
thd
->
net
.
last_errno
)
&&
expected_error
)
{
mysql_parse
(
thd
,
thd
->
query
,
q_len
);
if
(
expected_error
!=
(
actual_error
=
thd
->
net
.
last_errno
)
&&
expected_error
)
{
const
char
*
errmsg
=
"Slave: did not get the expected error\
const
char
*
errmsg
=
"Slave: did not get the expected error\
running query from master - expected: '%s'(%d), got '%s'(%d)"
;
sql_print_error
(
errmsg
,
ER
(
expected_error
),
expected_error
,
actual_error
?
thd
->
net
.
last_error
:
"no error"
,
actual_error
);
thd
->
query_error
=
1
;
}
else
if
(
expected_error
==
actual_error
)
{
thd
->
query_error
=
0
;
*
last_slave_error
=
0
;
last_slave_errno
=
0
;
}
sql_print_error
(
errmsg
,
ER_SAFE
(
expected_error
),
expected_error
,
actual_error
?
thd
->
net
.
last_error
:
"no error"
,
actual_error
);
thd
->
query_error
=
1
;
}
else
// master could be inconsistent, abort and tell DBA to
// check/fix it
else
if
(
expected_error
==
actual_error
)
{
thd
->
db
=
thd
->
query
=
0
;
thd
->
convert_set
=
0
;
close_thread_tables
(
thd
);
free_root
(
&
thd
->
mem_root
,
0
);
delete
ev
;
return
1
;
thd
->
query_error
=
0
;
*
last_slave_error
=
0
;
last_slave_errno
=
0
;
}
}
else
{
// master could be inconsistent, abort and tell DBA to check/fix it
thd
->
db
=
thd
->
query
=
0
;
thd
->
convert_set
=
0
;
close_thread_tables
(
thd
);
free_root
(
&
thd
->
mem_root
,
0
);
delete
ev
;
return
1
;
}
}
thd
->
db
=
0
;
// prevent db from being freed
thd
->
query
=
0
;
// just to be sure
...
...
sql/unireg.h
View file @
683a46a3
...
...
@@ -37,8 +37,9 @@
#define SHAREDIR "share/"
#endif
#define ER(X) ((X) >= 1000 && (X) < ER_ERROR_MESSAGES + 1000) ? \
errmesg[(X)-1000] : "Invalid error code"
#define ER(X) errmesg[(X)-1000]
#define ER_SAFE(X) (((X) >= 1000 && (X) < ER_ERROR_MESSAGES + 1000) ? ER(X) : "Invalid error code")
#define ERRMAPP 1
/* Errormap f|r my_error */
#define LIBLEN FN_REFLEN-FN_LEN
/* Max l{ngd p} dev */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment