snikolaev@dev:~$ mysql -P9306 -h0 -v
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 27
Server version: 4.2.0 15e927b@211223 release (columnar 1.11.4 327b3d4@211223) git branch HEAD (no branch)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Reading history-file /home/snikolaev/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> drop table if exists t; create table t(f1 text, f2 text); insert into t values(0,'b', 'c x'); select snippet(f1, query()), snippet(f2, query()) from t where match('@f1 b @f2 x');
--------------
drop table if exists t
--------------
Query OK, 0 rows affected (0.13 sec)
--------------
create table t(f1 text, f2 text)
--------------
Query OK, 0 rows affected (0.00 sec)
--------------
insert into t values(0,'b', 'c x')
--------------
Query OK, 1 row affected (0.00 sec)
--------------
select snippet(f1, query()), snippet(f2, query()) from t where match('@f1 b @f2 x')
--------------
+----------------------+----------------------+
| snippet(f1, query()) | snippet(f2, query()) |
+----------------------+----------------------+
| b | c x |
+----------------------+----------------------+
1 row in set (0.01 sec)
It may be a bug or non-documented limitation of snippet() or query. It’s better to create an issue on github and with the above MRE.