Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu May 21 10:27:08 2020 +0100

    dblib: Do not report an error if BCP out didn't wrote any row

    Fix a regression introduced by "dblib: Set correctly default
    BCPMAXERRS and BCPFIRST settings".
    This is consistent with MS bcp utility. Sybase one currently reports
    an error in case BCPFIRST is set to a value >1 which is a bit inconsistent
    with the behaviour if BCPFIRST is 1 (which is not reporting error if
    there are no rows in the table).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat May 16 14:59:30 2020 +0100

    dblib: Do not try to convert skipped row reading BCP data

    This is the behaviour or proprietary libraries.
    This allows, for instance, to skip header line in CSV file.

    This fixes https://github.com/FreeTDS/freetds/issues/306.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat May 16 14:56:24 2020 +0100

    dblib: Set correctly default BCPMAXERRS and BCPFIRST settings

    Defaults are 10 and 1 respectively.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat May 16 13:20:26 2020 +0100

    dblib: Stop correctly on BCPMAXERRS setting

    Stop parsing file when number of error reach the maximum, not after.
    This is coherent with proprietary libraries.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun May 10 13:37:03 2020 +0100

    Define and use Sybase protocol constants for login

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun May 10 14:41:30 2020 +0100

    Update a note on Sybase 16 authentication

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun May 10 14:20:41 2020 +0100

    Rename TDS5_SEC_LOG_NONCE to TDS5_SEC_LOG_ENCRYPT3

    Use Sybase name

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun May 10 13:37:30 2020 +0100

    Minor comments on Sybase 15 negotiation

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun May 3 11:08:10 2020 +0100

    ctlib: Fix described type for SQL_VARIANT

    Type should be CS_CHAR_TYPE, not specific to the row data we got;
    otherwise we could have issues getting all other rows having a
    different underlying type.
    This also solves a problem with DBD::Sybase leading to crash.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Apr 28 15:17:35 2020 +0100

    Fix a small mistake in macros dealing with endianness

    Due to some wrong check big endian machines code were not optimised
    as expected.
    This affected for instance MIPS or S390x (tested).
    Note that code was just less optimised.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Apr 8 20:40:40 2020 +0100

    tds: Convert strings for Sybase

    This looks a small change but is actually pretty big.
    Previously strings were just put without any conversion.
    Now they are converted even for Sybase taking into account
    the client/server encoding.
    This is now possible after "freeze" commits and changes.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Apr 22 15:50:47 2020 +0100

    tds: Use freeze feature to write queries

    This remove the need to compute metadata length in advance.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Apr 22 15:49:46 2020 +0100

    tds: Add testing for freeze features

    Various tests.
    Some collecting weird corner cases.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Sep 20 04:06:38 2015 +0100

    tds: Add freeze support

    Allows to stop sending while caching the data to send.
    This allows to easily patch lengths inside data instead of
    having to do computation and conversions in advance.
    See documentation in code for tds_freeze* functions.

    This commit has a pretty long history, many changes and
    attempts. The APIs were changed multiple times and different
    corner cases analysed and fixed if needed.

    Some functions seem pretty complicated but they allow to make
    query code more clear and error prone and allow to do string encoding
    conversions much easily.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Apr 22 12:35:28 2020 +0100

    tds: Prevent possible problem if server tries to change block size

    Server should change block size only at the beginning.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Apr 20 13:09:18 2020 +0100

    Update webpages external links using https instead of http

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Apr 19 10:30:35 2020 +0100

    tds: Additional checks for send_packet field

    There should be no packets after it.
    Also the packet should always be present.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Apr 19 06:20:57 2020 +0100

    tds: Add tds_extra_assert

    Like assert but only if --enable-extra-checks is enabled.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Apr 18 17:20:32 2020 +0100

    tds: Fill SMP header just before appending the packet

    Avoids using wrong sequence if another thread is sending
    cancel.
    Also easier to maintain sequence monotony.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Apr 18 08:24:34 2020 +0100

    tds: Do not set out_pos in tds_connection_put_packet

    The function should not change TDSSOCKET but just the connection.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 17 21:17:12 2020 +0100

    tds: Rename tds_put_params to tds5_put_params

    The function is used only for TDS 5.0

Author: Mark Harmstone <mark@harmstone.com>
Date:   Tue Apr 14 16:54:32 2020 +0100

    tds: Ignore computed columns when doing bulk copy

    This commit fixes freetds so that it ignores computed columns when doing
    a bulk insert, in the same manner as with TIMESTAMP columns. Without it,
    tds_bcp_start_insert_stmt will fail, even if the computed column hasn't
    been directly specified.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Apr 12 12:12:09 2020 +0100

    odbc: Fix linkage for Windows using Automake tools and cross compiling

    Cross compiling for Windows using MingW caused some missing symbols.
    This due to libraries order. Put all libraries into LDADD to use
    correct order.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Apr 12 11:32:43 2020 +0100

    tds: Return correct type from tds_connection_put_packet

    More of a style change, TDSRET and int are currently the same type.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Apr 11 08:50:03 2020 +0100

    build: Fix some dependencies between files

    LIBS macro does not generate dependencies, use LDADD instead.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 10 17:52:52 2020 +0100

    odbc: Remove some warning compiling some tests

    Missing cleanup from a recent patch (cfr
    "Allows to add additional parameters to connect in tests").

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 10 17:31:49 2020 +0100

    odbc: Check extended character in array test

    This tests sending character data to server with extended
    characters using multiple queries.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 10 17:30:33 2020 +0100

    tds: Rewrite code to write character parameter as string

    The old code had some issues:
    - potentially converting twice which was leading to wrong
      data insertion;
    - buffer was converted entirely into a temporary buffer,
      potentially consuming lot of memory for no much reasons.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 10 14:23:41 2020 +0100

    tds: Fix multiple queries using binary data

    For TDS7+ strings should be converted (they are not encoded
    as ASCII compatible but UTF-16LE).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu Apr 9 20:39:22 2020 +0100

    odbc: Do temporary table cleanup at the end

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 10 11:48:02 2020 +0100

    odbc: Force character encoding for genparams test

    This test uses some extended characters, force encoding to
    support them.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 10 06:21:43 2020 +0100

    odbc: Allows to add additional parameters to connect in tests

    Reuse code to pass additional connection parameters.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 10 10:21:34 2020 +0100

    tds: Add test for some parsing query functions

    Check functions skipping comments and quoted part (strings or
    identifiers).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 10 10:37:35 2020 +0100

    tds: Minor parsing fixes

    Current only fixing invalid syntax queries.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 10 06:17:43 2020 +0100

    Reuse TDS_VECTOR_SIZE

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu Apr 9 20:33:42 2020 +0100

    tds: Fix multiple queries

    This affected ODBC array binding.
    tds_send_emulated_execute is called to send part of multiple
    statement queries so if should not start the packet query
    for every part of the chained query.
    This is a regression for protocol TDS 7.2+.
    Strangely tests seems to pass even without this patch.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Apr 8 23:46:21 2020 +0100

    odbc: Do not try query notifications on not supported connections

    Query notifications available only using TDS 7.2 or newer.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Apr 8 23:36:17 2020 +0100

    tds: Fix return code from tds_iconv in case of errors and same encoding

    The error from tds_iconv (like for iconv) in case of errors should
    be (size_t) -1, not 0.
    In case the source and destination encoding was the same (so
    TDS_ENCODING_MEMCPY flag was set) this was not the case.
    This could have caused issues if server and client had the same
    encoding (which is not much likely).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Apr 7 13:43:34 2020 +0100

    odbc: Add test for query notifications

    This change also extends the test coverage on src/tds/query.c.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Apr 8 14:10:06 2020 +0100

    tds: Exits from tds_connection_put_packet as soon as packet is sent

    It could have been possible that packet was sent but we did
    another loop around if another thread was managing the network
    (this apply only to MARS connections).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Apr 7 14:21:15 2020 +0100

    tds: Avoid deadlock calling tdserror

    tdserror will lock list_mtx again so to avoid deadlock we
    need to unlock it.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Apr 7 18:31:23 2020 +0100

    utils: Assume undefined wait for tds_cond_timedwait on 0 timeout

    This is the same behaviour of tds_select that we use to wait for
    socket activities.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Sep 20 04:06:38 2015 +0100

    tds: Return if packet is correct from tds_packet_read

    Simplify caller.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Apr 6 07:31:15 2020 +0100

    tds: Comment and make code clearer

    Instead of use 16 use sizeof to make clearer is the size of
    the header.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Apr 6 07:30:25 2020 +0100

    tds: Fix typo in comment

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Apr 5 12:08:51 2020 +0100

    tds: Rename TDSPACKET->len to data_len

    Make more clear, also in preparation to add a "data_start"
    length for SMP header.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Apr 4 21:46:43 2020 +0100

    tds: Convert strings to support special and unicode

    Convert string from client charset before sending to network.
    This allows username/domain name to have special or extended
    characters.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Apr 4 15:04:16 2020 +0100

    tds: Rename tds_send_emulated_rpc to tds4_send_emulated_rpc

    Make clear it's only for TDS 4.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Apr 3 07:14:15 2020 +0100

    Define and reuse TDS_PTR2INT and TDS_INT2PTR

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Apr 1 21:41:46 2020 +0100

    tds: Remove useless includes in declarations test

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Mar 31 06:47:02 2020 +0100

    ci: Test more MARS code using AppVeyor

    Set ODBC_MARS environment to 1 make mostly ODBC tests enable MARS
    on connections. This will test MARS code.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Mar 31 06:19:17 2020 +0100

    tds: Simplify tds_write_packet

    Use tds->send_packet->capacity as next packet size to reuse code
    to allocate new packets.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 21:05:08 2020 +0100

    tds: Avoid copying all data for MARS

    Each packet sent to network was prepared in a buffer and copied
    to another buffer before sending. This only for MARS build (which
    however was the default).
    Now the packet is MARS is used contains the SMP header so can be
    sent directly. This avoids the copy.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Mar 30 09:03:45 2020 +0100

    odbc: Fix an automake warning (duplicate macro)

    libtdsodbc_la_LIBADD was used twice.
    This affected MingW build.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 21:05:08 2020 +0100

    tds: Make sure we sent the wanted packet with MARS

    tds_connection_put_packet should return only when the wanted packet
    has been sent.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 21:05:08 2020 +0100

    tds: Handle wrapping of MARS sequences/window

    After lot of data transmitted these number sequences can
    overflow. Handle these integer overflows allowing to stuck
    network if this happens.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 22:36:50 2020 +0100

    tds: Flush packets if MARS is used

    Do not take into account if this is last packet of the query
    or not. Is it possible that the next packet of the query won't be
    send just after the current one because the sending window does not
    allow it. This caused, in case of very long queries, some higher
    timeouts causing slowness.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 20:40:20 2020 +0100

    tds: Make clear what "must_free" is referring

    Use bool type and rename to must_free_connection

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 20:39:37 2020 +0100

    tds: Style changes

    Put break/continue statement on next line

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 17:33:15 2020 +0100

    tds: Avoid possible double free on memory allocation failures

    If tds_init_socket fails (very low memory) tds_free_socket is called
    which will try to free again recv_packet and send_packet.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Nov 30 15:57:20 2019 +0000

    tds: Simplify formulae

    Really minor change, we just need the difference in bytes.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 10:33:09 2020 +0100

    odbc: Fix dependency on tests

    If common part was changed not all tests were linked against it.
    Use correct LDADD instead of LDFLAGS to handle dependencies.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 10:28:13 2020 +0100

    odbc: Simplify AM_CPPFLAGS macro definition

    Assign common part once

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 29 10:00:10 2020 +0100

    odbc: Fix build dependencies between libtds and libtdsodbc

    libtdsodbc was not rebuilt if libtds was changed.
    This due to the wrong LDFLAGS used instead of LIBADD.
    For users just compiling the library once it's not an issue but
    could cause missing rebuilt for developers.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 2 20:03:02 2020 +0000

    ctlib: Support VARIANT type

    Type will be converted to CHAR by default (the only type that can
    receive all subtypes of VARIANT type).
    Extended test to check all VARIANT subtypes.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Mar 21 19:10:53 2020 +0000

    ctlib: Constify column argument of _ct_get_client_type and _cs_convert_not_client

    No reason to change the column.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Mar 21 13:24:49 2020 +0000

    tds: Update documentation for tds_get_varint_size

    Not only limited to TDS 7.0

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Nov 29 14:24:41 2019 +0000

    odbc: Add some comments to odbc_dstr_copy_flag and odbc_set_string_flag

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Feb 4 08:45:29 2020 +0000

    odbc: Use inner type for SQL_VARIANT computing start of source field

    Using SQL_VARIANT types and getting data with SQLGetData was possible
    to cause a buffer overflow as previous position in field
    (column_text_sqlgetdatapos) was used even if inner type was fixed.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Feb 4 08:43:07 2020 +0000

    odbc: Reuse ODBC_MIN

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 2 18:46:59 2020 +0000

    tds: Remove useless i variable

    Use desttype directly, it's not change inside the loop.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 2 18:42:15 2020 +0000

    tds: Remove // style comments

    Not compatible with C89.
    Some system are still not C99 compatibles.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 2 16:52:32 2020 +0000

    ctlib: Rename t0006 test to cs_convert

    Much more readable.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 2 16:42:49 2020 +0000

    ctlib: Improve t0006 test

    Make ctx variable static.
    Make failure errors more verbose printing argument names.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 2 17:31:58 2020 +0000

    Do not clean gperf files

    Although intermediate files they are used for coverage report,
    keep it and ignore.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 2 16:18:43 2020 +0000

    tds: Better check for inner SQL_VARIANT type

    Do not accept all server types, only the ones that can be contained
    in SQL_VARIANT.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 2 16:08:12 2020 +0000

    tds: Add type flag for types that can go inside a SQL_VARIANT

    This will allows to better checks for this type from the server.
    To see the change better to use

    $ git diff '--word-diff-regex=[^;]'git

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 2 09:50:42 2020 +0000

    Do not use fprintf(stdout, ...) but just printf

    Just style change, reduces lines length.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Feb 1 17:47:10 2020 +0000

    ctlib: Do not use fprintf(stdout, ...) but just printf

    Just style change, reduces lines length.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Feb 1 17:32:34 2020 +0000

    Minor build cleanup

    Ignore autogenerated charset_lookup.h file.
    Remove intermediate charset_lookup.gperf file.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu Jan 30 21:32:36 2020 +0000

    ctlib: Optimize data padding

    Use memset instead of manually padding byte by byte.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Dec 9 13:25:38 2019 +0000

    tds: Avoid now useless casts calling tds_convert

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Dec 9 11:32:50 2019 +0000

    tds: Use "const void*" type for tds_convert "src" argument

    Allows to reduce useless conversion, the parameter is used to
    pass multiple data types.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Dec 8 21:18:56 2019 +0000

    tds: Check conversion from SYBFLT8 to SYBNUMERIC

Author: detule <ogjoneski@gmail.com>
Date:   Sat Dec 7 08:05:31 2019 -0500

    tds: More robust conversion from FLT to DECIMAL/NUMERIC

    Conversion follows flt->string->numeric code-path.  In the first step
    (flt->string via `sprintf`) we use `%f` conversion specifier to prevent
    receiving a string with scientific notation back (as is the case,
    potentially, with `%g`).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Dec 1 16:22:28 2019 +0000

    odbc: Fix genparams test for Sybase and old MSSQL

    Sybase and old MSSQL does not implicitly convert VARCHAR to MONEY.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Nov 30 18:33:22 2019 +0000

    odbc: Improve utf8_4 test

    Factor out a function to reduce big preprocessor macro.
    Use some casts to avoid possible conversion warnings.
    Check output for ASCII odbc_dstr_copy_flag call.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Aug 26 21:54:42 2015 +0100

    odbc: Use size_t instead of a pointer for prepare_pos field

    Instead of using a pointer to another buffer save the position
    to reduce code unsafety.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Nov 30 18:02:15 2019 +0000

    odbc: Check conversion from MONEY to string lead to 4 decimal digits

    The number of digits were changed time ago, check it in ODBC.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Nov 29 19:51:06 2019 +0000

    Fix compile error on older MSVC versions

    Avoid mixing declaration and code.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Nov 29 14:23:55 2019 +0000

    test: Check odbc_dstr_copy_flag function

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Nov 29 14:27:10 2019 +0000

    odbc: Support UTF-16 surrogate pairs in odbc_wide2utf and odbc_set_string_flag

    This allows to accept code points above plane 0.
    This fixes https://github.com/FreeTDS/freetds/issues/317.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Nov 29 17:59:22 2019 +0000

    odbc: Fix flags for utf8 and oldpwd tests

    Unicode build should be enabled for these tests.
    "if(var IN_LIST list)" requires "list" to be a variable.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Nov 29 14:24:27 2019 +0000

    Use mnemonic to check decode_utf8 result

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Nov 16 17:45:48 2019 +0000

    autoconf: Check for gperf presence if needed

    Avoid build failure, instead give error during configure.
    CMakeLists.txt (cmake file) has already this check.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Nov 16 17:44:42 2019 +0000

    autoconf: Rename AC_ERROR to AC_MSG_ERROR

    AC_ERROR is obsolete, replaced by AC_MSG_ERROR

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Oct 30 15:45:15 2019 +0000

    odbc: Change SQL_DESC_OCTET_LENGTH value for wide character columns

    SQL_DESC_OCTET_LENGTH should return the bytes needed for the buffer
    needed to store the default conversion of the column.
    For compatibility the default type for wide character columns
    is SQL_C_CHAR that is the strings will be converted to multi-byte.
    In FreeTDS the charset for multi-byte can be UTF-8 so assuming each
    character will take one byte is wrong.
    Use "max_bytes_per_char" value.

    This fixes issue #305 on GitHub (https://github.com/FreeTDS/freetds/issues/305).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Nov 12 14:35:38 2019 +0000

    ci: Fix build for old VS versions

    This fixes previous commit issue.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Nov 12 09:04:28 2019 +0000

    ci: Add VS 2017 to AppVeyor

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Nov 2 14:25:36 2019 +0000

    odbc: Use canonic numbers to compute charset conversion

    This make SQLGetData and other functions faster as name
    lookup is not needed.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Oct 30 11:54:09 2019 +0000

    tds: Generate charset lookup code using gperf

    Make tds_canonical_charset much faster

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Oct 30 11:52:55 2019 +0000

    tds: Add missing dependency in generated sources

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Oct 23 14:09:18 2019 +0100

    Allows describecol test to specify multiple possible values for attr command

    This will allow more flexibility in the values allowed.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Oct 14 09:18:40 2019 +0100

    cmake: Workaround issue using static OpenSSL on Windows

    It could happen that some system libraries are not included in
    the list of required OpenSSL libraries.
    This fixes Github issue #312.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu Oct 17 09:42:10 2019 +0100

    tds: Fix compile if --disable-mars is specified

    This fix previous commit bug.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Oct 16 15:26:45 2019 +0100

    tds: Fix some issues with server redirection

    Server redirection is a feature used by MSSQL, specially Azure
    to redirect a connection to another server.
    Due to a bug the TLS session was not correctly closed for the
    previous attempt causing the second connection to fail is
    the first was using TLS (which is the common case for MSSQL).
    Another issue was that Azure check the requested "server name"
    field in the login to select the databases to provide.
    Last was that MARS support was possibly disabled by first attempt
    and so MARS support was not enabled for the final connection.

    This fixed https://github.com/FreeTDS/freetds/issues/308

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Oct 16 15:14:37 2019 +0100

    Minor messages and comments updates

    Fix some typos and grammar.
    Make one log message more clear.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Oct 16 09:27:02 2019 +0100

    Rename session to client_session

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Oct 16 09:23:56 2019 +0100

    Remove sd variable

    Not much needed, just use client_sd and server_sd, also much
    clear.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Oct 13 14:25:56 2019 +0100

    userguide: Suggests DBD::ODBC instead of DBD::Sybase

    DBD::Sybase has not been updated for a while.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Sep 21 07:23:36 2019 +0100

    Extends support for MS XML type

    Make sure MS XML type is supported by CT-Library and DB-Library.
    We need to map this type to a proper library type as MS XML
    is not supported by proprietary libraries (DB-Library was abandoned,
    CT-Library is written for Sybase).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Oct 11 19:42:00 2019 +0100

    Update script to prepare Windows test distribution

    Change default to 64 bit instead of 32 bit.
    Nowadays more and more systems are 64 bit.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Oct 7 12:48:16 2019 +0100

    Fix compilation under Solaris

    Use system header for u?intXX_t types to avoid collisions.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Oct 6 20:51:20 2019 +0100

    ctlib: Fix an error message in a test

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Oct 6 20:50:58 2019 +0100

    Add a comment to TDSSOCKET::sid

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Sep 22 15:20:50 2019 +0100

    Avoid macro side effect using MARS

    TDS_PUT_A4LE macro could expand value multiple times causing multiple
    increment of send_seq.
    This should affect big endian machines with no GCC compilers.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Sep 4 07:23:07 2019 +0100

    tds: Check iconv is behaving as expected in tds_iconv_init

    Avoids buggy iconv implementations.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Aug 31 16:52:16 2019 +0100

    tds: Apply character conversion for Sybase

    In FreeTDS 1.0 conversion was moved from server to client.
    However some code was missing to apply the conversion in all
    directions. Apply conversion in all sensing and receiving of data.
    For BCP we now need to use server column size as column_size
    is adjusted for client conversion so can be much bigger than
    server real column size (expected to match for BCP).

    This fixes issue #260 ("handle different encoding when retrieve
    rows got strange chars")

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sat Aug 31 09:18:08 2019 +0100

    tds: Rework TDS_COMPILETIME_SETTINGS

    Use bool instead of int.
    Add missing fields used by tsql (SSPI, Kerberos).
    Update tsql according.
    Used an helper in tsql to simplify booleans handling.

Author: Evan Miller <emmiller@gmail.com>
Date:   Fri Aug 30 15:03:04 2019 -0400

    New CS_DATABASE property

    Microsoft Azure does not allow switching databases after the connection
    has been made, so we need a way to define the database name prior to the
    call to `ct_connect`. Introduce a new, optional CS_DATABASE property
    that can be configured with a string value using `ct_con_props`.

    I have defined the constant / enum as 9302, as it appears that the other
    93XX properties (CS_PORT and CS_CLIENTCHARSET) are also inventions of
    FreeTDS.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Aug 9 18:02:32 2019 +0100

    ci: Remove old AppVeyor workaround

    Do not rename wdf directory, this used to fix an issue compiling
    however now is not necessary and making the build fail

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Aug 9 17:39:21 2019 +0100

    tds: Decrease log level for state changes

    This erroneously was marked as ERROR but is just informational.
    This fixes GitHub issue #300 raised by Francesco Abeni.

Author: albert-github <albert.tests@gmail.com>
Date:   Wed Jul 10 16:46:06 2019 +0200

    Documentation errors

    Some obvious documentation errors

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Jul 9 09:26:43 2019 +0100

    tds: Make sure UDT has varint set to 8

Author: Eran Amitai <mayonada@gmail.com>
Date:   Sat Jun 29 08:52:28 2019 +0100

    dblib: read of varbinary columns into DBVARYBIN variables

    Fix: varbinary columns don't bind correctly when bound to variables
    declared as DBVARYBIN using the VARYBINBIND bind type - variable doesn't
    get updated.

Author: food-spotter <48453986+food-spotter@users.noreply.github.com>
Date:   Mon Jun 24 14:03:28 2019 +0100

    Update INSTALL.GIT.md

    Typo correction:
    "Intall" -> "Install"

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Apr 29 11:59:11 2019 +0100

    utils: Optimise a bit the way bytes are encoded

    This should affect some architectures only.
    Potentially Windows using Microsoft compiler and Linux big endians.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri May 10 17:18:01 2019 +0100

    tds: Override correctly if "asa database" is used

    The configuration section was not taken into account if "server:port"
    was used.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri May 10 16:58:11 2019 +0100

    tds: Override always port using "server:port" syntax

    Avoid global setting in case there's no section for "server".

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu May 9 21:58:47 2019 +0100

    Fix overriding server_name if "server:port" or "server\instance" are used

    This allows Azure Managed SQL Server connections easily.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu May 9 21:18:19 2019 +0100

    tds: Add a test for parsing "server:port" or "server\instance" syntaxes

    Combination of this syntaxes are quite tricky.
    They are supposed to override port or instance but still using
    full configuration sections if available.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri May 10 09:41:54 2019 +0100

    dblib: Rename t0021 test to dbsafestr

    Much more meaningful name.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri May 10 09:38:21 2019 +0100

    dblib: Improve test for dbsafestr

    Check an additional overflow for DBBOTH.
    Update a bit style.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri May 10 09:07:54 2019 +0100

    dblib: Support DBVERSION_UNKNOWN in dbsetlversion

    Allows to explicitly set version to "auto".

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri May 10 09:07:20 2019 +0100

    dblib: Use same mnemonic prefix in dbsetlversion

    Do not mix "DBVER" and "DBVERSION_" prefixes.
    The constants are the same, just different names.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri May 10 09:05:36 2019 +0100

    dblib: Avoid useless check

    dbproc is tested for NULL in CHECK_PARAMETER.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri May 10 09:05:00 2019 +0100

    dblib: Some space and style minor updates

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed May 8 15:51:30 2019 +0100

    dblib: Correctly trim unicode fields from bcp file

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed May 8 15:18:07 2019 +0100

    dblib: Separate trimming bcp data into a function

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon May 6 08:23:14 2019 +0100

    build: Update files due to Markdown renames

Author: Evan Carroll <me@evancarroll.com>
Date:   Sat Oct 28 14:11:05 2017 -0500

    updated to use markdown

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed May 1 08:52:31 2019 +0100

    tds: Fix corrupt test for big endian machines

    The code writes always using little endian on network so
    adjust numbers accordingly.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Apr 29 18:40:57 2019 +0100

    typo: Translate small italian comment

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Apr 29 18:40:29 2019 +0100

    utils: Ignore generated file

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Apr 29 13:18:31 2019 +0100

    Remove "emulate little endian" setting

    Always use little endian at protocol level.
    MS servers only implement little endian.
    Also many big endian architectures have facilities to deal with
    little endian so removing the check for little/big endian make
    code faster and smaller.
    This also reduce conditional code.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Apr 29 12:29:04 2019 +0100

    Make TDS_ADDITIONAL_SPACE required

    This is already a requirement in src/tds/stream.c and code was tested
    with this value set to 16 since long time ago.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Apr 29 11:57:03 2019 +0100

    utils: Add a test for byte handling

    Check we correctly write integers with right order and alignment.
    This will avoid problems like the previous PPC bug.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Apr 28 19:30:11 2019 +0100

    Fix endian adjustment on PPC little endian

    Code assumed PPC were always big endian.

Author: Mark Harmstone <mark@harmstone.com>
Date:   Tue Apr 9 20:46:53 2019 +0100

    server: work with IPv6

Author: Mark Harmstone <mark@harmstone.com>
Date:   Tue Apr 9 20:48:38 2019 +0100

    server: set state to TDS_IDLE when client connects

Author: rayrapetyan <robert.ayrapetyan@gmail.com>
Date:   Tue Apr 16 20:26:57 2019 -0700

    change severity for "DBPROCESS is dead or not enabled": EXINFO -> EXCOMM

    "DBPROCESS is dead or not enabled" is a connectivity issue on the client
    side, severity level should be EXCOMM at least.
    It makes e.g.
    https://github.com/pymssql/pymssql/blob/fda5fd38f30eaeeb40a911235692144493d69864/src/_mssql.pyx#L1168
    to spin infinitely, never raising StopIteration (in case issue occurred in
    the middle of fetching process).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Mar 29 09:44:34 2019 +0000

    Do not install not executable files as executable

    Configuration files and some documentation were installed as
    executable using "make install".

    Reported-by: Rüdiger Ihle

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu Mar 28 03:54:45 2019 +0000

    cmake: Allow build from stable packaged version

    For stable packaged version the version string was extracted from
    configure file however the regular expression used not
    supporting 1.x versions.

Author: Alexey Basov <r313pp@gmail.com>
Date:   Mon Mar 4 17:24:20 2019 +0300

    Fix bulk insert multibyte string support in names

    When column name (or table name in blob type case) has non ASCII characters length of such string was calculated incorrectly.
    In such cases bulk insert has failed with:
    Msg 4804, Level 17, State 1
            While reading current row from host, a premature end-of-message was encountered--an incoming data stream was interrupted when the server expected to see more data. The host program may have terminated. Ensure that you are using a supported client application programming interface (API).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Mar 18 12:21:26 2019 +0000

    odbc: Fix SQLGetPrivateProfileString call for connect test

    If unicode was used the proper encoding was not used.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Mar 18 12:05:22 2019 +0000

    cmake: Use UNICODE build for tests like for autoconf

    If ENABLE_ODBC_WIDE was specified unicode build were not used.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Mar 18 12:04:14 2019 +0000

    odbc: Cleanup tables on bcp test

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Mon Mar 18 12:03:56 2019 +0000

    odbc: Add missing test to CMake build

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 17 17:12:44 2019 +0000

    ctlib: Add a test for cs_will_convert

    Still needs some tweak but at least check that is using the
    right types (not TDS ones).

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 17 19:02:35 2019 +0000

    ctlib: Fix cs_will_convert

    Use CT-Library types, not TDS ones.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Mar 17 18:32:26 2019 +0000

    ctlib: Define CS_MIN_SYBTYPE and CS_MAX_SYBTYPE

    Allows to know the range of the type supported by CT-Library.
    Sybase headers have these defines.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Tue Oct 9 00:02:49 2018 +0100

    Reduce TDSSOCKET size

    Small structure optimisation.

Author: Aaron M. Ucko <ucko@ncbi.nlm.nih.gov>
Date:   Mon Jun 4 11:13:37 2018 -0400

    ct.c (_ct_get_server_type): Handle CS_LONGCHAR_TYPE.

    Map it to SYBVARCHAR when (possibly) using TDS 7+, and to SYBLONGCHAR
    with older protocol versions.  Unconditional use of SYBLONGCHAR would
    result in gratuitous Sybase-style substitution of single spaces for empty
    strings under Microsoft SQL Server, which otherwise leaves them intact.

    Add a comment summarizing the types that remain unhandled.

    Co-Authored-By: Sergey Sikorskiy <ssikorsk@ncbi.nlm.nih.gov>

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Sun Feb 10 13:57:01 2019 +0000

    Convert DocBook to XML format

    Use xmlto instead of openjade.
    Update main document, style sheet and build files.
    Update documentation.
    Now is not necessary to define DOCBOOK_DSL, if xmlto is found
    the guide is compiled.

    ---
    TODO: Missing some styles like ODBC preparation box and minors

    MINOR Notes have no title, just a ruler to separate

    MINOR Index has next on top

    MINOR footnote numbers does not restart at every page

    Top title is always the same on SGML

    "ODBC Preparation" come with a nice box around in SGML
    see sidebar css

    SGML "Possible linker problems" output and commands have a darker background

    freetdsconf chapter table into a table in XML has no borders

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Mar 13 15:43:43 2019 +0000

    tds: Pass all collation to tds7_srv_charset_changed

    Allows tds7_srv_charset_changed to inspect all collation data.
    This will be needed to support SQL Server 2019 UTF-8 encoding.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Mar 15 08:23:26 2019 +0000

    tds: Propagate error from tds_put_params

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu Mar 14 23:45:24 2019 +0000

    dblib: Update declaration style

    Avoid identifiers starting with underscore and capital letter,
    now reserved.
    Avoid structure names starting with tag_, only very few occurrences.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Nov 4 22:48:43 2016 +0000

    tds: Small improve to encodings.pl script

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Mar 1 09:19:43 2019 +0000

    tds: Update collations test

    Do not cache collation digests, potentially could change even
    with same locale/charset (like UTF-8 support).
    Print locale and flags in hexadecimal, locale is usually shown
    in that way, flags are easier to read as they are bit combination.

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Fri Mar 1 09:22:43 2019 +0000

    tds: Small optimisation

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Thu Mar 14 08:33:34 2019 +0000

    Small NEWS update

Author: Frediano Ziglio <freddy77@gmail.com>
Date:   Wed Mar 13 16:22:39 2019 +0000

    start development release
