Index: Doc/Extra/Provider/version.html
==================================================================
--- Doc/Extra/Provider/version.html
+++ Doc/Extra/Provider/version.html
@@ -47,10 +47,11 @@
- Updated to Entity Framework 6.1.1.
- Add RefreshFlags method to the SQLiteDataReader class to forcibly refresh its connection flags.
- Improve automatic detection and handling of the Entity Framework 6 assembly by the design-time components installer. Pursuant to [e634e330a6]. ** Potentially Incompatible Change **
- Improve SQLiteDataReader performance slightly by caching the connection flags. ** Potentially Incompatible Change **
+ - Add NoConvertSettings connection flag to disable querying of runtime configuration settings from within the SQLiteConvert class. Pursuant to [58ed318f2f].
- Minimize usage of the "Use_SQLiteConvert_DefaultDbType" and "Use_SQLiteConvert_DefaultTypeName" settings. Fix for [58ed318f2f]. ** Potentially Incompatible Change **
1.0.93.0 - June 23, 2014
- Updated to SQLite 3.8.5.
Index: System.Data.SQLite/SQLiteBase.cs
==================================================================
--- System.Data.SQLite/SQLiteBase.cs
+++ System.Data.SQLite/SQLiteBase.cs
@@ -1083,10 +1083,23 @@
/// ,
/// or types.
///
DetectStringType = 0x4000000,
+ ///
+ /// Skip querying runtime configuration settings for use by the
+ /// class, including the default
+ /// value and default database type name.
+ /// NOTE: If the
+ /// and/or
+ /// properties are not set explicitly nor set via their connection
+ /// string properties and repeated calls to determine these runtime
+ /// configuration settings are seen to be a problem, this flag
+ /// should be set.
+ ///
+ NoConvertSettings = 0x8000000,
+
///
/// 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
@@ -1093,15 +1093,29 @@
///
/// Determines the default database type name to be used when a
/// per-connection value is not available.
///
+ ///
+ /// The connection context for type mappings, if any.
+ ///
///
/// The default database type name to use.
///
- private static string GetDefaultTypeName()
+ private static string GetDefaultTypeName(
+ SQLiteConnection connection
+ )
{
+ SQLiteConnectionFlags flags = (connection != null) ?
+ connection.Flags : SQLiteConnectionFlags.None;
+
+ if ((flags & SQLiteConnectionFlags.NoConvertSettings)
+ == SQLiteConnectionFlags.NoConvertSettings)
+ {
+ return FallbackDefaultTypeName;
+ }
+
string value = UnsafeNativeMethods.GetSettingValue(
"Use_SQLiteConvert_DefaultTypeName", null);
if (value == null)
return FallbackDefaultTypeName;
@@ -1209,11 +1223,11 @@
if ((flags & SQLiteConnectionFlags.NoGlobalTypes) == SQLiteConnectionFlags.NoGlobalTypes)
{
if (defaultTypeName != null)
return defaultTypeName;
- defaultTypeName = GetDefaultTypeName();
+ defaultTypeName = GetDefaultTypeName(connection);
#if !NET_COMPACT_20 && TRACE_WARNING
DefaultTypeNameWarning(dbType, flags, defaultTypeName);
#endif
@@ -1232,11 +1246,11 @@
}
if (defaultTypeName != null)
return defaultTypeName;
- defaultTypeName = GetDefaultTypeName();
+ defaultTypeName = GetDefaultTypeName(connection);
#if !NET_COMPACT_20 && TRACE_WARNING
DefaultTypeNameWarning(dbType, flags, defaultTypeName);
#endif
@@ -1436,15 +1450,29 @@
///
/// Determines the default value to be used when a
/// per-connection value is not available.
///
+ ///
+ /// The connection context for type mappings, if any.
+ ///
///
/// The default value to use.
///
- private static DbType GetDefaultDbType()
+ private static DbType GetDefaultDbType(
+ SQLiteConnection connection
+ )
{
+ SQLiteConnectionFlags flags = (connection != null) ?
+ connection.Flags : SQLiteConnectionFlags.None;
+
+ if ((flags & SQLiteConnectionFlags.NoConvertSettings)
+ == SQLiteConnectionFlags.NoConvertSettings)
+ {
+ return FallbackDefaultDbType;
+ }
+
string value = UnsafeNativeMethods.GetSettingValue(
"Use_SQLiteConvert_DefaultDbType", null);
if (value == null)
return FallbackDefaultDbType;
@@ -1657,11 +1685,11 @@
if ((flags & SQLiteConnectionFlags.NoGlobalTypes) == SQLiteConnectionFlags.NoGlobalTypes)
{
if (defaultDbType != null)
return (DbType)defaultDbType;
- defaultDbType = GetDefaultDbType();
+ defaultDbType = GetDefaultDbType(connection);
#if !NET_COMPACT_20 && TRACE_WARNING
DefaultDbTypeWarning(typeName, flags, defaultDbType);
#endif
@@ -1695,11 +1723,11 @@
}
if (defaultDbType != null)
return (DbType)defaultDbType;
- defaultDbType = GetDefaultDbType();
+ defaultDbType = GetDefaultDbType(connection);
#if !NET_COMPACT_20 && TRACE_WARNING
DefaultDbTypeWarning(typeName, flags, defaultDbType);
#endif
Index: Tests/tkt-58ed318f2f.eagle
==================================================================
--- Tests/tkt-58ed318f2f.eagle
+++ Tests/tkt-58ed318f2f.eagle
@@ -18,14 +18,10 @@
package require System.Data.SQLite.Test
runSQLiteTestPrologue
###############################################################################
-reportSQLiteResources $test_channel true
-
-###############################################################################
-
proc getSettingReadCount { name } {
if {[haveConstraint buildConfiguration.Debug] && [catch {
object invoke -flags +NonPublic -alias \
System.Data.SQLite.UnsafeNativeMethods settingReadCounts
} settingReadCounts] == 0} then {
@@ -43,10 +39,14 @@
return -1
}
###############################################################################
+reportSQLiteResources $test_channel true
+
+###############################################################################
+
runTest {test tkt-58ed318f2f-1.1 {standard GetDefaultDbType usage} -setup {
setupDb [set fileName tkt-58ed318f2f-1.1.db]
} -body {
sql execute $db {
CREATE TABLE t1(x, y);
@@ -53,11 +53,13 @@
INSERT INTO t1 (x, y) VALUES(0, 1);
INSERT INTO t1 (x, y) VALUES('0', '1');
}
sql execute -execute reader -format list $db "SELECT x, y FROM t1;"
- expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == 2}
+
+ expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == 2 && \
+ [getSettingReadCount Use_SQLiteConvert_DefaultTypeName] == -1}
} -cleanup {
cleanupDb $fileName
unset -nocomplain db fileName
} -constraints \
@@ -78,11 +80,13 @@
INSERT INTO t1 (x, y) VALUES(0, 1);
INSERT INTO t1 (x, y) VALUES('0', '1');
}
sql execute -execute reader -format list $db "SELECT x, y FROM t1;"
- expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == 2}
+
+ expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == 2 && \
+ [getSettingReadCount Use_SQLiteConvert_DefaultTypeName] == -1}
} -cleanup {
cleanupDb $fileName
unset -nocomplain db fileName
} -constraints \
@@ -104,11 +108,13 @@
INSERT INTO t1 (x, y) VALUES(0, 1);
INSERT INTO t1 (x, y) VALUES('0', '1');
}
sql execute -execute reader -format list $db "SELECT x, y FROM t1;"
- expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == -1}
+
+ expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == -1 && \
+ [getSettingReadCount Use_SQLiteConvert_DefaultTypeName] == -1}
} -cleanup {
cleanupDb $fileName
unset -nocomplain db fileName
} -constraints \
@@ -130,15 +136,140 @@
INSERT INTO t1 (x, y) VALUES(0, 1);
INSERT INTO t1 (x, y) VALUES('0', '1');
}
sql execute -execute reader -format list $db "SELECT x, y FROM t1;"
+
+ expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == -1 && \
+ [getSettingReadCount Use_SQLiteConvert_DefaultTypeName] == -1}
+} -cleanup {
+ cleanupDb $fileName
+
+ unset -nocomplain db fileName
+} -constraints \
+{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite\
+buildConfiguration.Debug} -result {True}}
+
+###############################################################################
+
+reportSQLiteResources $test_channel true
+
+###############################################################################
+
+runTest {test tkt-58ed318f2f-1.5 {zero DefaultDbType settings read} -setup {
+ setupDb [set fileName tkt-58ed318f2f-1.5.db] "" "" "" NoConvertSettings
+} -body {
+ sql execute $db {
+ CREATE TABLE t1(x, y);
+ INSERT INTO t1 (x, y) VALUES(0, 1);
+ INSERT INTO t1 (x, y) VALUES('0', '1');
+ }
+
+ sql execute -execute reader -format list $db "SELECT x, y FROM t1;"
+
expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == -1}
} -cleanup {
cleanupDb $fileName
unset -nocomplain db fileName
+} -constraints \
+{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite\
+buildConfiguration.Debug} -result {True}}
+
+###############################################################################
+
+reportSQLiteResources $test_channel true
+
+###############################################################################
+
+runTest {test tkt-58ed318f2f-1.6 {zero DefaultTypeName settings read} -setup {
+ setupDb [set fileName tkt-58ed318f2f-1.6.db] "" "" "" NoConvertSettings
+} -body {
+ set connection [getDbConnection]
+
+ sql execute $db {
+ CREATE TABLE t1(x, y);
+ INSERT INTO t1 (x, y) VALUES(0, 1);
+ INSERT INTO t1 (x, y) VALUES('0', '1');
+ }
+
+ set columns [$connection GetSchema COLUMNS]
+
+ expr {[getSettingReadCount Use_SQLiteConvert_DefaultTypeName] == -1}
+} -cleanup {
+ cleanupDb $fileName
+
+ freeDbConnection
+
+ unset -nocomplain columns connection db fileName
+} -constraints \
+{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite\
+buildConfiguration.Debug} -result {True}}
+
+###############################################################################
+
+reportSQLiteResources $test_channel true
+
+###############################################################################
+
+runTest {test tkt-58ed318f2f-1.7 {normal SQLiteConvert settings usage} -setup {
+ setupDb [set fileName tkt-58ed318f2f-1.7.db]
+} -body {
+ set connection [getDbConnection]
+
+ sql execute $db {
+ CREATE TABLE t1(x, y);
+ INSERT INTO t1 (x, y) VALUES(0, 1);
+ INSERT INTO t1 (x, y) VALUES('0', '1');
+ }
+
+ sql execute -execute reader -format list $db "SELECT x, y FROM t1;"
+ set columns [$connection GetSchema COLUMNS]
+
+ #
+ # TODO: These counts may need to be updated in future versions.
+ #
+ expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == 7 && \
+ [getSettingReadCount Use_SQLiteConvert_DefaultTypeName] == 2}
+} -cleanup {
+ cleanupDb $fileName
+
+ freeDbConnection
+
+ unset -nocomplain columns connection db fileName
+} -constraints \
+{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite\
+buildConfiguration.Debug} -result {True}}
+
+###############################################################################
+
+reportSQLiteResources $test_channel true
+
+###############################################################################
+
+runTest {test tkt-58ed318f2f-1.8 {zero SQLiteConvert settings usage} -setup {
+ setupDb [set fileName tkt-58ed318f2f-1.8.db] "" "" "" NoConvertSettings
+} -body {
+ set connection [getDbConnection]
+
+ sql execute $db {
+ CREATE TABLE t1(x, y);
+ INSERT INTO t1 (x, y) VALUES(0, 1);
+ INSERT INTO t1 (x, y) VALUES('0', '1');
+ }
+
+ sql execute -execute reader -format list $db "SELECT x, y FROM t1;"
+ set columns [$connection GetSchema COLUMNS]
+
+ expr {[getSettingReadCount Use_SQLiteConvert_DefaultDbType] == -1 && \
+ [getSettingReadCount Use_SQLiteConvert_DefaultTypeName] == -1}
+} -cleanup {
+ cleanupDb $fileName
+
+ freeDbConnection
+
+ unset -nocomplain columns connection db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite\
buildConfiguration.Debug} -result {True}}
###############################################################################
Index: readme.htm
==================================================================
--- readme.htm
+++ readme.htm
@@ -214,10 +214,11 @@
- Updated to Entity Framework 6.1.1.
- Add RefreshFlags method to the SQLiteDataReader class to forcibly refresh its connection flags.
- Improve automatic detection and handling of the Entity Framework 6 assembly by the design-time components installer. Pursuant to [e634e330a6]. ** Potentially Incompatible Change **
- Improve SQLiteDataReader performance slightly by caching the connection flags. ** Potentially Incompatible Change **
+ - Add NoConvertSettings connection flag to disable querying of runtime configuration settings from within the SQLiteConvert class. Pursuant to [58ed318f2f].
- Minimize usage of the "Use_SQLiteConvert_DefaultDbType" and "Use_SQLiteConvert_DefaultTypeName" settings. Fix for [58ed318f2f]. ** Potentially Incompatible Change **
1.0.93.0 - June 23, 2014
Index: www/news.wiki
==================================================================
--- www/news.wiki
+++ www/news.wiki
@@ -8,10 +8,11 @@
- Updated to Entity Framework 6.1.1.
- Add RefreshFlags method to the SQLiteDataReader class to forcibly refresh its connection flags.
- Improve automatic detection and handling of the Entity Framework 6 assembly by the design-time components installer. Pursuant to [e634e330a6]. ** Potentially Incompatible Change **
- Improve SQLiteDataReader performance slightly by caching the connection flags. ** Potentially Incompatible Change **
+ - Add NoConvertSettings connection flag to disable querying of runtime configuration settings from within the SQLiteConvert class. Pursuant to [58ed318f2f].
- Minimize usage of the "Use_SQLiteConvert_DefaultDbType" and "Use_SQLiteConvert_DefaultTypeName" settings. Fix for [58ed318f2f]. ** Potentially Incompatible Change **
1.0.93.0 - June 23, 2014