tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
377 stars 101 forks source link

EXPLAIN (VERBOSE) shows remote query #282

Closed laurenz closed 3 years ago

laurenz commented 3 years ago

There is already a tdsExplainForeignScan, but it does nothing.

I think seeing the remote query would make debugging easier.

jenkins-juliogonzalez commented 3 years ago

Can one of the admins verify this patch?

juliogonzalez commented 3 years ago

Test this, please

jenkins-juliogonzalez commented 3 years ago

Test PASSed.

GeoffMontee commented 3 years ago

Thanks for the contribution!

laurenz commented 3 years ago

Thanks for the quick action!

I had considered adding something to the test suite, but I couldn't get it to run. Does it require Python v2? Unfortunately I don't know Python well.

With Python v3, running mssql-tests.py gets me

[ERROR] cannot use a string pattern on a bytes-like object

in function version_to_array in lib/tests.py.

juliogonzalez commented 3 years ago

@laurenz that's right, I still need to port the scripts to python3, while still maintaining the compatibility with python2 (because of CentOS7).

I will need to do it soon, anyway, as we should consider keeping "CentOS7" as the "old system", while bumping our tests maybe Ubuntu 20.04 or 22.04 (as they ship python3 by default IIRC).

juliogonzalez commented 3 years ago

Meanwhile you can consider https://pythonbasics.org/virtualenv/ to run the tests, if your OS doesn't provide python2 anymore.

laurenz commented 3 years ago

Thanks for the pointers. I have added tests for my latest patches. They run, but I think that the output is not checked, right?

juliogonzalez commented 3 years ago

They run, but I think that the output is not checked, right?

That's right, at this moment the tests are only checking the results if the SQL commands via the SQL connection.

I guess somehow we could check the output, of course. It would be useful in cases such as this one.