Commits on Mar 1, 2017
  1. Work around (apparent) Python bug for issue #206

    mkleehammer committed Mar 1, 2017
    It looks like PyCodec_Encode can set an extraneous exception even when it works.  (It should
    return 0 if it fails.)  This causes Cursor.fetchall() to fail since it looks for exceptions.
    Fixes #206
  2. Add more decimal, money, and numeric tests for PostgreSQL and SQL Server

    mkleehammer committed Mar 1, 2017
    I am trying to reproduce issue #207 but have not been able to.
Commits on Feb 26, 2017
  1. Adding AppVeyor support for Windows builds.

    mkleehammer committed Feb 26, 2017
  2. Switch to Travis-CI without sudo for faster tests.

    mkleehammer committed Feb 26, 2017
Commits on Feb 25, 2017
  1. Add Travis-CI build support.

    mkleehammer committed Feb 25, 2017
  2. Fix 2.7 build error.

    mkleehammer committed Feb 25, 2017
    The generated Object ctor was being used in 2.7 builds.  Now that it is private (because it
    shouldn't be used) we get a build error.
  3. New pyodbc.drivers() buffer too small.

    mkleehammer committed Feb 25, 2017
    The new drivers() implementation used SQL_MAX_DSN_LENGTH, which seems reasonable but is
    entirely too small.  Changed to a 500-character buffer.  Also fixed a couple of potential leaks
    in that code during exception handling.
    Fixes #202
  4. Ignore varchar max sizes that are too small / negative.

    mkleehammer committed Feb 25, 2017
    Fixes #201.  It didn't occur to me that some drivers might return a *negative* maximum varchar
    size, such as FileMaker.  In hindsight, -1 is sometimes used, such as SQL Server's
    varchar(max) precision.
  5. Fix some instances where Object wrapper copy ctor was being used.

    mkleehammer committed Feb 24, 2017
    I never intended for the Object copy ctor to be used and originally had it private.  I removed
    it when a version of GCC failed to compile, but I've now put it back since it caused some
    over decrementing.  I believe the GCC issue might have been because I didn't provide a body
    for them (which used to work).
    @dgsb provided a pull request for this months ago but I unwisely put it off because of the GCC
    issue.  Unfortunately I put it off long enough that it didn't merge cleanly.
    Closes #199 and #142
Commits on Feb 19, 2017
  1. Update previous change for Windows.

    mkleehammer committed Feb 19, 2017
    I tried to be too clever and quoted something for the shell that didn't need to be quoted.
  2. Merge pull request #139 from sgivens0/fixingHomeDirBrew

    mkleehammer committed Feb 19, 2017
    adding homedir brew as a possible path
  3. Added drivers() function to the pyodbc module to get a list of the re…

    Sergio de la Cruz authored and mkleehammer committed Dec 7, 2012
    …gistered ODBC drivers
    (cherry picked from commit 292505b)
  4. Add support for UUID. Fixes #177

    mkleehammer committed Feb 5, 2017
    Accept UUID objects as parameters.  If pyodbc.native_uuid is True, return SQL_GUID columns
    as UUID objects.  If False, the default for backwards compatibility, return them as Unicode
Commits on Feb 18, 2017
  1. Consolidate all documentation in the Wiki.

    mkleehammer committed Feb 18, 2017
    This updates the pyodbc site to point to the Wiki.  Fixes #185
Commits on Feb 17, 2017
  1. Encoding SQL type wasn't used when passing parameter.

    mkleehammer committed Feb 17, 2017
    The encoding itself was used, but the ctype was hardcoded to SQL_WVARCHAR.
    Fixes #195
  2. Changes for MS Access: use int instead of bigint; maxlength not set; …

    mkleehammer committed Feb 17, 2017
    …add int tests
    MS Access does not support BIGINT but the Python 3 build was using it exclusively.  It now uses
    regular int when possible.
    Since I modified the handling of Python longs, I added more tests to PostgreSQL and MySQL.
    For some reason I could not reuse the HSTMT for multiple calls to SQLGetTypeInfo for
    determining the maximum write size so I've changed it to allocate a new HSTMT for each.  This
    makes it work by default for Access, but PostgreSQL reports a maximum write size of 255 which
    is ridiculous and requires a manual override, documented in the Wiki.
    Fixes #84
Commits on Feb 16, 2017
  1. Add UTF-32 hack for iODBC + Teradata.

    mkleehammer committed Feb 16, 2017
    I'm not sure if the issue is iODBC (which Apple doesn't ship anymore) is using a 4-byte
    SQLWCHAR or if Teradata is returning UCS4/UTF-32LE for column names in SQLDescribeColW.  Either
    way I've added a hack that assumes 4-byte chars if the decoding for SQL_WMETADATA (a pyodbc
    specific constant) is set to any of the UTF-32 encodings.  The encoding is then actually used.
        cnxn.setdecoding(pyodbc.SQL_WMETADATA, encoding='utf-32le')
    Fixes #194
Commits on Feb 13, 2017
Commits on Feb 11, 2017
  1. Change fatal errors to runtime errors.

    mkleehammer committed Feb 11, 2017
    If important items failed during module initialization, Py_FatalError was raised which would
    apparently cause a core dump.  This has been "softened" to raise a simple error which will
    cause the import to fail but allow the calling code to continue.  Fixes #188.
  2. Fix decoding of Cursor.description column names.

    mkleehammer committed Feb 11, 2017
    Fixes #190 - The issue was a column alias with an i with acute which caused an error.  pyodbc
    now (1) uses the Unicode version of SQLDescribeColumn and (2) uses the configured SQL_C_WCHAR
    encoding.  I've added SQL Server test decode_meta for this.
    As part of this, I've moved much of the Unicode handling to textenc.h and textenc.cpp.  I fully
    expect to replace SQLWChar in the future and move all handling to that file.
  3. Rollback if exception raised in with clause.

    mkleehammer committed Feb 11, 2017
    The previous code would only commit at the end of a with clause if an exception was raised, but
    it did not perform a rollback like the documentation stated.  While this is harmless if you are
    allocating new connections in a scope so the automatic close would roll it back, it would be a
    disaster if you were using a manual connection pool and didn't roll back yourself.
Commits on Feb 5, 2017
  1. Correct encode error parameter.

    mkleehammer committed Feb 5, 2017
    I had incorrectly passed "errors" instead of "strict".
    Fixes #187.
Commits on Jan 20, 2017
  1. Fix double-free when row allocation fails.

    mkleehammer committed Jan 20, 2017
    Bug found by running the fantastic scan-build and the Python wrapper:
Commits on Jan 19, 2017
  1. Minor cleanup.

    mkleehammer committed Jan 16, 2017
    We no longer use UNICODE_WIDTH in the code so I've removed the macro.
    Update the fallback version from 3.x to 4.x
  2. Fix decimal read bug. Fix SQLGetTypeInfo param. Better guess of Curso…

    mkleehammer committed Jan 14, 2017
    …r.description types.
    Fixes #126.
    Because drivers are so bad about binary decimals pyodbc reads them as text.  I forgot to apply
    the configured encodings to these.
    This seems like a lot of minor changes at once.  I fixed the gettypeinfo bug and found the
    decimal crash during testing.  Unfortunately it took forever to actually find the cause and I
    touched a lot of files.
    Tweaked the warnings in the VC builds.
    Removed Python 2.4 support code in CnxnInfo.
    Watch for errors during initialization of CnxnInfo.
    Fix typo SQL_CHAR to SQL_C_CHAR when connecting via ANSI.
    Reorganized encoding conditionals while reviewing code.  A little duplication between 2.7 and
    3.x seems better than condensed but complicated code.
Commits on Jan 13, 2017
  1. Fix memcpy bug #174 in add_output_converter.

    mkleehammer committed Jan 13, 2017
    When allocating a new add_output_converter array, I copied sizeof(int) elements into a
    sizeof(SQLSMALLINT) array.  Fixes #174.
    Also corrected the docstring for add_output_converter.
Commits on Dec 30, 2016
  1. Fix setup version command

    mkleehammer committed Dec 30, 2016