Skip to content

Commit a28c1d1

Browse files
Adapt to new regexp format for MySQL
1 parent 191423c commit a28c1d1

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

DocDB/cgi/DocDBGlobals.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
$TRUE = 1;
3030
$FALSE = 0;
31+
$MySQLVersion = 8;
3132

3233
# Advertising link for DocDB
3334

DocDB/cgi/SearchAtoms.pm

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,21 @@ sub RegExpSearchAtom {
113113
}
114114

115115
if ($RequireWord) {
116-
$RegExpAtom .= '[[:<:]]';
116+
if $MySQLVersion < 8 {
117+
$RegExpAtom .= '[[:<:]]';
118+
} else {
119+
$RegExpAtom .= '\\b';
120+
}
117121
}
118122
$RegExpAtom .= '(';
119123
$RegExpAtom .= join '|', @RegExpParts;
120124
$RegExpAtom .= ')';
121125
if ($RequireWord) {
122-
$RegExpAtom .= '[[:>:]]';
126+
if $MySQLVersion < 8 {
127+
$RegExpAtom .= '[[:>:]]';
128+
} else {
129+
$RegExpAtom .= '\\b';
130+
}
123131
}
124132

125133
my $SafeAtom = $dbh->quote($RegExpAtom);

0 commit comments

Comments
 (0)