Skip to content

Filtering numbers by string and strings by numbers do not match MySql behavior #9739

@angelamayxie

Description

@angelamayxie

Related to comment here.

Related to #9733

dolt

tmp/main*> create table test01(pk varchar(20) primary key);
Query OK, 0 rows affected (0.01 sec)
tmp/main*> insert into test01 values ("11d"),("11wha?"),("11"),("12");
Query OK, 4 rows affected (0.01 sec)
tmp/main*> select * from test01 where pk in ("11");
+----+
| pk |
+----+
| 11 |
+----+
1 row in set (0.00 sec) 


tmp/main*> select * from test01 where pk in (11);
+----+
| pk |
+----+
| 11 |
+----+
1 row in set (0.00 sec) 

mysql

mysql> create table test01(pk varchar(20) primary key);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into test01 values("11d"),("11wha?"),("11"),("12");
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> select * from test01 where pk in ("11");
+----+
| pk |
+----+
| 11 |
+----+
1 row in set (0.00 sec)

mysql> select * from test01 where pk in (11);
+--------+
| pk     |
+--------+
| 11     |
| 11d    |
| 11wha? |
+--------+
3 rows in set, 2 warnings (0.00 sec)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcorrectnessWe don't return the same result as MySQLsqlIssue with SQL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions