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

MDEV-32986 Make regexp operator work in spider group by handler

In spider_db_mbase_util::print_item_func(), if the sql item_func has
an UNKNOWN_FUNC type, by default the spider group by handler (gbh)
transform infix to prefix. But regexp should remain infix, so we add
an if condition to account for this.
This commit is contained in:
Yuchen Pei
2023-12-13 14:43:41 +11:00
parent 96e49c76a8
commit c73417c68e
3 changed files with 62 additions and 6 deletions

View File

@@ -5856,12 +5856,17 @@ int spider_db_mbase_util::print_item_func(
item_count -= 2;
break;
}
} else if (func_name_length == 6 &&
!strncasecmp("istrue", func_name, func_name_length)
) {
last_str = SPIDER_SQL_IS_TRUE_STR;
last_str_length = SPIDER_SQL_IS_TRUE_LEN;
break;
} else if (func_name_length == 6)
{
if (!strncasecmp("istrue", func_name, func_name_length))
{
last_str= SPIDER_SQL_IS_TRUE_STR;
last_str_length= SPIDER_SQL_IS_TRUE_LEN;
break;
}
else if (!strncasecmp("regexp", func_name, func_name_length))
/* Keep the infix expression */
break;
} else if (func_name_length == 7)
{
if (!strncasecmp("isfalse", func_name, func_name_length))