1. 14 Sep, 2017 3 commits
  2. 13 Sep, 2017 2 commits
  3. 12 Sep, 2017 4 commits
  4. 10 Sep, 2017 3 commits
  5. 03 Sep, 2017 4 commits
  6. 01 Sep, 2017 1 commit
  7. 22 Aug, 2017 4 commits
  8. 06 Aug, 2017 2 commits
  9. 31 Jul, 2017 1 commit
  10. 30 Jul, 2017 1 commit
  11. 25 Jul, 2017 3 commits
  12. 21 Jul, 2017 10 commits
    • Vadim Zeitlin's avatar
      Merge branch 'odbc-string-len' · 7a6559c1
      Vadim Zeitlin authored
      Fix handling of strings in bulk operations in ODBC and DB2 backends and
      get_affected_rows() behaviour in ODBC.
      
      Closes #561, also see #202, #495.
      7a6559c1
    • Vadim Zeitlin's avatar
      Add test checking string length when using bulk insert · c6aef12b
      Vadim Zeitlin authored
      This used to be broken, so add a test to check that it works after the
      changes of the last commit and to avoid breaking it again.
      c6aef12b
    • Vadim Zeitlin's avatar
      Fix the length of strings in DB2 vector operations · 51c4c1e1
      Vadim Zeitlin authored
      This is the same as a2c1ce7aceb564c11f48b3b586e2e77245c3deab except for
      DB2 backend (which is, of course, very similar to ODBC one as ODBC API
      is very close to DB2 CLI).
      51c4c1e1
    • Vadim Zeitlin's avatar
      Fix the length of strings in ODBC vector operations · be4f26fe
      Vadim Zeitlin authored
      Saving a string of length N in the database saved it as a string of
      length N+1 with a trailing NUL explicitly written into the database and
      reading it back resulted in a string of length N+1 too, i.e. it didn't
      survive the round trip (notice that this bug only affected vector
      operations, scalar ones worked correctly).
      
      Fix this by not writing the trailing NUL in odbc_vector_use_type_backend
      and fix the strings returned from odbc_vector_into_type_backend by not
      assuming that they're NUL-terminated any more: in fact, they can be, but
      they also can be right-padded with spaces, which need to be removed.
      
      Notice that this does mean that we still have a problem with
      inconsistent behaviour for the strings with the trailing spaces between
      ODBC backend and others: ODBC one will strip them from the returned
      strings, but other backends will not. It is not clear what can be done
      about it, unfortunately.
      be4f26fe
    • Vadim Zeitlin's avatar
      Improve get_affected_rows() documentation · 521a8408
      Vadim Zeitlin authored
      Mention that the exact result of this method can't be relied upon for
      the partially successful statements when using ODBC: some drivers
      (including the widely used MS SQL native client) simply don't return
      this information at all, while others (MySQL) just return wrong number
      of rows.
      
      Also remove the apparently obsolete note about this method not supported
      in the Oracle backend as it does seem to implement it.
      521a8408
    • Vadim Zeitlin's avatar
      Return -1 from get_affected_rows() in ODBC backend if unknown · e7e7fb78
      Vadim Zeitlin authored
      It is not always possible to get the number of affected rows after a
      partially executed statement, some drivers provide this information, but
      some others, notable MS SQL native client one, do not.
      
      Return -1 from get_affected_rows() to at least allow distinguishing this
      situation from the one in which we can really know that no rows were
      affected, in which case 0 would be returned.
      
      Notice that this indirectly fixes the "Get affected rows" unit test
      which was broken by the previous fix of #495 as it made the partial
      insert actually work, while it was completely broken before because
      "1\0" string couldn't be converted to a number and so the check for
      get_affected_rows() wasn't being executed at all. But now that the
      string is the correct "1", the check started being executed and failing.
      e7e7fb78
    • Vadim Zeitlin's avatar
      Remove loop that could be never executed from ODBC code · 97a4728c
      Vadim Zeitlin authored
      The hasVectorUseElements_ field is guaranteed to be false in the "else"
      branch of "if (hasVectorUseElements_)" condition, so the loop condition
      testing it could never be true.
      
      Simplify code by getting rid of the loop, without changing its
      behaviour.
      97a4728c
    • Vadim Zeitlin's avatar
      Fix harmless variable shadowing warnings · 1a0eeb18
      Vadim Zeitlin authored
      Suppress VC14 (a.k.a. MSVS 2015) C4456 warning about shadowing variables
      in outer scope.
      
      No real changes.
      1a0eeb18
    • Vadim Zeitlin's avatar
      Fix loss of error message in ODBC backend when using vectors · e7cdd475
      Vadim Zeitlin authored
      The error message needs to be retrieved before calling any other ODBC
      functions, but the code called SQLGetDiagField() and so the error
      message always was "No error" even if the statement really failed.
      e7cdd475
    • Vadim Zeitlin's avatar
      Add check for absence of unneeded truncation too · 06915e48
      Vadim Zeitlin authored
      We already checked that inserting a too long string resulted in an
      error, now check that inserting a string just long enough does not
      result in it.
      06915e48
  13. 20 Jul, 2017 2 commits