tds-fdw / tds_fdw

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

Crash when used together with postgres_fdw on 9.5 #128

Closed ants closed 6 years ago

ants commented 7 years ago

The global symbol deparseSelectSql and some others confict with postgres_fdw on 9.5. This results in crashes if both extensions are used in a single backend. On 9.6+ the function is made static by an unrelated change so the symbol is no longer exported and the issue goes away.

Simplest solution would be to rename the symbol so they no longer conflict. Here's the full list of conflicting symbols:

appendWhereClause
classifyConditions
deparseAnalyzeSizeSql
deparseAnalyzeSql
deparseDeleteSql
deparseInsertSql
deparseSelectSql
deparseStringLiteral
deparseUpdateSql
is_foreign_expr

The symbols are only exported because that's the default behavior with C and shared objects. They don't need to be visible to PostgreSQL. So the simpler option would be to make the symbols hidden. I guess the best way is to make hidden the default and then explicitly mark the symbols that need to be exported.