I am trying to run a query that joins a products table on one db server again a order_items table in schema B on another db server like so (both are mysql databases)
select a.sku, sum(b.price) from db1.catalog.products as a join db2.sales.order_items as b on b.product_id = a.id group by a.sku
The price column is a decimal (10,2) but the result set contains values like 12.899999999909 which the expected value is actually 12.9. I know this because the two servers are simply read replicas from a master and hence contain the same data.
When I run this query replacing db1 with db2 (or vice-versa) the results returned are exact and as expected.
Is there something I am doing wrong or missing?