1. 14 Sep, 2017 1 commit
  2. 20 Jul, 2017 1 commit
    • Vadim Zeitlin's avatar
      Avoid duplicate code for parsing dates in different backends · a1e07e38
      Vadim Zeitlin authored
      SQLite, MySQL and PostgreSQL backends used the same but slightly
      different code for parsing the contents of a buffer into std::tm struct.
      
      Replace all these different versions with a single version, copied from
      the PostgreSQL variant, which seems like the most complete, in the
      common code.
      
      Update MySQL-specific test to not expect parsing a string containing
      time without date to yield year 2000, this didn't make any sense at all
      and PostgreSQL default of year 1900 makes at least slightly more sense.
      a1e07e38
  3. 22 Jul, 2015 1 commit
  4. 15 Jul, 2015 1 commit
    • Miha Ravselj's avatar
      More and better MSVC warnings fixes. · 7623f76f
      Miha Ravselj authored
      Fix warnings by changing the code whenever possible, in particular remove
      firebird_rowid_backend class and src/backends/firebird/row-id.cpp file in
      which it was defined entirely as it only resulted in "unreachable code"
      warnings but was otherwise unused.
      
      Also avoid implicit conversions by either using the correct types or by making
      the casts explicit using static_cast<> in places where the casts are really
      needed.
      
      Add helpful SOCI_NOT_COPYABLE, SOCI_NOT_ASSIGNABLE and SOCI_UNUSED macros and
      use them to suppress the corresponding warnings.
      
      Finally, combine soci-config.h and soci-platform.h in a single file, always
      include the latter as the first header and keep the former as a wrapper for
      the latter just for compatibility.
      
      Remove the MSVC "#pragma warning(disable: *)" as they are not needed any more.
      
      Closes #355.
      7623f76f
  5. 01 Jun, 2015 1 commit
  6. 28 May, 2015 1 commit
  7. 21 Apr, 2015 1 commit
  8. 15 Apr, 2015 2 commits
    • Vadim Zeitlin's avatar
      Make SOCI_NORETURN public and use it in declaration. · f5c86b70
      Vadim Zeitlin authored
      SOCI_NORETURN had to be moved to a public header to avoid MSVC error C2381
      ("'function' : redefinition; __declspec(noreturn) differs") which was given if
      SOCI_NORETURN was specified on the function definition only and not its
      declaration.
      
      Use SOCI_NORETURN when both declaring and defining the function now (notice
      that C++11 [[noreturn]] attribute also must be used on declarations).
      f5c86b70
    • Vadim Zeitlin's avatar
      Add mktime_from_ymdhms() helper. · 62c17b27
      Vadim Zeitlin authored
      No changes, just refactor the code to use this function instead of redoing all
      the year/month adjustments (by 1900 and 1 respectively) in all the backends.
      
      This is also meant to allow changing the time zone handling in a single place
      in the future if we decide to do it.
      62c17b27
  9. 01 Apr, 2015 1 commit
  10. 31 Mar, 2015 1 commit
    • Vadim Zeitlin's avatar
      Add helper exchange_type_cast<>() template function. · 0f1f295f
      Vadim Zeitlin authored
      The new function replaces explicit static_cast<> and can be used to upcast a
      void pointer to the type of the value corresponding to the exchange_type
      associated with it somewhat more safely and less verbosely.
      
      There are no real changes in this commit.
      0f1f295f
  11. 16 Mar, 2015 1 commit
    • Vadim Zeitlin's avatar
      Fix rounding error in Firebird NUMERIC/DECIMAL conversions. · 24c05399
      Vadim Zeitlin authored
      The value was truncated instead of being rounded in to_isc() helper function,
      resulting in, for example, "0.003958" being saved as "0.003957" in a
      NUMERIC(7,6) column because the string "0.003958" is actually
      "0.0039579999999999997129" when converted to string with 20 digits of
      precision and, after multiplying by 1e6 scale, yielded 3957 in the usual
      double precision.
      
      Round the values now to prevent this from happening.
      24c05399
  12. 11 Mar, 2015 1 commit
    • Vadim Zeitlin's avatar
      Define GCC_WARNING_SUPPRESS and GCC_WARNING_RESTORE macros. · c85744b7
      Vadim Zeitlin authored
      Add a private header for compiler-specific things and use it to define
      GCC_WARNING_{SUPPRESS.RESTORE} macros which will be used in the upcoming
      commits to locally disable some of the g++ warnings.
      
      As a side effect, also add SOCI_CONCAT and SOCI_STRINGIZE helper macros, in
      their own header to facilitate their reuse in the future if needed.
      c85744b7
  13. 22 Apr, 2014 2 commits
    • Vadim Zeitlin's avatar
      Use locale-independent function for converting doubles to strings. · 8548642d
      Vadim Zeitlin authored
      Similarly to the issue #238 but in the other direction, we must use
      locale-independent functions to ensure that we send the strings in correct
      format to the database even if the current locale doesn't use period as
      decimal separator.
      
      This fixes errors like
      
      	invalid input syntax for type double precision: "3,1415926500000002086"
      
      when executing the tests in e.g. French locale.
      8548642d
    • Vadim Zeitlin's avatar
      Reimplement cstring_to_double() without using C++ standard library. · 1260d4f7
      Vadim Zeitlin authored
      Some implementations of C++ streams (notably libstdc++ under OS X) are buggy
      and change the global locale to implement support for imbue(), which is not
      thread-safe, and so could introduce subtle bugs in multi-thread programs.
      
      Replace the old correct but not working in practice code with a new ugly
      version only supporting decimal comma and period which is not totally correct
      in theory but should work fine in practice (and shouldn't make things worse
      even for the hypothetical locales using some other decimal separator anyhow).
      1260d4f7
  14. 25 Mar, 2014 1 commit
  15. 24 Mar, 2014 1 commit
  16. 20 Jan, 2014 1 commit
  17. 29 May, 2013 1 commit
    • Mateusz Loskot's avatar
      Implement new source tree layout #125 · b6d97ffa
      Mateusz Loskot authored
      First set of changes incorporating new structure of source tree.
      It also applies some of changes planned as part of buried headers feature #25
      
      Work in progress, requires testing before merging into develop branch
      b6d97ffa