Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Escaping.md #1501

Open
wants to merge 1 commit into
base: manticore-6.2.12
Choose a base branch
from

Conversation

Eclipsium
Copy link

add = symbol

Type of Change:

  • Documentation update

Description of the Change:

add = to escape symbol

add `=` symbol
@sanikolaev
Copy link
Collaborator

@Eclipsium Thank you for the PR. In what case does it help? For me it looks more like a bug, e.g.:

mysql> drop table if exists t; create table t(f text) charset_table='non_cjk, =' morphology='stem_en' index_exact_words='1'; show warnings; insert into t values(1, 'running'),(2, 'run'),(3, '=run'); select * from t where match('\\=run'); show meta;
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.01 sec)

--------------
create table t(f text) charset_table='non_cjk, =' morphology='stem_en' index_exact_words='1'
--------------

Query OK, 0 rows affected (0.02 sec)

--------------
show warnings
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
insert into t values(1, 'running'),(2, 'run'),(3, '=run')
--------------

Query OK, 3 rows affected (0.00 sec)

--------------
select * from t where match('\\=run')
--------------

+------+------+
| id   | f    |
+------+------+
|    2 | run  |
+------+------+
1 row in set (0.01 sec)

--------------
show meta
--------------

+----------------+-------+
| Variable_name  | Value |
+----------------+-------+
| total          | 1     |
| total_found    | 1     |
| total_relation | eq    |
| time           | 0.000 |
| keyword[0]     | =run  |
| docs[0]        | 1     |
| hits[0]        | 1     |
+----------------+-------+
7 rows in set (0.00 sec)

I would expect:

|    3 | =run  |

in this case, because = is in the charset_table and escaped.

The same with < instead of = works fine:

mysql> drop table if exists t; create table t(f text) charset_table='non_cjk, <' morphology='stem_en' index_exact_words='1'; show warnings; insert into t values(1, 'running'),(2, 'run'),(3, '<run'); select * from t where match('\\<run'); show meta;
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.01 sec)

--------------
create table t(f text) charset_table='non_cjk, <' morphology='stem_en' index_exact_words='1'
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
show warnings
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
insert into t values(1, 'running'),(2, 'run'),(3, '<run')
--------------

Query OK, 3 rows affected (0.00 sec)

--------------
select * from t where match('\\<run')
--------------

+------+------+
| id   | f    |
+------+------+
|    3 | <run |
+------+------+
1 row in set (0.00 sec)

--------------
show meta
--------------

+----------------+-------+
| Variable_name  | Value |
+----------------+-------+
| total          | 1     |
| total_found    | 1     |
| total_relation | eq    |
| time           | 0.000 |
| keyword[0]     | <run  |
| docs[0]        | 1     |
| hits[0]        | 1     |
+----------------+-------+
7 rows in set (0.00 sec)

So it seems to me that instead of merging the PR we need to file a bug report about it.

@sanikolaev sanikolaev added the waiting Waiting for the original poster (in most cases) or something else label Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Waiting for the original poster (in most cases) or something else
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants