keboola / db-extractor-mssql

MIT License
1 stars 2 forks source link

PDO fallback fails if converted column is used #122

Closed tomasfejfar closed 5 years ago

tomasfejfar commented 5 years ago

In PDO, when converting timestamp like this: CONVERT(NVARCHAR(MAX), CONVERT(BINARY(8), [timestamp]), 1), it's name is not preserved and it appears in resulting rowset as COLUMN1. If it's used for incremental fetching, a check fails as the column "timestamp" is not present in the resultset, instead "COLUMN1" is there.

https://github.com/keboola/db-extractor-common/blob/master/src/Keboola/DbExtractor/Extractor/Extractor.php#L307-L317

This is not an issue in BCP where columns are number-indexed.