MySQL Client out of memory when running a simple select query from MSSQL ODBC Table has a total of 1,120,000 rows and 20 columns. When I run a select query on mysql directly like:
select * from &lt;tablename&gt; where UpdatedOn &gt; '2020-10-05'

it gives the results which is about 50+ rows.
But when I run the same from MSSQL using ODBC Connection it throws &quot;MySQL Client Out of Memory&quot; every single time.

The server has 8 GB RAM and no one else is using the server
Running Select top gives the results without the error
Running select with a single integer column like select id from ... throws a &quot;MySQL Client out of memory&quot;

What could be going wrong? I haven't been able to the issue.
The comparison of datetime with a string may cause odbc to retrieve the entire table before eliminating rows.  Either compare with a datetime constant or set the prefetch parameter in the odbc config to a reasonable value.