System.Data.SQLite
Check-in [16f09dbc53]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove the now unused SQLiteConvert.ColumnToType method. Add TraceWarning connection flag to enable tracing of type mapping failures and disable tracing of them by default, pursuant to [6d45c782e4]. Update internal error message list to include SQLITE_NOTICE and SQLITE_WARNING. Update internal SQLiteConfigOpsEnum enumeration to include recently added values in the SQLite core library.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 16f09dbc5392fb53b2e8f964de3cdb74e8f2ca1f
User & Date: mistachkin 2013-12-11 07:54:09
References
2014-02-13
19:16 Closed ticket [6d45c782e4]: lots of 'WARNING: Type mapping failed' in logs plus 6 other changes artifact: 5b11caa108 user: mistachkin
2013-12-11
07:55 Closed ticket [6d45c782e4]. artifact: 143c9289e4 user: mistachkin
Context
2013-12-18
05:33
Update Eagle in externals to the pending beta 29 release. check-in: c0de75b66e user: mistachkin tags: trunk
2013-12-11
07:54
Remove the now unused SQLiteConvert.ColumnToType method. Add TraceWarning connection flag to enable tracing of type mapping failures and disable tracing of them by default, pursuant to [6d45c782e4]. Update internal error message list to include SQLITE_NOTICE and SQLITE_WARNING. Update internal SQLiteConfigOpsEnum enumeration to include recently added values in the SQLite core library. check-in: 16f09dbc53 user: mistachkin tags: trunk
2013-12-06
21:35
Update SQLite core library to the official 3.8.2 release. check-in: b4899f4421 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite.Linq/SQLiteProviderServices.cs.

   361    361         SQLiteCommandBuilder builder = new SQLiteCommandBuilder();
   362    362   
   363    363         using (SQLiteCommand cmd = cnn.CreateCommand())
   364    364         using (DataTable source = new DataTable())
   365    365         {
   366    366           sql.AppendFormat(CultureInfo.InvariantCulture, "CREATE TEMP TABLE {0} (", builder.QuoteIdentifier(dest));
   367    367           string separator = String.Empty;
          368  +        SQLiteConnectionFlags flags = cnn.Flags;
   368    369           foreach (DataColumn dc in table.Columns)
   369    370           {
   370    371             DbType dbtypeName = SQLiteConvert.TypeToDbType(dc.DataType);
   371         -          string typeName = SQLiteConvert.DbTypeToTypeName(dbtypeName);
          372  +          string typeName = SQLiteConvert.DbTypeToTypeName(dbtypeName, flags);
   372    373   
   373    374             sql.AppendFormat(CultureInfo.InvariantCulture, "{2}{0} {1} COLLATE NOCASE", builder.QuoteIdentifier(dc.ColumnName), typeName, separator);
   374    375             separator = ", ";
   375    376           }
   376    377           sql.Append(")");
   377    378   
   378    379           cmd.CommandText = sql.ToString();

Changes to System.Data.SQLite/SQLiteBase.cs.

     1      1   /********************************************************
     2      2    * ADO.NET 2.0 Data Provider for SQLite Version 3.X
     3      3    * Written by Robert Simpson (robert@blackcastlesoft.com)
     4         - * 
            4  + *
     5      5    * Released to the public domain, use at your own risk!
     6      6    ********************************************************/
     7      7   
     8      8   namespace System.Data.SQLite
     9      9   {
    10     10     using System;
    11     11   
................................................................................
   158    158       /// <summary>
   159    159       /// Steps through a prepared statement.
   160    160       /// </summary>
   161    161       /// <param name="stmt">The SQLiteStatement to step through</param>
   162    162       /// <returns>True if a row was returned, False if not.</returns>
   163    163       internal abstract bool Step(SQLiteStatement stmt);
   164    164       /// <summary>
   165         -    /// Resets a prepared statement so it can be executed again.  If the error returned is SQLITE_SCHEMA, 
          165  +    /// Resets a prepared statement so it can be executed again.  If the error returned is SQLITE_SCHEMA,
   166    166       /// transparently attempt to rebuild the SQL statement and throw an error if that was not possible.
   167    167       /// </summary>
   168    168       /// <param name="stmt">The statement to reset</param>
   169    169       /// <returns>Returns -1 if the schema changed while resetting, 0 if the reset was sucessful or 6 (SQLITE_LOCKED) if the reset failed due to a lock</returns>
   170    170       internal abstract SQLiteErrorCode Reset(SQLiteStatement stmt);
   171    171   
   172    172       /// <summary>
................................................................................
   349    349       /// <summary>
   350    350       /// Enables or disabled extened result codes returned by SQLite
   351    351       /// </summary>
   352    352       /// <param name="bOnOff">true to enable extended result codes, false to disable.</param>
   353    353       /// <returns></returns>
   354    354       internal abstract void SetExtendedResultCodes(bool bOnOff);
   355    355       /// <summary>
   356         -    /// Returns the numeric result code for the most recent failed SQLite API call 
   357         -    /// associated with the database connection. 
          356  +    /// Returns the numeric result code for the most recent failed SQLite API call
          357  +    /// associated with the database connection.
   358    358       /// </summary>
   359    359       /// <returns>Result code</returns>
   360    360       internal abstract SQLiteErrorCode ResultCode();
   361    361       /// <summary>
   362         -    /// Returns the extended numeric result code for the most recent failed SQLite API call 
   363         -    /// associated with the database connection. 
          362  +    /// Returns the extended numeric result code for the most recent failed SQLite API call
          363  +    /// associated with the database connection.
   364    364       /// </summary>
   365    365       /// <returns>Extended result code</returns>
   366    366       internal abstract SQLiteErrorCode ExtendedResultCode();
   367    367   
   368    368       /// <summary>
   369    369       /// Add a log message via the SQLite sqlite3_log interface.
   370    370       /// </summary>
   371    371       /// <param name="iErrCode">Error code to be logged with the message.</param>
   372         -    /// <param name="zMessage">String to be logged.  Unlike the SQLite sqlite3_log() 
   373         -    /// interface, this should be pre-formatted.  Consider using the 
          372  +    /// <param name="zMessage">String to be logged.  Unlike the SQLite sqlite3_log()
          373  +    /// interface, this should be pre-formatted.  Consider using the
   374    374       /// String.Format() function.</param>
   375    375       /// <returns></returns>
   376    376       internal abstract void LogMessage(SQLiteErrorCode iErrCode, string zMessage);
   377    377   
   378    378   #if INTEROP_CODEC
   379    379       internal abstract void SetPassword(byte[] passwordBytes);
   380    380       internal abstract void ChangePassword(byte[] newPasswordBytes);
................................................................................
   553    553           /* SQLITE_CONSTRAINT  */ "constraint failed",
   554    554           /* SQLITE_MISMATCH    */ "datatype mismatch",
   555    555           /* SQLITE_MISUSE      */ "library routine called out of sequence",
   556    556           /* SQLITE_NOLFS       */ "large file support is disabled",
   557    557           /* SQLITE_AUTH        */ "authorization denied",
   558    558           /* SQLITE_FORMAT      */ "auxiliary database format error",
   559    559           /* SQLITE_RANGE       */ "bind or column index out of range",
   560         -        /* SQLITE_NOTADB      */ "file is encrypted or is not a database"
          560  +        /* SQLITE_NOTADB      */ "file is encrypted or is not a database",
          561  +        /* SQLITE_NOTICE      */ "notification message",
          562  +        /* SQLITE_WARNING     */ "warning message"
   561    563       };
   562    564   
   563    565       ///////////////////////////////////////////////////////////////////////////////////////////////
   564    566   
   565    567       /// <summary>
   566    568       /// Returns the error message for the specified SQLite return code using
   567    569       /// the internal static lookup table.
................................................................................
   971    973   
   972    974         /// <summary>
   973    975         /// Enable logging of certain virtual table module exceptions that cannot
   974    976         /// be easily discovered via other means.
   975    977         /// </summary>
   976    978         LogModuleException = 0x4000,
   977    979   
          980  +      /// <summary>
          981  +      /// Enable tracing of potentially important [non-fatal] error conditions
          982  +      /// that cannot be easily reported through other means.
          983  +      /// </summary>
          984  +      TraceWarning = 0x8000,
          985  +
   978    986         /// <summary>
   979    987         /// When binding and returning column values, always treat them as though
   980    988         /// they were plain text (i.e. no numeric, date/time, or other conversions
   981    989         /// should be attempted).
   982    990         /// </summary>
   983    991         BindAndGetAllAsText = BindAllAsText | GetAllAsText,
   984    992   
................................................................................
   994   1002         /// </summary>
   995   1003         Default = LogCallbackException | LogModuleException
   996   1004     }
   997   1005   
   998   1006     // These are the options to the internal sqlite3_config call.
   999   1007     internal enum SQLiteConfigOpsEnum
  1000   1008     {
  1001         -    SQLITE_CONFIG_NONE = 0, // nil 
  1002         -    SQLITE_CONFIG_SINGLETHREAD = 1, // nil 
  1003         -    SQLITE_CONFIG_MULTITHREAD = 2, // nil 
  1004         -    SQLITE_CONFIG_SERIALIZED = 3, // nil 
  1005         -    SQLITE_CONFIG_MALLOC = 4, // sqlite3_mem_methods* 
  1006         -    SQLITE_CONFIG_GETMALLOC = 5, // sqlite3_mem_methods* 
  1007         -    SQLITE_CONFIG_SCRATCH = 6, // void*, int sz, int N 
  1008         -    SQLITE_CONFIG_PAGECACHE = 7, // void*, int sz, int N 
  1009         -    SQLITE_CONFIG_HEAP = 8, // void*, int nByte, int min 
  1010         -    SQLITE_CONFIG_MEMSTATUS = 9, // boolean 
  1011         -    SQLITE_CONFIG_MUTEX = 10, // sqlite3_mutex_methods* 
  1012         -    SQLITE_CONFIG_GETMUTEX = 11, // sqlite3_mutex_methods* 
         1009  +    SQLITE_CONFIG_NONE = 0, // nil
         1010  +    SQLITE_CONFIG_SINGLETHREAD = 1, // nil
         1011  +    SQLITE_CONFIG_MULTITHREAD = 2, // nil
         1012  +    SQLITE_CONFIG_SERIALIZED = 3, // nil
         1013  +    SQLITE_CONFIG_MALLOC = 4, // sqlite3_mem_methods*
         1014  +    SQLITE_CONFIG_GETMALLOC = 5, // sqlite3_mem_methods*
         1015  +    SQLITE_CONFIG_SCRATCH = 6, // void*, int sz, int N
         1016  +    SQLITE_CONFIG_PAGECACHE = 7, // void*, int sz, int N
         1017  +    SQLITE_CONFIG_HEAP = 8, // void*, int nByte, int min
         1018  +    SQLITE_CONFIG_MEMSTATUS = 9, // boolean
         1019  +    SQLITE_CONFIG_MUTEX = 10, // sqlite3_mutex_methods*
         1020  +    SQLITE_CONFIG_GETMUTEX = 11, // sqlite3_mutex_methods*
  1013   1021       // previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused
  1014         -    SQLITE_CONFIG_LOOKASIDE = 13, // int int 
  1015         -    SQLITE_CONFIG_PCACHE = 14, // sqlite3_pcache_methods* 
  1016         -    SQLITE_CONFIG_GETPCACHE = 15, // sqlite3_pcache_methods* 
  1017         -    SQLITE_CONFIG_LOG = 16, // xFunc, void* 
         1022  +    SQLITE_CONFIG_LOOKASIDE = 13, // int int
         1023  +    SQLITE_CONFIG_PCACHE = 14, // sqlite3_pcache_methods*
         1024  +    SQLITE_CONFIG_GETPCACHE = 15, // sqlite3_pcache_methods*
         1025  +    SQLITE_CONFIG_LOG = 16, // xFunc, void*
         1026  +    SQLITE_CONFIG_URI = 17, // int
         1027  +    SQLITE_CONFIG_PCACHE2 = 18, // sqlite3_pcache_methods2*
         1028  +    SQLITE_CONFIG_GETPCACHE2 = 19, // sqlite3_pcache_methods2*
         1029  +    SQLITE_CONFIG_COVERING_INDEX_SCAN = 20, // int
         1030  +    SQLITE_CONFIG_SQLLOG = 21, // xSqllog, void*
         1031  +    SQLITE_CONFIG_MMAP_SIZE = 22, // sqlite3_int64, sqlite3_int64
         1032  +    SQLITE_CONFIG_WIN32_HEAPSIZE = 23 // int nByte
  1018   1033     }
  1019         -
  1020   1034   }

Changes to System.Data.SQLite/SQLiteCommand.cs.

   247    247       }
   248    248       #endregion
   249    249   
   250    250       ///////////////////////////////////////////////////////////////////////////////////////////////
   251    251   
   252    252       /// <summary>
   253    253       /// This method attempts to query the flags associated with the database
   254         -    /// connection in use.  If the database connection is disposed or any other
   255         -    /// error occurs, the default flags will be returned.
          254  +    /// connection in use.  If the database connection is disposed, the default
          255  +    /// flags will be returned.
   256    256       /// </summary>
   257    257       /// <param name="command">
   258    258       /// The command containing the databse connection to query the flags from.
   259    259       /// </param>
   260    260       /// <returns>
   261    261       /// The connection flags value.
   262    262       /// </returns>

Changes to System.Data.SQLite/SQLiteConnection.cs.

  3281   3281                       row["COLUMN_NAME"] = schemaRow[SchemaTableColumn.ColumnName];
  3282   3282                       row["TABLE_CATALOG"] = strCatalog;
  3283   3283                       row["ORDINAL_POSITION"] = schemaRow[SchemaTableColumn.ColumnOrdinal];
  3284   3284                       row["COLUMN_HASDEFAULT"] = (schemaRow[SchemaTableOptionalColumn.DefaultValue] != DBNull.Value);
  3285   3285                       row["COLUMN_DEFAULT"] = schemaRow[SchemaTableOptionalColumn.DefaultValue];
  3286   3286                       row["IS_NULLABLE"] = schemaRow[SchemaTableColumn.AllowDBNull];
  3287   3287                       row["DATA_TYPE"] = schemaRow["DataTypeName"].ToString().ToLower(CultureInfo.InvariantCulture);
  3288         -                    row["EDM_TYPE"] = SQLiteConvert.DbTypeToTypeName((DbType)schemaRow[SchemaTableColumn.ProviderType]).ToString().ToLower(CultureInfo.InvariantCulture);
         3288  +                    row["EDM_TYPE"] = SQLiteConvert.DbTypeToTypeName((DbType)schemaRow[SchemaTableColumn.ProviderType], _flags).ToString().ToLower(CultureInfo.InvariantCulture);
  3289   3289                       row["CHARACTER_MAXIMUM_LENGTH"] = schemaRow[SchemaTableColumn.ColumnSize];
  3290   3290                       row["TABLE_SCHEMA"] = schemaRow[SchemaTableColumn.BaseSchemaName];
  3291   3291                       row["PRIMARY_KEY"] = schemaRow[SchemaTableColumn.IsKey];
  3292   3292                       row["AUTOINCREMENT"] = schemaRow[SchemaTableOptionalColumn.IsAutoIncrement];
  3293   3293                       row["COLLATION_NAME"] = schemaRow["CollationType"];
  3294   3294                       row["UNIQUE"] = schemaRow[SchemaTableColumn.IsUnique];
  3295   3295                       tbl.Rows.Add(row);
................................................................................
  3972   3972                       row["COLUMN_NAME"] = schemaRow[SchemaTableColumn.BaseColumnName];
  3973   3973                       row["VIEW_COLUMN_NAME"] = viewRow[SchemaTableColumn.ColumnName];
  3974   3974                       row["COLUMN_HASDEFAULT"] = (viewRow[SchemaTableOptionalColumn.DefaultValue] != DBNull.Value);
  3975   3975                       row["COLUMN_DEFAULT"] = viewRow[SchemaTableOptionalColumn.DefaultValue];
  3976   3976                       row["ORDINAL_POSITION"] = viewRow[SchemaTableColumn.ColumnOrdinal];
  3977   3977                       row["IS_NULLABLE"] = viewRow[SchemaTableColumn.AllowDBNull];
  3978   3978                       row["DATA_TYPE"] = viewRow["DataTypeName"]; // SQLiteConvert.DbTypeToType((DbType)viewRow[SchemaTableColumn.ProviderType]).ToString();
  3979         -                    row["EDM_TYPE"] = SQLiteConvert.DbTypeToTypeName((DbType)viewRow[SchemaTableColumn.ProviderType]).ToString().ToLower(CultureInfo.InvariantCulture);
         3979  +                    row["EDM_TYPE"] = SQLiteConvert.DbTypeToTypeName((DbType)viewRow[SchemaTableColumn.ProviderType], _flags).ToString().ToLower(CultureInfo.InvariantCulture);
  3980   3980                       row["CHARACTER_MAXIMUM_LENGTH"] = viewRow[SchemaTableColumn.ColumnSize];
  3981   3981                       row["TABLE_SCHEMA"] = viewRow[SchemaTableColumn.BaseSchemaName];
  3982   3982                       row["PRIMARY_KEY"] = viewRow[SchemaTableColumn.IsKey];
  3983   3983                       row["AUTOINCREMENT"] = viewRow[SchemaTableOptionalColumn.IsAutoIncrement];
  3984   3984                       row["COLLATION_NAME"] = viewRow["CollationType"];
  3985   3985                       row["UNIQUE"] = viewRow[SchemaTableColumn.IsUnique];
  3986   3986                       tbl.Rows.Add(row);

Changes to System.Data.SQLite/SQLiteConvert.cs.

   775    775             return false;
   776    776           default:
   777    777             throw new ArgumentException("source");
   778    778         }
   779    779       }
   780    780   
   781    781       #region Type Conversions
   782         -    /// <summary>
   783         -    /// Determines the data type of a column in a statement
   784         -    /// </summary>
   785         -    /// <param name="stmt">The statement to retrieve information for</param>
   786         -    /// <param name="i">The column to retrieve type information on</param>
   787         -    /// <param name="typ">The SQLiteType to receive the affinity for the given column</param>
   788         -    internal static void ColumnToType(SQLiteStatement stmt, int i, SQLiteType typ)
   789         -    {
   790         -      typ.Type = TypeNameToDbType(stmt._sql.ColumnType(stmt, i, out typ.Affinity));
   791         -    }
   792         -
   793    782       /// <summary>
   794    783       /// Converts a SQLiteType to a .NET Type object
   795    784       /// </summary>
   796    785       /// <param name="t">The SQLiteType to convert</param>
   797    786       /// <returns>Returns a .NET Type object</returns>
   798    787       internal static Type SQLiteTypeToType(SQLiteType t)
   799    788       {
................................................................................
   960    949         DBNull.Value  // Xml (25)
   961    950       };
   962    951   
   963    952       /// <summary>
   964    953       /// Determines the type name for the given database value type.
   965    954       /// </summary>
   966    955       /// <param name="typ">The database value type.</param>
          956  +    /// <param name="flags">The flags associated with the parent connection object.</param>
   967    957       /// <returns>The type name or an empty string if it cannot be determined.</returns>
   968         -    internal static string DbTypeToTypeName(DbType typ)
          958  +    internal static string DbTypeToTypeName(DbType typ, SQLiteConnectionFlags flags)
   969    959       {
   970    960           lock (_syncRoot)
   971    961           {
   972    962               if (_typeNames == null)
   973    963                   _typeNames = GetSQLiteDbTypeMap();
   974    964   
   975    965               SQLiteDbTypeMapping value;
................................................................................
   977    967               if (_typeNames.TryGetValue(typ, out value))
   978    968                   return value.typeName;
   979    969           }
   980    970   
   981    971           string defaultTypeName = String.Empty;
   982    972   
   983    973   #if !NET_COMPACT_20 && TRACE_WARNING
   984         -        Trace.WriteLine(String.Format(
   985         -            CultureInfo.CurrentCulture,
   986         -            "WARNING: Type mapping failed, returning default name \"{0}\" for type {1}.",
   987         -            defaultTypeName, typ));
          974  +        if ((flags & SQLiteConnectionFlags.TraceWarning) == SQLiteConnectionFlags.TraceWarning)
          975  +        {
          976  +            Trace.WriteLine(String.Format(
          977  +                CultureInfo.CurrentCulture,
          978  +                "WARNING: Type mapping failed, returning default name \"{0}\" for type {1}.",
          979  +                defaultTypeName, typ));
          980  +        }
   988    981   #endif
   989    982   
   990    983           return defaultTypeName;
   991    984       }
   992    985   
   993    986       /// <summary>
   994    987       /// Convert a DbType to a Type
................................................................................
  1155   1148           });
  1156   1149       }
  1157   1150   
  1158   1151       /// <summary>
  1159   1152       /// For a given type name, return a closest-match .NET type
  1160   1153       /// </summary>
  1161   1154       /// <param name="Name">The name of the type to match</param>
         1155  +    /// <param name="flags">The flags associated with the parent connection object.</param>
  1162   1156       /// <returns>The .NET DBType the text evaluates to.</returns>
  1163         -    internal static DbType TypeNameToDbType(string Name)
         1157  +    internal static DbType TypeNameToDbType(string Name, SQLiteConnectionFlags flags)
  1164   1158       {
  1165   1159           lock (_syncRoot)
  1166   1160           {
  1167   1161               if (_typeNames == null)
  1168   1162                   _typeNames = GetSQLiteDbTypeMap();
  1169   1163   
  1170   1164               if (String.IsNullOrEmpty(Name)) return DbType.Object;
................................................................................
  1186   1180                   }
  1187   1181               }
  1188   1182           }
  1189   1183   
  1190   1184           DbType defaultDbType = DbType.Object;
  1191   1185   
  1192   1186   #if !NET_COMPACT_20 && TRACE_WARNING
  1193         -        Trace.WriteLine(String.Format(
  1194         -            CultureInfo.CurrentCulture,
  1195         -            "WARNING: Type mapping failed, returning default type {0} for name \"{1}\".",
  1196         -            defaultDbType, Name));
         1187  +        if ((flags & SQLiteConnectionFlags.TraceWarning) == SQLiteConnectionFlags.TraceWarning)
         1188  +        {
         1189  +            Trace.WriteLine(String.Format(
         1190  +                CultureInfo.CurrentCulture,
         1191  +                "WARNING: Type mapping failed, returning default type {0} for name \"{1}\".",
         1192  +                defaultDbType, Name));
         1193  +        }
  1197   1194   #endif
  1198   1195   
  1199   1196           return defaultDbType;
  1200   1197       }
  1201   1198       #endregion
  1202   1199   
  1203   1200       private static object _syncRoot = new object();

Changes to System.Data.SQLite/SQLiteDataReader.cs.

  1290   1290   
  1291   1291           if ((_commandBehavior & CommandBehavior.KeyInfo) != 0)
  1292   1292             LoadKeyInfo();
  1293   1293   
  1294   1294           return true;
  1295   1295         }
  1296   1296       }
         1297  +
         1298  +    /// <summary>
         1299  +    /// This method attempts to query the flags associated with the database
         1300  +    /// connection in use.  If the database connection is disposed, the default
         1301  +    /// flags will be returned.
         1302  +    /// </summary>
         1303  +    /// <param name="dataReader">
         1304  +    /// The data reader containing the databse connection to query the flags from.
         1305  +    /// </param>
         1306  +    /// <returns>
         1307  +    /// The connection flags value.
         1308  +    /// </returns>
         1309  +    internal static SQLiteConnectionFlags GetFlags(
         1310  +        SQLiteDataReader dataReader
         1311  +        )
         1312  +    {
         1313  +        try
         1314  +        {
         1315  +            if (dataReader != null)
         1316  +            {
         1317  +                SQLiteCommand command = dataReader._command;
         1318  +
         1319  +                if (command != null)
         1320  +                    return SQLiteCommand.GetFlags(command);
         1321  +            }
         1322  +        }
         1323  +        catch (ObjectDisposedException)
         1324  +        {
         1325  +            // do nothing.
         1326  +        }
         1327  +
         1328  +        return SQLiteConnectionFlags.Default;
         1329  +    }
  1297   1330   
  1298   1331       /// <summary>
  1299   1332       /// Retrieves the SQLiteType for a given column, and caches it to avoid repetetive interop calls.
  1300   1333       /// </summary>
  1301   1334       /// <param name="i">The index of the column to retrieve</param>
  1302   1335       /// <returns>A SQLiteType structure</returns>
  1303   1336       private SQLiteType GetSQLiteType(int i)
................................................................................
  1312   1345         if (_fieldTypeArray[i] == null) _fieldTypeArray[i] = new SQLiteType();
  1313   1346   
  1314   1347         typ = _fieldTypeArray[i];
  1315   1348   
  1316   1349         // If not initialized, then fetch the declared column datatype and attempt to convert it
  1317   1350         // to a known DbType.
  1318   1351         if (typ.Affinity == TypeAffinity.Uninitialized)
  1319         -        typ.Type = SQLiteConvert.TypeNameToDbType(_activeStatement._sql.ColumnType(_activeStatement, i, out typ.Affinity));
         1352  +        typ.Type = SQLiteConvert.TypeNameToDbType(_activeStatement._sql.ColumnType(_activeStatement, i, out typ.Affinity), GetFlags(this));
  1320   1353         else
  1321   1354           typ.Affinity = _activeStatement._sql.ColumnAffinity(_activeStatement, i);
  1322   1355   
  1323   1356         return typ;
  1324   1357       }
  1325   1358   
  1326   1359       /// <summary>

Changes to Tests/basic.eagle.

  1452   1452   } -constraints {eagle SQLite System.Data.SQLite System.Data.SQLite.Linq} \
  1453   1453   -result {}}
  1454   1454   
  1455   1455   ###############################################################################
  1456   1456   
  1457   1457   runTest {test data-1.27 {VARCHAR / NVARCHAR types with spaces} -body {
  1458   1458     list [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
  1459         -      TypeNameToDbType VARCHAR] \
         1459  +      TypeNameToDbType VARCHAR None] \
         1460  +      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
         1461  +      TypeNameToDbType NVARCHAR None] \
         1462  +      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
         1463  +      TypeNameToDbType VARCHAR(1) None] \
  1460   1464         [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
  1461         -      TypeNameToDbType NVARCHAR] \
         1465  +      TypeNameToDbType NVARCHAR(1) None] \
  1462   1466         [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
  1463         -      TypeNameToDbType VARCHAR(1)] \
         1467  +      TypeNameToDbType "VARCHAR (1)" None] \
  1464   1468         [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
  1465         -      TypeNameToDbType NVARCHAR(1)] \
  1466         -      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
  1467         -      TypeNameToDbType "VARCHAR (1)"] \
  1468         -      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
  1469         -      TypeNameToDbType "NVARCHAR (1)"] \
         1469  +      TypeNameToDbType "NVARCHAR (1)" None] \
  1470   1470   } -constraints {eagle System.Data.SQLite} -result \
  1471   1471   {AnsiString String AnsiString String AnsiString String}}
  1472   1472   
  1473   1473   ###############################################################################
  1474   1474   
  1475   1475   runTest {test data-1.28 {SetMemoryStatus method} -setup {
  1476   1476     #
................................................................................
  2497   2497         LOGICAL LONG LONGCHAR LONGTEXT LONGVARCHAR MEMO MONEY NCHAR NOTE NTEXT \
  2498   2498         NUMBER NUMERIC NVARCHAR OLEOBJECT RAW REAL SINGLE SMALLDATE SMALLINT \
  2499   2499         SMALLUINT STRING TEXT TIME TIMESTAMP TINYINT TINYSINT UINT UINT8 UINT16 \
  2500   2500         UINT32 UINT64 ULONG UNIQUEIDENTIFIER UNSIGNEDINTEGER UNSIGNEDINTEGER8 \
  2501   2501         UNSIGNEDINTEGER16 UNSIGNEDINTEGER32 UNSIGNEDINTEGER64 VARBINARY VARCHAR \
  2502   2502         VARCHAR2 YESNO] {
  2503   2503       lappend result [list $typeName [object invoke -flags +NonPublic \
  2504         -        System.Data.SQLite.SQLiteConvert TypeNameToDbType $typeName]]
         2504  +        System.Data.SQLite.SQLiteConvert TypeNameToDbType $typeName None]]
  2505   2505     }
  2506   2506     set result
  2507   2507   } -cleanup {
  2508   2508     unset -nocomplain result typeName
  2509   2509   } -constraints {eagle System.Data.SQLite} -result {{BIGINT Int64} {BIGUINT\
  2510   2510   UInt64} {BINARY Binary} {BIT Boolean} {BLOB Binary} {BOOL Boolean} {BOOLEAN\
  2511   2511   Boolean} {CHAR AnsiStringFixedLength} {CLOB String} {COUNTER Int64} {CURRENCY\

Changes to Tests/tkt-47f4bac575.eagle.

    25     25   } -body {
    26     26     foreach dbType [list \
    27     27         AnsiString Binary Byte Boolean Currency Date DateTime Decimal \
    28     28         Double Guid Int16 Int32 Int64 Object SByte Single String Time \
    29     29         UInt16 UInt32 UInt64 VarNumeric AnsiStringFixedLength \
    30     30         StringFixedLength Xml DateTime2 DateTimeOffset] {
    31     31       lappend result [list $dbType [object invoke -flags +NonPublic \
    32         -        System.Data.SQLite.SQLiteConvert DbTypeToTypeName $dbType]]
           32  +        System.Data.SQLite.SQLiteConvert DbTypeToTypeName $dbType None]]
    33     33     }
    34     34     set result
    35     35   } -cleanup {
    36     36     unset -nocomplain result dbType
    37     37   } -constraints {eagle System.Data.SQLite} -result {{AnsiString VARCHAR} {Binary\
    38     38   BLOB} {Byte TINYINT} {Boolean BIT} {Currency {}} {Date {}} {DateTime DATETIME}\
    39     39   {Decimal DECIMAL} {Double REAL} {Guid UNIQUEIDENTIFIER} {Int16 SMALLINT} {Int32\

Changes to Tests/tkt-fe50b8c2e8.eagle.

    18     18   package require System.Data.SQLite.Test
    19     19   runSQLiteTestPrologue
    20     20   
    21     21   ###############################################################################
    22     22   
    23     23   runTest {test tkt-fe50b8c2e8-1.1 {compatibility data types} -body {
    24     24     list [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
    25         -      TypeNameToDbType VARCHAR2] \
           25  +      TypeNameToDbType VARCHAR2 None] \
           26  +      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
           27  +      TypeNameToDbType CLOB None] \
           28  +      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
           29  +      TypeNameToDbType NUMBER None] \
           30  +      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
           31  +      TypeNameToDbType RAW None] \
           32  +      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
           33  +      DbTypeToTypeName AnsiString None] \
    26     34         [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
    27         -      TypeNameToDbType CLOB] \
           35  +      DbTypeToTypeName String None] \
    28     36         [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
    29         -      TypeNameToDbType NUMBER] \
    30         -      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
    31         -      TypeNameToDbType RAW] \
           37  +      DbTypeToTypeName Decimal None] \
    32     38         [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
    33         -      DbTypeToTypeName AnsiString] \
    34         -      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
    35         -      DbTypeToTypeName String] \
    36         -      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
    37         -      DbTypeToTypeName Decimal] \
    38         -      [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \
    39         -      DbTypeToTypeName Binary]
           39  +      DbTypeToTypeName Binary None]
    40     40   } -constraints {eagle System.Data.SQLite} -result \
    41     41   {AnsiString String Decimal Binary VARCHAR NVARCHAR DECIMAL BLOB}}
    42     42   
    43     43   ###############################################################################
    44     44   
    45     45   runSQLiteTestEpilogue
    46     46   runTestEpilogue