System.Data.SQLite
Check-in [b8d115e87d]
Not logged in

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

Overview
Comment:The initial result code for SQLITE_DBCONFIG_MAINDBNAME must be an error in order to make the finally cleanup logic correct.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b8d115e87d4fc99629d8dbc487873d87ffd96667
User & Date: mistachkin 2018-02-26 17:36:34
Context
2018-02-26
19:17
Add tests for the database option values added via check-in [b7ba6996c1]. check-in: b3872ff42e user: mistachkin tags: trunk
17:36
The initial result code for SQLITE_DBCONFIG_MAINDBNAME must be an error in order to make the finally cleanup logic correct. check-in: b8d115e87d user: mistachkin tags: trunk
17:32
Update version history docs. check-in: 2d61f3fabf user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

  2860   2860                       {
  2861   2861                           throw new SQLiteException(HelperMethods.StringFormat(
  2862   2862                               CultureInfo.CurrentCulture,
  2863   2863                               "configuration value type mismatch, must be of type {0}",
  2864   2864                               typeof(string)));
  2865   2865                       }
  2866   2866   
  2867         -                    SQLiteErrorCode rc = SQLiteErrorCode.Ok;
         2867  +                    SQLiteErrorCode rc = SQLiteErrorCode.Error;
  2868   2868                       IntPtr pDbName = IntPtr.Zero;
  2869   2869   
  2870   2870                       try
  2871   2871                       {
  2872   2872                           pDbName = SQLiteString.Utf8IntPtrFromString(
  2873   2873                               (string)value);
  2874   2874   
................................................................................
  2881   2881   
  2882   2882                           rc = UnsafeNativeMethods.sqlite3_db_config_charptr(
  2883   2883                               _sql, option, pDbName);
  2884   2884   
  2885   2885                           if (rc == SQLiteErrorCode.Ok)
  2886   2886                           {
  2887   2887                               FreeDbName(true);
         2888  +
  2888   2889                               dbName = pDbName;
         2890  +                            pDbName = IntPtr.Zero;
  2889   2891                           }
  2890   2892                       }
  2891   2893                       finally
  2892   2894                       {
  2893   2895                           if ((rc != SQLiteErrorCode.Ok) &&
  2894   2896                               (pDbName != IntPtr.Zero))
  2895   2897                           {