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

Allow spaces after comma in fieldlist #1930

Open
cappadaan opened this issue Mar 9, 2024 · 1 comment
Open

Allow spaces after comma in fieldlist #1930

cappadaan opened this issue Mar 9, 2024 · 1 comment
Assignees

Comments

@cappadaan
Copy link

This:

@(title, body)

gives a fatal error, because only this is allowed

@(title,body)

This is very unintuitive and it is also not consistent with SQL, where adding spaces after field names does work (eg in insert queries).

Request to allow spaces after field names.

@sanikolaev
Copy link
Collaborator

Some notes:

W/o a document in the table there's no error:

mysql> drop table if exists t; create table t(f text, f2 text); select * from t where match('@(f, f2) abc');
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
create table t(f text, f2 text)
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
select * from t where match('@(f, f2) abc')
--------------

Empty set (0.00 sec)
--- 0 out of 0 results in 1ms ---

MRE:

mysql> drop table if exists t; create table t(f text, f2 text); insert into t values(1, 'abc', 'def'); select * from t where match('@(f, f2) abc'); select * from t where match('@(f,f2) abc');
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
create table t(f text, f2 text)
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
insert into t values(1, 'abc', 'def')
--------------

Query OK, 1 row affected (0.00 sec)

--------------
select * from t where match('@(f, f2) abc')
--------------

ERROR 1064 (42000): table t: query error: error parsing field list: invalid field block operator syntax near ' f2) abc'
--------------
select * from t where match('@(f,f2) abc')
--------------

+------+------+------+
| id   | f    | f2   |
+------+------+------+
|    1 | abc  | def  |
+------+------+------+
1 row in set (0.01 sec)
--- 1 out of 1 results in 3ms ---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants