Multiple MSSQL Fixes

Issue #581 resolved
paj created an issue

It's been a little while since I've done this, but here are some MSSQL fixes.

mssql-fixes.patch does four things:

    MSNVarchar now derives from types.Unicode
    set identity_insert now works on tables with schemas
    scope_identity - now defaults to True only for pymssql; False otherwise
    new unit test: len(unistr) == db.func.length(unistr)

Comments (12)

  1. paj reporter

    I have had problems inserting dates when the database user's locale is set to "British English". We do our dates the right way round, unlike Americans ;-)

    This is only a problem because the dates were being converted to strings. There was no need for this; mssql-date.patch tidies up date handling. I've introduced a new unit test and this works for pyodbc/adodbapi and pymssql.

    The new test has uncovered a minor bug in sqlite support, for which a patch is also supplied.

  2. paj reporter

    Ok, hold on mssql-date.patch for now, I've just noticed it causing a test failure. I'll see if I can fix it now, but it's getting late :-)

  3. paj reporter

    Ok, I've fixed it, wasn't tricky in the end. I guess this is quite enough for you to be getting on with. With all these patches, unit tests now report:

    FAILED (failures=1, errors=2)

    One of these is the scope_identity issue, which needs pyodbc changes. The other two should be fixable.

  4. Log in to comment