Geoff Montee

Results 102 comments of Geoff Montee

All tests seem to be passing on Jenkins at the moment, including the new ones that I just added to test NULL timestamps: https://jenkins-juliogonzalez.rhcloud.com/job/tds_fdw-build/102/ I'd like to see the definition...

As a test, I created a table with a NULL varchar value on the foreign table: ``` CREATE TABLE dbo.null_varchar ( id int primary key, value varchar(50) ); INSERT INTO...

As another test, I tried an empty string in MS SQL Server: ``` CREATE TABLE dbo.empty_varchar ( id int primary key, value varchar(50) ); INSERT INTO dbo.empty_varchar (id, value) VALUES...

Ah, my mistake. I wasn't aware that MS SQL Server had a `timestamp` type, because it wasn't listed under "Date and Time" types [here](https://msdn.microsoft.com/en-us/library/ms187752.aspx). I see now that it is...

I can confirm that a NULL `timestamp` value from MS SQL Server is not treated as NULL when cast to a PostgreSQL `timestamp`. On MS SQL Server: ``` CREATE TABLE...

I wonder if MS SQL Server's `timestamp` type doesn't satisfy the typical NULL checks [here](https://github.com/GeoffMontee/tds_fdw/blob/5ab27f02b3096463e5b31737abd184692b4293d4/src/tds_fdw.c#L1541). According to the documentation, `timestamp`/`rowversion` should be equivalent to `varbinary(8)`, so I should check whether...

Hmm, `tds_fdw` has no problem with a NULL `varbinary(8)` field, so that probably isn't the problem. MS SQL Server: ``` CREATE TABLE dbo.null_varbinary ( id int primary key, value varbinary(8)...

I uncommented the `DEBUG` macro, then rebuilt `tds_fdw`, and then ran some more tests. It looks like FreeTDS says the `timestamp` column has type `SYBBINARY` (represented as type "45"), so...

With a NULL `binary(8)` or `varbinary(8)` column, FreeTDS reports the length as 0. But for some reason, with a NULL `timestamp` / `rowversion` field, FreeTDS reports the length as 8....

I asked about this on the [FreeTDS mailing list](http://lists.ibiblio.org/pipermail/freetds/2016q1/029718.html).