Relationships on non-Integer fields fail under MSSQL

Issue #473 resolved
paj created an issue

Using MSSQL, relationships on String fields don't work - the relationship always returns an empty list. I am attaching a minimal test case that demonstrates this. The same test case works correctly using SQLite.

Comments (9)

  1. paj reporter

    On further investigation, this appears to be a problem with adodbapi. adodbapi is returning no rows from the query, when it ought to!

    I notice the query is constructed "... WHERE ? = contact.tsrid ..." Manually recoding it as "... WHERE contact.tsrid = ? ..." fixes the problem.

    So potentially SA could have a workaround for this issue, but I am going to see if I can fix adodbapi first.

  2. paj reporter

    It doesn't look like a problem with adodbapi per-se; seems ADO doesn't like the bind parameter being on the left hand side. I will have a go at recoding MSSQLSchemaGenerator to stop this happening.

  3. Log in to comment