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

why the operator "ID=999999999999999999999999" cannot get the result , when query on the numeric(24,0) column ? #263

Open
tigerzhangyz opened this issue Sep 29, 2020 · 2 comments

Comments

@tigerzhangyz
Copy link

tigerzhangyz commented Sep 29, 2020

CentOS Linux release 7.8.2003 (Core)
psql (PostgreSQL) 12.4

this is tidb database origin data:
`
mysql> create table testzyz(ID numeric(24,0) NOT NULL COMMENT '关联ID' ,primary key(id));
Query OK, 0 rows affected (0.52 sec)

mysql> insert into testzyz values(999999999999999999999999);;
Query OK, 1 row affected (0.01 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from testzyz;
+----+
| ID |
+----+
| 999999999999999999999999 |
+----+
1 row in set (0.00 sec)
`

this is FDW data:
`
drop SERVER alchemy_srv cascade;
CREATE SERVER alchemy_srv foreign data wrapper multicorn options (
wrapper 'multicorn.sqlalchemyfdw.SqlAlchemyFdw'
);
drop foreign table MTCTIDBtestzyz;
create foreign table MTCTIDBtestzyz (
id numeric(24,0) NOT NULL
) server alchemy_srv options (
tablename 'testzyz',
primary_key 'id',
db_url 'mysql://root:@xxxx:4000/cloud'
);
CREATE FOREIGN TABLE
fdwzyz=# select * from MTCTIDBtestzyz;
id

999999999999999999999999
(1 row)
fdwzyz=# select * from MTCTIDBtestzyz where id=999999999999999999999999;
id

(0 rows)
`

@tigerzhangyz tigerzhangyz changed the title why the operator "ID=9" cannot get the result, but "ID>=9 and ID<=9" get result, on the int column ? why the operator "ID=9" cannot get the result, but "ID>=9 and ID<=9" get result, when query on the int column ? Sep 29, 2020
@tigerzhangyz tigerzhangyz changed the title why the operator "ID=9" cannot get the result, but "ID>=9 and ID<=9" get result, when query on the int column ? why the operator "ID=9" cannot get the result, but "ID>=9 and ID<=9" get result, when query tidb database(same as mysql server) on the int column ? Sep 29, 2020
@tigerzhangyz tigerzhangyz changed the title why the operator "ID=9" cannot get the result, but "ID>=9 and ID<=9" get result, when query tidb database(same as mysql server) on the int column ? why the operator "ID=999999999999999999999999" cannot get the result , when query on the numeric(24,0) column ? Sep 29, 2020
@rdunklau
Copy link
Contributor

Hello,

Can you log the query as it is executed on the MySQL side ?

@tigerzhangyz
Copy link
Author

Hello,

Can you log the query as it is executed on the MySQL side ?

I get it,the SQL change in mysql general log, but why?

2020-09-29T15:23:10.711034+08:00 26 Query SELECT testzyz.id
FROM testzyz
WHERE testzyz.id = 1e+24
2020-09-29T15:23:10.712026+08:00 26 Query commit

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

No branches or pull requests

2 participants