summaryrefslogtreecommitdiff
path: root/extra/comp_err.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-12-18 17:50:09 +0100
committerSergei Golubchik <serg@mariadb.org>2019-12-21 10:34:02 +0100
commit3b654d54c1081ae9eab54bebe7093704749d31cf (patch)
tree5801f98cbd5a85112c46c4c67e66a95b867626e3 /extra/comp_err.c
parent9dadfdcde5a63a4d67f0f7a3720632bcb1d589d7 (diff)
downloadmariadb-git-3b654d54c1081ae9eab54bebe7093704749d31cf.tar.gz
longer regex error messages
Diffstat (limited to 'extra/comp_err.c')
-rw-r--r--extra/comp_err.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/extra/comp_err.c b/extra/comp_err.c
index a504832a60f..e6ea9acccb9 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -31,6 +31,7 @@
#include <m_string.h>
#include <my_getopt.h>
#include <my_dir.h>
+#include <ctype.h>
#define MAX_ROWS 3000
#define ERRORS_PER_RANGE 1000
@@ -749,18 +750,19 @@ static struct message *find_message(struct errors *err, const char *lang,
for the format specifiers
RETURN VALUE
- Returns the checksum for all the characters of the
+ Returns the checksum for all letters of the
format specifiers
Ex.
- "text '%-64.s' text part 2 %d'"
- ^^^^^^ ^^
+ "text '%-.64s' text part 2 %zu'"
+ ^ ^^
characters will be xored to form checksum
+ Non-letters are skipped, because they do not change the type
+ of the argument.
+
NOTE:
- Does not support format specifiers with positional args
- like "%2$s" but that is not yet supported by my_vsnprintf
- either.
+ Does not support format specifiers with positional args like "%2$s"
*/
static ha_checksum checksum_format_specifier(const char* msg)
@@ -777,20 +779,17 @@ static ha_checksum checksum_format_specifier(const char* msg)
start= p+1; /* Entering format specifier */
num_format_specifiers++;
}
- else if (start)
+ else if (start && isalpha(*p))
{
+ chksum= my_checksum(chksum, p, 1);
switch(*p) {
case 'd':
case 'u':
case 'x':
case 's':
case 'M':
- chksum= my_checksum(chksum, (uchar*) start, (uint) (p + 1 - start));
start= 0; /* Not in format specifier anymore */
break;
-
- default:
- break;
}
}