Skip to content

Commit

Permalink
Bug#30810629 - CONTRIBUTION BY FACEBOOK: BETTER ERROR IN COMP_ERR WIT…
Browse files Browse the repository at this point in the history
…H BLANK SPACE ONLY LINES

Description  provided by Facebook:

The following error message was not formatted well:
"Failed to parse message string for error 'ER_UNSUPPORTED_COLLATION'Failed
to parse input file ..."
Use case:
Makes it easier to identify issues in errmsg-utf8.txt

Solution:
Add a new line when printing using parse_message_string().

Thanks to Facebook for this contribution. fbcontrib_admin@mysql.com

Change-Id: I3e1e823a0c778d4a5063a2a2e301e7fed327a707
  • Loading branch information
jensevenb committed Mar 6, 2020
1 parent 3d61798 commit be5d46e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utilities/comp_err.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down Expand Up @@ -1180,6 +1180,7 @@ static struct message *parse_message_string(struct message *new_message,

if (!*str) {
/* It was not a message line, but an empty line. */
fprintf(stderr, "No error message was found on line.\n");
DBUG_PRINT("info", ("str: %s", str));
return nullptr;
}
Expand All @@ -1197,7 +1198,7 @@ static struct message *parse_message_string(struct message *new_message,
while (*str == ' ' || *str == '\t' || *str == '\n') str++;

if (*str != '"') {
fprintf(stderr, "Unexpected EOL");
fprintf(stderr, "Unexpected EOL.\n");
DBUG_PRINT("info", ("str: %s", str));
return nullptr;
}
Expand Down

0 comments on commit be5d46e

Please sign in to comment.