Added case test6 for get_affected_rows() implemented in SQLite3
Make INT UNSIGNED play nicely with soci::rowset<>.
Support long int on 32-bit architectures (thanks to Michael Evdokimov.)
Support parameters of type "long" correctly under all platforms.

Recent change added proper support for "long" parameters but relied on
__WORDSIZE being defined which isn't the case under e.g. Windows with MSVC.

Use template partial specialization to correctly select the tag for "long"
under both 32 and 64 bit architectures without using __WORDSIZE now.

Signed-off-by: Vadim Zeitlin <vz-soci@...>
Signed-off-by: Alex Ott <alexott@gmail.com>
add patch from Olaf Bonorden
Support x_long_long and x_unsigned_long_long input and output parameters (by Vadim Zeitlin)
Fixing a BIGINT UNSIGNED bug.

Also, previously INT UNSIGNED was converted to dt_long_long.  It seems that
dt_unsigned_long is a better match so I'm changing it.
Fixing the bug in yesterday's change (missing "break" in a switch.)

Also, adding support for unsigned long long for vectors, and for use() in
addition to into().
Firebird backend compilation fix: don't use x_cstring.

This string type has been removed from SOCI a long time ago, simply remove its
occurrences from the Firebird backend code.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Fix x_integer handling in Firebird backend.

Use "int", not "long long", for "into" parameters of x_integer type. This is
consistent with both "use" parameters and the other backends and just makes
more sense.

Do use "long long" for x_long_long "into" parameters.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Compilation fix for ISC_STATUS use in Firebird backend.

ISC_STATUS is not the same as "long", use the correct type to fix compilation
with Firebird 2.x.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Don't use deprecated isc_interprete() in Firebird backend.

Using isc_interprete() is unsafe because it doesn't take the buffer size and
results in deprecation warnings with Firebird 2.x. Use the new fb_interpret()
instead to fix both problems.

Notice that this breaks compilation with Firebird 1.x but hopefully this is
not a problem as it's pretty old by now.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Work around bug in timestamp conversion in Firebird backend.

tm_isdst field of the returned struct tm was not set correctly, work around it
by always setting it to -1 until http://tracker.firebirdsql.org/browse/CORE-3877
is fixed.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Don't throw from firebird_rowid_backend destructor.

This is useless as the exception would already be thrown if an object of this
class were constructed, there is no need to also throw it when destroying it
and doing this results in compilation warnings from at least MSVC.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Implement get_affected_rows() for Firebird backend.

Use isc_dsql_sql_info(isc_info_sql_records) to get the number of records
affected by the last statement.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Implement get_affected_rows() for ODBC backend.

Use SQLRowCount() to implement this but also check for SQL_NO_DATA to avoid
calling it unnecessarily when we are sure that no rows were affected anyhow.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Fix binding of parameters of custom types in ODBC backend.

Call SQLBindParameter() from pre_use() which is guaranteed to be called when
the input parameters have their correct, final values, notably after they were
converted from custom type by conversion_use_type::convert_to_base().

This also fixes another serious problem for string types in the ODBC backend:
setting a "use" parameter after define_and_bind() but before execute() doesn't
result in buffer overflow any more.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Use SQL_VARCHAR instead of SQL_LONGVARCHAR in ODBC backend.

This allows to use string parameters with equality operator when using MS SQL
ODBC driver. Before this change any attempt to compare a [VAR]CHAR(N) field in
the database with a string parameter resulted in the following error:

	ODBC error 42000: [Microsoft][ODBC SQL Server Driver][SQL Server]
	The data types char and text are incompatible in the equal to operator.

Also remove the strange SOCI_ODBC_VERSION_3_IS_TO_BE_CHECKED preprocessor
check which was useless as this symbol was never defined.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Get rid of post_use() code in ODBC backend.

This code was completely useless as it simply copied back the data we passed
to the ODBC driver into the parameter variables, overwriting them unnecessarily.

Simply remove it.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>
Handle SQLGetDiagRec() errors more gracefully in ODBC backend.

Don't just leave sqlstate completely uninitialized and message empty if
SQLGetDiagRec() fails -- as it can happen at least with Oracle ODBC driver
when a statement attempts to use SQL_C_UBIGINT parameters. Fill them with
SOCI-generated error message instead to give at least some information.

Signed-off-by: Vadim Zeitlin <vz-soci@zeitlins.org>