[
https://issues.apache.org/jira/browse/IOTDB-4236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17596927#comment-17596927
]
liaolanyu commented on IOTDB-4236:
----------------------------------
Thanks for your detailed description. I tried to fixed this in the PR linked to
this issue. Could you please retry this in master again?
> BackSlash in where clause may cause parse error in IoTDB-0.14.0-SNAPSHOT
> -------------------------------------------------------------------------
>
> Key: IOTDB-4236
> URL: https://issues.apache.org/jira/browse/IOTDB-4236
> Project: Apache IoTDB
> Issue Type: Bug
> Affects Versions: 0.14.0-SNAPSHOT
> Environment: Windows 10
> Reporter: Tao Yi
> Assignee: liaolanyu
> Priority: Minor
> Labels: pull-request-available
> Attachments: image-2022-08-25-14-52-04-762.png,
> image-2022-08-25-14-53-28-766.png, image-2022-08-25-14-58-21-111.png,
> image-2022-08-25-15-11-13-743.png, image-2022-08-28-11-16-09-353.png,
> image-2022-08-28-11-17-40-173.png
>
>
> I try to execute 2 queries in IoTDB-client in IoTDB-0.14.0-SNAPSHOT
> new-server, whose meanings are the same , only changing the order, but one
> can execute successfully, while another one failed with msg 401: Error
> occurred while parsing SQL to physical plan: line 1:64 token recognition
> error at: '''
> select code from root.sg1.d1 where code == 'asdf' or code == '\\';
> (SUCCESS)
> select code from root.sg1.d1 where code == '\\' or code == 'asdf';
> (ERROR 401)
> I also try other examples, and it can accept the clause contains backslash
> while it appears alone in the where clause, or there is only backslashes in
> the final clause of the where clause, other situations will get error. So I
> guess that is the backslash in the not final clause will cause this error.
> As a comparison, I try to run
> select code from root.sg1.d1 where code == '\\' or code == 'asdf';
> in IoTDB 0.13.2-SNAPSHOT, It can return result correctly. So I think it's a
> bug only for 0.14.0.
> This is the total statements I executed in IoTDB-0.14.0-SNAPSHOT new-server:
> create timeseries root.sg1.d1.code with datatype=TEXT, encoding=plain;
> insert into root.sg1.d1(timestamp, code) values(1, '\\');
> insert into root.sg1.d1(timestamp, code) values(2, 'asdf');
> select code from root.sg1.d1 where code == 'asdf' or code == '\\';
> select code from root.sg1.d1 where code == '\\' or code == 'asdf';
> select code from root.sg1.d1 where code in ('asdf', '\\');
> select code from root.sg1.d1 where code in ('\\', 'asdf');
>
> The result in 0.14.0-SNAPSHOT:
> !image-2022-08-25-14-52-04-762.png|width=1010,height=804!
> The error log in IoTDB:
> !image-2022-08-25-14-53-28-766.png|width=1101,height=569!
> The same query in 0.13.2-SNAPSHOT
> !image-2022-08-25-14-58-21-111.png|width=828,height=685!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)