mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
Only add Error_no to event if there is one. Don't stringify it either; set its type in pqd.
This commit is contained in:
@@ -14591,6 +14591,7 @@ sub main {
|
||||
Last_errno => 'string',
|
||||
Thread_id => 'string',
|
||||
InnoDB_trx_id => 'string',
|
||||
Error_no => 'string',
|
||||
Killed => 'bool',
|
||||
};
|
||||
|
||||
|
@@ -654,11 +654,14 @@ sub _packet_from_server {
|
||||
}
|
||||
|
||||
$event = {
|
||||
cmd => $com,
|
||||
arg => $arg,
|
||||
ts => $packet->{ts},
|
||||
Error_no => $error->{errno} ? "#$error->{errno}" : 'none',
|
||||
cmd => $com,
|
||||
arg => $arg,
|
||||
ts => $packet->{ts},
|
||||
};
|
||||
if ( $error->{errno} ) {
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/823411
|
||||
$event->{Error_no} = $error->{errno};
|
||||
}
|
||||
$session->{attribs}->{Error_msg} = $error->{message};
|
||||
return $self->_make_event($event, $packet, $session);
|
||||
}
|
||||
|
@@ -177,7 +177,7 @@ test_protocol_parser(
|
||||
pos_in_log => 0,
|
||||
bytes => length('select 5 from foo'),
|
||||
cmd => 'Query',
|
||||
Error_no => "#1046",
|
||||
Error_no => "1046",
|
||||
Error_msg => 'No database selected',
|
||||
Rows_affected => 0,
|
||||
Warning_count => 0,
|
||||
@@ -1659,7 +1659,7 @@ test_protocol_parser(
|
||||
[
|
||||
{
|
||||
Error_msg => "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1",
|
||||
Error_no => '#1064',
|
||||
Error_no => '1064',
|
||||
No_good_index_used => 'No',
|
||||
No_index_used => 'No',
|
||||
Query_time => '0.000316',
|
||||
@@ -1679,7 +1679,7 @@ test_protocol_parser(
|
||||
},
|
||||
{
|
||||
Error_msg => 'Unknown system variable \'nono\'',
|
||||
Error_no => '#1193',
|
||||
Error_no => '1193',
|
||||
No_good_index_used => 'No',
|
||||
No_index_used => 'No',
|
||||
Query_time => '0.000329',
|
||||
|
Reference in New Issue
Block a user