Unit tests fail for MSSQL/adodbapi

Issue #422 resolved
paj created an issue

A lot of the unit tests fail for MSSQL with adodbapi. I intend to gradually submit patches until they all pass.

Comments (12)

  1. paj reporter

    The first patch modifies the test scripts to pass auto_identity_insert=True to create_engine. This involved a bit of refactoring of the code, but only touches the test scripts, not SA. With my fix for #415 also applied, all the tests in engine/transaction.py now pass (previously most failed).

  2. paj reporter
    • changed status to open
    • removed status

    Ok, I have now prepared another patch, which fixes three tests in the engine directory. Now all but one of these pass! The patch makes the following changes:

    MSNumeric now supports columns that don't specify precision. MSSQLSchemaGenerator now only creates at most one implicit sequence on a table, as MSSQL only supports a single IDENTITY column. ReflectionTest.testmultipk now only specifies an explicit sequence for a single column. MSSQLDialect.reflecttable now uses the key_column_usage table to reflect foreign keys, so composite keys are supported reliably. It also checks the table schema. ClauseList.compare now compares in an order-insensitive manner.

  3. paj reporter

    Looking at Michael's comments on the list:

    Oh dear! I seem to have made a bit of a hash of this. Most of your comments relate to patch 1, which has actually already been committed. The other controversial bit was the change to ClauseList.compare. What I've done is roll up patches 2,3 and removed the controversial change. Please can you ignore patches 1,2,3 and consider committing patch 4. When I get a chance, I will submit a patch to fix the changes in patch 1 that you don't like.

    Regarding making ClauseList.compare order insensitive, this isn't important to me, I can recode the unit test to fix this another way. My logic is that this clause: a.a = b.a and a.b = b.b is logically identical to: a.b = b.b and a.a = b.a However, the compare function was showing them to be different. Perhaps changing ClauseList.compare like that is too sweeping. Instead, maybe we could change CompoundClause.compare, so that if the operator is commutative (e.g. 'and', 'or') then it does an order insensitive compare.

  4. paj reporter

    Ok, and here is the patch to revert mssql-test1.patch. It also adds the ability to pass the auto_identity_insert parameter in the URL.

  5. Log in to comment