Closed robins closed 2 years ago
Thank you for reporting this issue. I am able to reproduce this issue. We will try to fix this in the near future.
Hi @robins,
We have fixed this issue under commit - dc34c2d1a5dac0d4a5989a9240cdc0639975420c. Please check if that resolves the issue at your end and share the feedback. Thanks once again for reporting this.
Thanks @surajkharage19 . Looks good to me.
$ git log --oneline | head -1
dc34c2d Do not push expressions having mutable functions to the remote server.
mysql_fdw_sample=# explain SELECT ref_0.STATE
mysql_fdw_sample-# FROM PUBLIC.offices AS ref_0
mysql_fdw_sample-# WHERE pg_catalog.timeofday() IS NOT NULL limit 1;
QUERY PLAN
--------------------------------------------------------------------------------
Limit (cost=25.00..26.00 rows=1 width=118)
-> Foreign Scan on offices ref_0 (cost=25.00..1025.00 rows=1000 width=118)
Filter: (timeofday() IS NOT NULL)
Remote server startup cost: 25
(4 rows)
mysql_fdw_sample=# SELECT ref_0.STATE
FROM PUBLIC.offices AS ref_0
WHERE pg_catalog.timeofday() IS NOT NULL limit 1;
state
-------
CA
(1 row)
Issue: Postgres Volatile functions are getting pushed down to MySQL which obviously fail.
Expected: Ideally I'd expect Postgres Functions to not get pushed down (for EXPLAIN or for Query execution) to MySQL.
Notes:
Sample repro:
Detailed Repro: