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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3b654d54
Commit
3b654d54
authored
Dec 18, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
longer regex error messages
parent
9dadfdcd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
23 deletions
+22
-23
extra/comp_err.c
extra/comp_err.c
+10
-11
mysql-test/main/func_regexp_pcre.result
mysql-test/main/func_regexp_pcre.result
+4
-4
mysql-test/main/func_regexp_pcre_debug.result
mysql-test/main/func_regexp_pcre_debug.result
+1
-1
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+7
-7
No files found.
extra/comp_err.c
View file @
3b654d54
...
...
@@ -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 charac
ters of the
Returns the checksum for all
let
ters 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
;
}
}
...
...
mysql-test/main/func_regexp_pcre.result
View file @
3b654d54
...
...
@@ -793,7 +793,7 @@ SELECT 'a\nb' RLIKE '(?-s)a.b';
0
SET default_regex_flags=DEFAULT;
SELECT REGEXP_SUBSTR('Monday Mon','^((?<DN>Mon|Fri|Sun)day|(?<DN>Tue)sday).*(?P=DN)$');
ERROR 42000:
Got error 'two named subpatterns have the same name (PCRE2_DUPNAMES not set' from regexp
ERROR 42000:
Regex error 'two named subpatterns have the same name (PCRE2_DUPNAMES not set) at offset 30'
SET default_regex_flags='DUPNAMES';
SELECT REGEXP_SUBSTR('Monday Mon','^((?<DN>Mon|Fri|Sun)day|(?<DN>Tue)sday).*(?P=DN)$');
REGEXP_SUBSTR('Monday Mon','^((?<DN>Mon|Fri|Sun)day|(?<DN>Tue)sday).*(?P=DN)$')
...
...
@@ -817,10 +817,10 @@ SELECT 'AB' RLIKE 'A# this is a comment\nB';
1
SET default_regex_flags=DEFAULT;
SELECT 'Aq' RLIKE 'A\\q';
ERROR 42000:
Got error 'unrecognized character follows \ at offset 2' from regexp
ERROR 42000:
Regex error 'unrecognized character follows \ at offset 2'
SET default_regex_flags='EXTRA';
SELECT 'Aq' RLIKE 'A\\q';
ERROR 42000:
Got error 'unrecognized character follows \ at offset 2' from regexp
ERROR 42000:
Regex error 'unrecognized character follows \ at offset 2'
SET default_regex_flags=DEFAULT;
SELECT 'a\nb\nc' RLIKE '^b$';
'a\nb\nc' RLIKE '^b$'
...
...
@@ -860,7 +860,7 @@ SELECT 0xE001 REGEXP @regCheck;
0xE001 REGEXP @regCheck
0
Warnings:
Warning 1139
Got error 'UTF-8 error: 1 byte missing at end' from regexp
Warning 1139
Regex error 'UTF-8 error: 1 byte missing at end'
# Testing workaround N1: This makes the pattern to be a binary string:
SET NAMES latin1;
SET @regCheck= X'E001';
...
...
mysql-test/main/func_regexp_pcre_debug.result
View file @
3b654d54
...
...
@@ -3,7 +3,7 @@ SELECT 'a' RLIKE 'a';
'a' RLIKE 'a'
0
Warnings:
Warning 1139
Got error 'pcre_exec: Internal error (-123)' from regexp
Warning 1139
Regex error 'pcre_exec: Internal error (-123)'
SET debug_dbug='';
SELECT 'a' RLIKE 'a';
'a' RLIKE 'a'
...
...
sql/share/errmsg-utf8.txt
View file @
3b654d54
...
...
@@ -3186,13 +3186,13 @@ ER_INVALID_USE_OF_NULL 22004
swe "Felaktig använding av NULL"
ukr "Хибне використання значення NULL"
ER_REGEXP_ERROR 42000
cze "Regulární výraz vrátil chybu
'%-.64s'
"
cze "Regulární výraz vrátil chybu
: %s
"
dan "Fik fejl '%-.64s' fra regexp"
nla "Fout '%-.64s' ontvangen van regexp"
eng "
Got error '%-.64s' from regexp
"
est "regexp tagastas vea
'%-.64s'
"
eng "
Regex error '%s'
"
est "regexp tagastas vea
: %s
"
fre "Erreur '%-.64s' provenant de regexp"
ger "
regexp lieferte Fehler '%-.64s'
"
ger "
Regexp Fehler %s
"
hindi "regexp में '%-.64s' त्रुटि हुई"
hun "'%-.64s' hiba a regularis kifejezes hasznalata soran (regexp)"
ita "Errore '%-.64s' da regexp"
...
...
@@ -3200,11 +3200,11 @@ ER_REGEXP_ERROR 42000
kor "regexp에서 '%-.64s'가 났습니다."
por "Obteve erro '%-.64s' em regexp"
rum "Eroarea '%-.64s' obtinuta din expresia regulara (regexp)"
rus "
Получена ошибка '%-.64s' от регулярного выражения
"
serbian "Funkcija regexp je vratila grešku
'%-.64s'
"
rus "
Ошибка регулярного выражения: %s
"
serbian "Funkcija regexp je vratila grešku
: %s
"
spa "Obtenido error '%-.64s' de regexp"
swe "Fick fel '%-.64s' från REGEXP"
ukr "
Отримано помилку '%-.64s' від регулярного виразу
"
ukr "
Помилка регулярного виразу: %s
"
ER_MIX_OF_GROUP_FUNC_AND_FIELDS 42000
cze "Pokud není žádná GROUP BY klauzule, není dovoleno současné použití GROUP položek (MIN(),MAX(),COUNT()...) s ne GROUP položkami"
dan "Sammenblanding af GROUP kolonner (MIN(),MAX(),COUNT()...) uden GROUP kolonner er ikke tilladt, hvis der ikke er noget GROUP BY prædikat"
...
...
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