chaisql / chai

Modern embedded SQL database
MIT License
1.56k stars 95 forks source link

The `=` conditional expression execution returns the result of the `LIKE` expression #458

Closed startan closed 2 years ago

startan commented 2 years ago

What version of Genji are you using?

$ genji version
Genji v0.14.1
Genji CLI v0.14.2

What did you do?

The following TABLE is created.

CREATE SEQUENCE IF NOT EXISTS seq_cizu;
CREATE TABLE IF NOT EXISTS cizu (
  id INTEGER NOT NULL DEFAULT (NEXT VALUE FOR seq_cizu),
  ci TEXT NOT NULL,
  explanation TEXT NOT NULL,
  PRIMARY KEY (id)
);
CREATE INDEX IF NOT EXISTS IDX_CI ON cizu(ci);

The following SQL was executed

SELECT * from cizu where ci ='飞云';

What did you expect to see?

Expect to return an empty result set because there are no eligible records.

What did you see instead?

The = conditional expression execution returns the result of the LIKE expression

genji> SELECT * from cizu where ci ='飞云';
{
  "ci": "飞云丹",
  "explanation": "1.粉名。",
  "id": 62619
}
{
  "ci": "飞云履",
  "explanation": "1.相传为唐白居易居庐山草堂时自制鞋的名称。",
  "id": 62621
}
{
  "ci": "飞云掣电",
  "explanation": "1.形容非常迅速。",
  "id": 62618
}
{
  "ci": "飞云殿",
  "explanation": "1.指高耸入云的城楼。",
  "id": 62620
}
asdine commented 2 years ago

Thanks @startan! I can confirm that this issue no longer exists on the dev branch, the release will be published soon.