All Products
Document Center

Inaccurate query result returned by ApsaraDB for RDS for MySQL due to the Large Decimal Field

Last Updated: Jul 13, 2016


Currently, ApsaraDB for RDS for MySQL may return inaccurate query results because the decimal field is too large. This is a bug of MySQL.

The problem can be solved by adding indexes. Refer to the following solution for SQL:

create table mlgtestdecimal(`campaign_id` decimal(24,0) NOT NULL, name VARCHAR(50))

insert into mlgtestdecimal(campaign_id,name) VALUES('2016000000000000000088','1111111111');

insert into mlgtestdecimal(campaign_id,name) VALUES('2016000000000000000520','1111111111');

SELECT  * from mlgtestdecimal where campaign_id='2016000000000000000088'and name='1111111111'

alter table mlgtestdecimal add index ind_decimal  (`campaign_id`); 


If the problem persists, contact Alibaba Cloud After-Sales Technical Support.