Version History
-
1.0.106.0 - August XX, 2017 (release scheduled)
+
1.0.106.0 - September XX, 2017 (release scheduled)
- - Updated to SQLite 3.20.0.
+ - Updated to SQLite 3.20.1.
+ - Add BindDecimalAsText and GetDecimalAsText connection flags to force binding and returning of decimal values as text. Pursuant to [b167206ad3].
- Add preliminary support for Visual Studio 2017 and the .NET Framework 4.7.
1.0.105.2 - June 12, 2017
- Updated to SQLite 3.19.3.
Index: SQLite.Interop/props/sqlite3.props
==================================================================
--- SQLite.Interop/props/sqlite3.props
+++ SQLite.Interop/props/sqlite3.props
@@ -7,12 +7,12 @@
* Released to the public domain, use at your own risk!
*
-->
- 3.20.0.0
- 3,20,0,0
+ 3.20.1.0
+ 3,20,1,0
_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;SQLITE_THREADSAFE=1;SQLITE_USE_URI=1;SQLITE_ENABLE_COLUMN_METADATA=1;SQLITE_ENABLE_STAT4=1;SQLITE_ENABLE_FTS3=1;SQLITE_ENABLE_LOAD_EXTENSION=1;SQLITE_ENABLE_RTREE=1;SQLITE_SOUNDEX=1;SQLITE_ENABLE_MEMORY_MANAGEMENT=1;SQLITE_ENABLE_API_ARMOR=1;SQLITE_ENABLE_DBSTAT_VTAB=1;SQLITE_ENABLE_STMTVTAB=1
SQLITE_PLACEHOLDER=1
SQLITE_OMIT_WAL=1
HAVE_ERRNO_H=1;SQLITE_MSVC_LOCALTIME_API=1
SQLITE_DEBUG=1;SQLITE_MEMDEBUG=1;SQLITE_ENABLE_EXPENSIVE_ASSERT=1
Index: SQLite.Interop/props/sqlite3.vsprops
==================================================================
--- SQLite.Interop/props/sqlite3.vsprops
+++ SQLite.Interop/props/sqlite3.vsprops
@@ -12,16 +12,16 @@
Version="8.00"
Name="sqlite3"
>
pOut;
assert( sqlite3_mutex_held(pOut->db->mutex) );
- sqlite3VdbeMemSetNull(pOut);
+ sqlite3VdbeMemRelease(pOut);
+ pOut->flags = MEM_Null;
sqlite3VdbeMemSetPointer(pOut, pPtr, zPType, xDestructor);
}
SQLITE_API void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
Mem *pOut = pCtx->pOut;
assert( sqlite3_mutex_held(pOut->db->mutex) );
@@ -200273,11 +200274,11 @@
int nArg, /* Number of args */
sqlite3_value **apUnused /* Function arguments */
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
- sqlite3_result_text(pCtx, "fts5: 2017-08-01 13:24:15 9501e22dfeebdcefa783575e47c60b514d7c2e0cad73b2a496c0bc4b680900a8", -1, SQLITE_TRANSIENT);
+ sqlite3_result_text(pCtx, "fts5: 2017-08-24 16:21:36 8d3a7ea6c5690d6b7c3767558f4f01b511c55463e3f9e64506801fe9b74dce34", -1, SQLITE_TRANSIENT);
}
static int fts5Init(sqlite3 *db){
static const sqlite3_module fts5Mod = {
/* iVersion */ 2,
Index: SQLite.Interop/src/core/sqlite3.h
==================================================================
--- SQLite.Interop/src/core/sqlite3.h
+++ SQLite.Interop/src/core/sqlite3.h
@@ -119,13 +119,13 @@
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.20.0"
-#define SQLITE_VERSION_NUMBER 3020000
-#define SQLITE_SOURCE_ID "2017-08-01 13:24:15 9501e22dfeebdcefa783575e47c60b514d7c2e0cad73b2a496c0bc4b680900a8"
+#define SQLITE_VERSION "3.20.1"
+#define SQLITE_VERSION_NUMBER 3020001
+#define SQLITE_SOURCE_ID "2017-08-24 16:21:36 8d3a7ea6c5690d6b7c3767558f4f01b511c55463e3f9e64506801fe9b74dce34"
/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version sqlite3_sourceid
**
Index: SQLite.Interop/src/ext/fts5.c
==================================================================
--- SQLite.Interop/src/ext/fts5.c
+++ SQLite.Interop/src/ext/fts5.c
@@ -17316,11 +17316,11 @@
int nArg, /* Number of args */
sqlite3_value **apUnused /* Function arguments */
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
- sqlite3_result_text(pCtx, "fts5: 2017-08-01 13:24:15 9501e22dfeebdcefa783575e47c60b514d7c2e0cad73b2a496c0bc4b680900a8", -1, SQLITE_TRANSIENT);
+ sqlite3_result_text(pCtx, "fts5: 2017-08-24 16:21:36 8d3a7ea6c5690d6b7c3767558f4f01b511c55463e3f9e64506801fe9b74dce34", -1, SQLITE_TRANSIENT);
}
static int fts5Init(sqlite3 *db){
static const sqlite3_module fts5Mod = {
/* iVersion */ 2,
Index: System.Data.SQLite/SQLite3.cs
==================================================================
--- System.Data.SQLite/SQLite3.cs
+++ System.Data.SQLite/SQLite3.cs
@@ -3265,11 +3265,11 @@
Type t = null;
if (typ.Type != DbType.Object)
{
t = SQLiteConvert.SQLiteTypeToType(typ);
- aff = TypeToAffinity(t);
+ aff = TypeToAffinity(t, flags);
}
if ((flags & SQLiteConnectionFlags.GetAllAsText) == SQLiteConnectionFlags.GetAllAsText)
return GetText(stmt, index);
Index: System.Data.SQLite/SQLiteBase.cs
==================================================================
--- System.Data.SQLite/SQLiteBase.cs
+++ System.Data.SQLite/SQLiteBase.cs
@@ -1243,10 +1243,24 @@
/// rolled back. All non-outermost transactions are implemented using
/// the SAVEPOINT construct.
///
AllowNestedTransactions = 0x8000000000,
+ ///
+ /// When binding parameter values, always bind
+ /// values as though they were plain text (i.e. not ,
+ /// which is the legacy behavior).
+ ///
+ BindDecimalAsText = 0x10000000000,
+
+ ///
+ /// When returning column values, always return
+ /// values as though they were plain text (i.e. not ,
+ /// which is the legacy behavior).
+ ///
+ GetDecimalAsText = 0x20000000000,
+
///
/// When binding parameter values or returning column values, always
/// treat them as though they were plain text (i.e. no numeric,
/// date/time, or other conversions should be attempted).
///
Index: System.Data.SQLite/SQLiteConvert.cs
==================================================================
--- System.Data.SQLite/SQLiteConvert.cs
+++ System.Data.SQLite/SQLiteConvert.cs
@@ -1623,19 +1623,28 @@
///
/// For a given type, return the closest-match SQLite TypeAffinity, which only understands a very limited subset of types.
///
/// The type to evaluate
+ /// The flags associated with the connection.
/// The SQLite type affinity for that type.
- internal static TypeAffinity TypeToAffinity(Type typ)
+ internal static TypeAffinity TypeToAffinity(
+ Type typ,
+ SQLiteConnectionFlags flags
+ )
{
TypeCode tc = Type.GetTypeCode(typ);
if (tc == TypeCode.Object)
{
if (typ == typeof(byte[]) || typ == typeof(Guid))
return TypeAffinity.Blob;
else
+ return TypeAffinity.Text;
+ }
+ if ((tc == TypeCode.Decimal) &&
+ ((flags & SQLiteConnectionFlags.GetDecimalAsText) == SQLiteConnectionFlags.GetDecimalAsText))
+ {
return TypeAffinity.Text;
}
return _typecodeAffinities[(int)tc];
}
@@ -1684,10 +1693,11 @@
new SQLiteDbTypeMapping("COUNTER", DbType.Int64, false),
new SQLiteDbTypeMapping("CURRENCY", DbType.Decimal, false),
new SQLiteDbTypeMapping("DATE", DbType.DateTime, false),
new SQLiteDbTypeMapping("DATETIME", DbType.DateTime, true),
new SQLiteDbTypeMapping("DECIMAL", DbType.Decimal, true),
+ new SQLiteDbTypeMapping("DECIMALTEXT", DbType.Decimal, false),
new SQLiteDbTypeMapping("DOUBLE", DbType.Double, false),
new SQLiteDbTypeMapping("FLOAT", DbType.Double, false),
new SQLiteDbTypeMapping("GENERAL", DbType.Binary, false),
new SQLiteDbTypeMapping("GUID", DbType.Guid, false),
new SQLiteDbTypeMapping("IDENTITY", DbType.Int64, false),
@@ -1712,10 +1722,11 @@
new SQLiteDbTypeMapping("NCHAR", DbType.StringFixedLength, true),
new SQLiteDbTypeMapping("NOTE", DbType.String, false),
new SQLiteDbTypeMapping("NTEXT", DbType.String, false),
new SQLiteDbTypeMapping("NUMBER", DbType.Decimal, false),
new SQLiteDbTypeMapping("NUMERIC", DbType.Decimal, false),
+ new SQLiteDbTypeMapping("NUMERICTEXT", DbType.Decimal, false),
new SQLiteDbTypeMapping("NVARCHAR", DbType.String, true),
new SQLiteDbTypeMapping("OLEOBJECT", DbType.Binary, false),
new SQLiteDbTypeMapping("RAW", DbType.Binary, false),
new SQLiteDbTypeMapping("REAL", DbType.Double, true),
new SQLiteDbTypeMapping("SINGLE", DbType.Single, true),
Index: System.Data.SQLite/SQLiteFunction.cs
==================================================================
--- System.Data.SQLite/SQLiteFunction.cs
+++ System.Data.SQLite/SQLiteFunction.cs
@@ -375,11 +375,11 @@
_base.ReturnError(context, r.Message);
return;
}
}
- switch (SQLiteConvert.TypeToAffinity(t))
+ switch (SQLiteConvert.TypeToAffinity(t, _flags))
{
case TypeAffinity.Null:
_base.ReturnNull(context);
return;
case TypeAffinity.Int64:
Index: System.Data.SQLite/SQLiteStatement.cs
==================================================================
--- System.Data.SQLite/SQLiteStatement.cs
+++ System.Data.SQLite/SQLiteStatement.cs
@@ -432,10 +432,22 @@
obj.ToString());
}
return;
}
+
+ if ((_flags & SQLiteConnectionFlags.BindDecimalAsText) == SQLiteConnectionFlags.BindDecimalAsText)
+ {
+ if (obj is Decimal)
+ {
+ _sql.Bind_Text(this, _flags, index, invariantText ?
+ SQLiteConvert.ToStringWithProvider(obj, invariantCultureInfo) :
+ obj.ToString());
+
+ return;
+ }
+ }
CultureInfo cultureInfo = CultureInfo.CurrentCulture;
if ((_flags & SQLiteConnectionFlags.ConvertInvariantText) == SQLiteConnectionFlags.ConvertInvariantText)
cultureInfo = invariantCultureInfo;
Index: Tests/tkt-56b42d99c1.eagle
==================================================================
--- Tests/tkt-56b42d99c1.eagle
+++ Tests/tkt-56b42d99c1.eagle
@@ -97,11 +97,11 @@
} result] : [set result ""]}] $result
} -cleanup {
cleanupDb $fileName
unset -nocomplain result results errors code dataSource id db fileName
-} -constraints {eagle command.object monoBug211 monoBug46 command.sql\
+} -constraints {eagle command.object monoBug211 monoBug50 command.sql\
compile.DATA SQLite System.Data.SQLite compileCSharp} -match regexp -result \
{^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 True$}}
###############################################################################
@@ -174,11 +174,11 @@
} result] : [set result ""]}] $result
} -cleanup {
cleanupDb $fileName
unset -nocomplain result results errors code sql dataSource id db fileName
-} -constraints {eagle command.object monoBug211 monoBug46 command.sql\
+} -constraints {eagle command.object monoBug211 monoBug50 command.sql\
compile.DATA SQLite System.Data.SQLite compileCSharp} -match regexp -result \
{^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 0$}}
###############################################################################
@@ -405,11 +405,11 @@
} result] : [set result ""]}] $result
} -cleanup {
cleanupDb $fileName
unset -nocomplain result results errors code sql dataSource id db fileName
-} -constraints {eagle command.object monoBug211 monoBug46 command.sql\
+} -constraints {eagle command.object monoBug211 monoBug50 command.sql\
compile.DATA SQLite System.Data.SQLite compileCSharp} -match regexp -result \
{^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 1$}}
###############################################################################
@@ -494,11 +494,11 @@
} result] : [set result ""]}] $result
} -cleanup {
cleanupDb $fileName
unset -nocomplain result results errors code dataSource id db fileName
-} -constraints {eagle command.object monoBug28 monoBug211 monoBug46 command.sql\
+} -constraints {eagle command.object monoBug28 monoBug211 monoBug50 command.sql\
compile.DATA SQLite System.Data.SQLite compileCSharp} -match regexp -result \
{^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 True$}}
###############################################################################
@@ -571,11 +571,11 @@
} result] : [set result ""]}] $result
} -cleanup {
cleanupDb $fileName
unset -nocomplain result results errors code sql dataSource id db fileName
-} -constraints {eagle command.object monoBug28 monoBug211 monoBug46 command.sql\
+} -constraints {eagle command.object monoBug28 monoBug211 monoBug50 command.sql\
compile.DATA SQLite System.Data.SQLite compileCSharp} -match regexp -result \
{^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 0$}}
###############################################################################
@@ -802,11 +802,11 @@
} result] : [set result ""]}] $result
} -cleanup {
cleanupDb $fileName
unset -nocomplain result results errors code sql dataSource id db fileName
-} -constraints {eagle command.object monoBug28 monoBug211 monoBug46 command.sql\
+} -constraints {eagle command.object monoBug28 monoBug211 monoBug50 command.sql\
compile.DATA SQLite System.Data.SQLite compileCSharp} -match regexp -result \
{^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 1$}}
###############################################################################
ADDED Tests/tkt-b167206ad3.eagle
Index: Tests/tkt-b167206ad3.eagle
==================================================================
--- /dev/null
+++ Tests/tkt-b167206ad3.eagle
@@ -0,0 +1,342 @@
+###############################################################################
+#
+# tkt-b167206ad3.eagle --
+#
+# Written by Joe Mistachkin.
+# Released to the public domain, use at your own risk!
+#
+###############################################################################
+
+package require Eagle
+package require Eagle.Library
+package require Eagle.Test
+
+runTestPrologue
+
+###############################################################################
+
+package require System.Data.SQLite.Test
+runSQLiteTestPrologue
+
+###############################################################################
+
+runTest {test tkt-b167206ad3-1.1 {type affinity for DECIMAL} -setup {
+ setupDb [set fileName tkt-b167206ad3-1.1.db]
+} -body {
+ sql execute $db {
+ CREATE TABLE t1(x INTEGER, y DECIMAL(38,9));
+ INSERT INTO t1 (x, y) VALUES(1, 123456789123456780);
+ INSERT INTO t1 (x, y) VALUES(2, '123456789123456780');
+ }
+
+ set dataReader [sql execute \
+ -execute reader -format datareader \
+ -alias $db "SELECT x, y FROM t1 ORDER BY x;"]
+
+ set result [list]
+
+ while {[$dataReader Read]} {
+ set x [$dataReader -create -alias GetValue 0]
+ set y1 [$dataReader -create -alias GetDecimal 1]
+ set y2 [$dataReader -create -alias GetValue 1]
+
+ lappend result [list [$x ToString] [$y1 ToString] [$y2 ToString]]
+ }
+
+ set result
+} -cleanup {
+ unset -nocomplain dataReader
+
+ cleanupDb $fileName
+
+ unset -nocomplain y2 y1 x result db fileName
+} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
+System.Data.SQLite} -result {{1 123456789123456780 123456789123457000} {2\
+123456789123456780 123456789123457000}}}
+
+###############################################################################
+
+runTest {test tkt-b167206ad3-1.2 {type affinity for DECIMAL} -setup {
+ setupDb [set fileName tkt-b167206ad3-1.2.db] "" "" "" GetDecimalAsText
+} -body {
+ sql execute $db {
+ CREATE TABLE t1(x INTEGER, y DECIMAL(38,9));
+ INSERT INTO t1 (x, y) VALUES(1, 123456789123456780);
+ INSERT INTO t1 (x, y) VALUES(2, '123456789123456780');
+ }
+
+ set dataReader [sql execute \
+ -execute reader -format datareader \
+ -alias $db "SELECT x, y FROM t1 ORDER BY x;"]
+
+ set result [list]
+
+ while {[$dataReader Read]} {
+ set x [$dataReader -create -alias GetValue 0]
+ set y1 [$dataReader -create -alias GetDecimal 1]
+ set y2 [$dataReader -create -alias GetValue 1]
+
+ lappend result [list [$x ToString] [$y1 ToString] [$y2 ToString]]
+ }
+
+ set result
+} -cleanup {
+ unset -nocomplain dataReader
+
+ cleanupDb $fileName
+
+ unset -nocomplain y2 y1 x result db fileName
+} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
+System.Data.SQLite} -result {{1 123456789123456780 123456789123456780} {2\
+123456789123456780 123456789123456780}}}
+
+###############################################################################
+
+runTest {test tkt-b167206ad3-1.3 {type affinity for NUMERIC} -setup {
+ setupDb [set fileName tkt-b167206ad3-1.3.db]
+} -body {
+ sql execute $db {
+ CREATE TABLE t1(x INTEGER, y NUMERIC);
+ INSERT INTO t1 (x, y) VALUES(1, 123456789123456780);
+ INSERT INTO t1 (x, y) VALUES(2, '123456789123456780');
+ }
+
+ set dataReader [sql execute \
+ -execute reader -format datareader \
+ -alias $db "SELECT x, y FROM t1 ORDER BY x;"]
+
+ set result [list]
+
+ while {[$dataReader Read]} {
+ set x [$dataReader -create -alias GetValue 0]
+ set y1 [$dataReader -create -alias GetDecimal 1]
+ set y2 [$dataReader -create -alias GetValue 1]
+
+ lappend result [list [$x ToString] [$y1 ToString] [$y2 ToString]]
+ }
+
+ set result
+} -cleanup {
+ unset -nocomplain dataReader
+
+ cleanupDb $fileName
+
+ unset -nocomplain y2 y1 x result db fileName
+} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
+System.Data.SQLite} -result {{1 123456789123456780 123456789123457000} {2\
+123456789123456780 123456789123457000}}}
+
+###############################################################################
+
+runTest {test tkt-b167206ad3-1.4 {type affinity for NUMERIC} -setup {
+ setupDb [set fileName tkt-b167206ad3-1.4.db] "" "" "" GetDecimalAsText
+} -body {
+ sql execute $db {
+ CREATE TABLE t1(x INTEGER, y NUMERIC);
+ INSERT INTO t1 (x, y) VALUES(1, 123456789123456780);
+ INSERT INTO t1 (x, y) VALUES(2, '123456789123456780');
+ }
+
+ set dataReader [sql execute \
+ -execute reader -format datareader \
+ -alias $db "SELECT x, y FROM t1 ORDER BY x;"]
+
+ set result [list]
+
+ while {[$dataReader Read]} {
+ set x [$dataReader -create -alias GetValue 0]
+ set y1 [$dataReader -create -alias GetDecimal 1]
+ set y2 [$dataReader -create -alias GetValue 1]
+
+ lappend result [list [$x ToString] [$y1 ToString] [$y2 ToString]]
+ }
+
+ set result
+} -cleanup {
+ unset -nocomplain dataReader
+
+ cleanupDb $fileName
+
+ unset -nocomplain y2 y1 x result db fileName
+} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
+System.Data.SQLite} -result {{1 123456789123456780 123456789123456780} {2\
+123456789123456780 123456789123456780}}}
+
+###############################################################################
+
+runTest {test tkt-b167206ad3-2.1 {bind type for DECIMALTEXT} -setup {
+ setupDb [set fileName tkt-b167206ad3-2.1.db]
+} -body {
+ sql execute $db {
+ CREATE TABLE t1(x INTEGER, y DECIMALTEXT(38,9));
+ }
+
+ set d(1) [object invoke -create Decimal Parse 123456789123456780]
+ set d(2) [object invoke -create Decimal Parse 12345678912345.1556346]
+
+ sql execute $db "INSERT INTO t1 (x, y) VALUES(1, ?);" \
+ [list param1 Decimal $d(1)]
+
+ sql execute $db "INSERT INTO t1 (x, y) VALUES(2, ?);" \
+ [list param1 Decimal $d(2)]
+
+ set dataReader [sql execute \
+ -execute reader -format datareader \
+ -alias $db "SELECT x, y FROM t1 ORDER BY x;"]
+
+ set result [list]
+
+ while {[$dataReader Read]} {
+ set x [$dataReader -create -alias GetValue 0]
+ set y1 [$dataReader -create -alias GetDecimal 1]
+ set y2 [$dataReader -create -alias GetValue 1]
+
+ lappend result [list [$x ToString] [$y1 ToString] [$y2 ToString]]
+ }
+
+ set result
+} -cleanup {
+ unset -nocomplain dataReader
+
+ cleanupDb $fileName
+
+ unset -nocomplain y2 y1 x d result db fileName
+} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
+System.Data.SQLite} -result {{1 123456789123456780 123456789123457000} {2\
+12345678912345.1556346 12345678912345.2}}}
+
+###############################################################################
+
+runTest {test tkt-b167206ad3-2.2 {bind type for DECIMALTEXT} -setup {
+ setupDb [set fileName tkt-b167206ad3-2.2.db] "" "" "" \
+ "BindDecimalAsText GetAllAsText"
+} -body {
+ sql execute $db {
+ CREATE TABLE t1(x INTEGER, y DECIMALTEXT(38,9));
+ }
+
+ set d(1) [object invoke -create Decimal Parse 123456789123456780]
+ set d(2) [object invoke -create Decimal Parse 12345678912345.1556346]
+
+ sql execute $db "INSERT INTO t1 (x, y) VALUES(1, ?);" \
+ [list param1 Decimal $d(1)]
+
+ sql execute $db "INSERT INTO t1 (x, y) VALUES(2, ?);" \
+ [list param1 Decimal $d(2)]
+
+ set dataReader [sql execute \
+ -execute reader -format datareader \
+ -alias $db "SELECT x, y FROM t1 ORDER BY x;"]
+
+ set result [list]
+
+ while {[$dataReader Read]} {
+ set x [$dataReader -create -alias GetValue 0]
+ set y1 [$dataReader -create -alias GetDecimal 1]
+ set y2 [$dataReader -create -alias GetValue 1]
+
+ lappend result [list [$x ToString] [$y1 ToString] [$y2 ToString]]
+ }
+
+ set result
+} -cleanup {
+ unset -nocomplain dataReader
+
+ cleanupDb $fileName
+
+ unset -nocomplain y2 y1 x d result db fileName
+} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
+System.Data.SQLite} -result {{1 123456789123456780 123456789123456780} {2\
+12345678912345.1556346 12345678912345.1556346}}}
+
+###############################################################################
+
+runTest {test tkt-b167206ad3-2.3 {bind type for NUMERICTEXT} -setup {
+ setupDb [set fileName tkt-b167206ad3-2.3.db]
+} -body {
+ sql execute $db {
+ CREATE TABLE t1(x INTEGER, y NUMERICTEXT);
+ }
+
+ set d(1) [object invoke -create Decimal Parse 123456789123456780]
+ set d(2) [object invoke -create Decimal Parse 12345678912345.1556346]
+
+ sql execute $db "INSERT INTO t1 (x, y) VALUES(1, ?);" \
+ [list param1 Decimal $d(1)]
+
+ sql execute $db "INSERT INTO t1 (x, y) VALUES(2, ?);" \
+ [list param1 Decimal $d(2)]
+
+ set dataReader [sql execute \
+ -execute reader -format datareader \
+ -alias $db "SELECT x, y FROM t1 ORDER BY x;"]
+
+ set result [list]
+
+ while {[$dataReader Read]} {
+ set x [$dataReader -create -alias GetValue 0]
+ set y1 [$dataReader -create -alias GetDecimal 1]
+ set y2 [$dataReader -create -alias GetValue 1]
+
+ lappend result [list [$x ToString] [$y1 ToString] [$y2 ToString]]
+ }
+
+ set result
+} -cleanup {
+ unset -nocomplain dataReader
+
+ cleanupDb $fileName
+
+ unset -nocomplain y2 y1 x d result db fileName
+} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
+System.Data.SQLite} -result {{1 123456789123456780 123456789123457000} {2\
+12345678912345.1556346 12345678912345.2}}}
+
+###############################################################################
+
+runTest {test tkt-b167206ad3-2.4 {bind type for NUMERICTEXT} -setup {
+ setupDb [set fileName tkt-b167206ad3-2.4.db] "" "" "" \
+ "BindDecimalAsText GetAllAsText"
+} -body {
+ sql execute $db {
+ CREATE TABLE t1(x INTEGER, y NUMERICTEXT);
+ }
+
+ set d(1) [object invoke -create Decimal Parse 123456789123456780]
+ set d(2) [object invoke -create Decimal Parse 12345678912345.1556346]
+
+ sql execute $db "INSERT INTO t1 (x, y) VALUES(1, ?);" \
+ [list param1 Decimal $d(1)]
+
+ sql execute $db "INSERT INTO t1 (x, y) VALUES(2, ?);" \
+ [list param1 Decimal $d(2)]
+
+ set dataReader [sql execute \
+ -execute reader -format datareader \
+ -alias $db "SELECT x, y FROM t1 ORDER BY x;"]
+
+ set result [list]
+
+ while {[$dataReader Read]} {
+ set x [$dataReader -create -alias GetValue 0]
+ set y1 [$dataReader -create -alias GetDecimal 1]
+ set y2 [$dataReader -create -alias GetValue 1]
+
+ lappend result [list [$x ToString] [$y1 ToString] [$y2 ToString]]
+ }
+
+ set result
+} -cleanup {
+ unset -nocomplain dataReader
+
+ cleanupDb $fileName
+
+ unset -nocomplain y2 y1 x d result db fileName
+} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
+System.Data.SQLite} -result {{1 123456789123456780 123456789123456780} {2\
+12345678912345.1556346 12345678912345.1556346}}}
+
+###############################################################################
+
+runSQLiteTestEpilogue
+runTestEpilogue
Index: lib/System.Data.SQLite/common.eagle
==================================================================
--- lib/System.Data.SQLite/common.eagle
+++ lib/System.Data.SQLite/common.eagle
@@ -1681,10 +1681,19 @@
} else {
tputs $channel [appendArgs "yes (" $platform ")\n"]
}
} else {
tputs $channel no\n
+
+ if {![file exists $directory] || \
+ ![file isdirectory $directory]} then {
+ tputs $channel [appendArgs \
+ "---- environment variable \"System.Data.SQLite\" is an " \
+ "invalid directory, skipping check for releases...\n"]
+
+ return false
+ }
foreach path [lsort -decreasing [file list $directory *]] {
if {[file exists $path] && [file isdirectory $path]} then {
tputs $channel [appendArgs \
"---- checking for System.Data.SQLite release \"" \
Index: readme.htm
==================================================================
--- readme.htm
+++ readme.htm
@@ -3,12 +3,12 @@
ADO.NET SQLite Data Provider
-Version 1.0.106.0 - August XX, 2017 (release scheduled)
-Using SQLite 3.20.0
Originally written by Robert Simpson
+Version 1.0.106.0 - September XX, 2017 (release scheduled)
+Using SQLite 3.20.1
Originally written by Robert Simpson
Released to the public domain, use at your own risk!
Official provider website: https://system.data.sqlite.org/
Legacy versions: https://sourceforge.net/projects/sqlite-dotnet2/
The current development version can be downloaded from
@@ -206,14 +206,15 @@
Version History
- 1.0.106.0 - August XX, 2017 (release scheduled)
+ 1.0.106.0 - September XX, 2017 (release scheduled)
- - Updated to SQLite 3.20.0.
+ - Updated to SQLite 3.20.1.
+ - Add BindDecimalAsText and GetDecimalAsText connection flags to force binding and returning of decimal values as text. Pursuant to [b167206ad3].
- Add preliminary support for Visual Studio 2017 and the .NET Framework 4.7.
1.0.105.2 - June 12, 2017
Index: www/news.wiki
==================================================================
--- www/news.wiki
+++ www/news.wiki
@@ -43,14 +43,15 @@
Version History
- 1.0.106.0 - August XX, 2017 (release scheduled)
+ 1.0.106.0 - September XX, 2017 (release scheduled)
- - Updated to [https://www.sqlite.org/draft/releaselog/3_20_0.html|SQLite 3.20.0].
+ - Updated to [https://www.sqlite.org/releaselog/3_20_1.html|SQLite 3.20.1].
+ - Add BindDecimalAsText and GetDecimalAsText connection flags to force binding and returning of decimal values as text. Pursuant to [b167206ad3].
- Add preliminary support for Visual Studio 2017 and the .NET Framework 4.7.
1.0.105.2 - June 12, 2017