1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-33281 Implement optimizer hints

Implementing a recursive descent parser for optimizer hints.
This commit is contained in:
Alexander Barkov
2024-06-21 12:26:28 +04:00
committed by Oleg Smirnov
parent 495d96709f
commit 6340c23933
15 changed files with 3604 additions and 16 deletions

View File

@@ -2730,8 +2730,10 @@ static bool add_line(String &buffer, char *line, size_t line_length,
break;
}
else if (!*in_string && inchar == '/' && *(pos+1) == '*' &&
!(*(pos+2) == '!' || (*(pos+2) == 'M' && *(pos+3) == '!')))
else if (!*in_string && inchar == '/' && pos[1] == '*' &&
!(pos[2] == '!' ||
(pos[2] == 'M' && pos[3] == '!') ||
pos[2] == '+'))
{
if (preserve_comments)
{
@@ -2768,8 +2770,8 @@ static bool add_line(String &buffer, char *line, size_t line_length,
}
else
{ // Add found char to buffer
if (!*in_string && inchar == '/' && *(pos + 1) == '*' &&
*(pos + 2) == '!')
if (!*in_string && inchar == '/' && pos[1] == '*' &&
(pos[2] == '!' || pos[2] == '+'))
ss_comment= 1;
else if (!*in_string && ss_comment && inchar == '*' && *(pos + 1) == '/')
ss_comment= 0;