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

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

Overview
Comment:Make sure that we interrupt any pending SQLite query if a custom collation method throws an exception. Also, enable logging of all callback exceptions by default.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: afe080eb9a3e36cc8ec19a03e95a98d249a798cd
User & Date: mistachkin 2012-02-20 13:48:48
Context
2012-02-21
04:11
Add test to verify interrupt behavior of the SQLiteFunction custom collation exception handling. check-in: 2849c1b713 user: mistachkin tags: trunk
2012-02-20
13:48
Make sure that we interrupt any pending SQLite query if a custom collation method throws an exception. Also, enable logging of all callback exceptions by default. check-in: afe080eb9a user: mistachkin tags: trunk
13:17
Add experimental support to the new design-time component installer for Visual Studio 2005. check-in: 6efd2f01bb user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
      /// Enable all logging.
      /// </summary>
      LogAll = LogPrepare | LogPreBind | LogBind | LogCallbackException,

      /// <summary>
      /// The default extra flags for new connections.
      /// </summary>
      Default = None
  }

  // These are the options to the internal sqlite3_config call.
  internal enum SQLiteConfigOpsEnum
  {
    SQLITE_CONFIG_NONE = 0, // nil 
    SQLITE_CONFIG_SINGLETHREAD = 1, // nil 







|







406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
      /// Enable all logging.
      /// </summary>
      LogAll = LogPrepare | LogPreBind | LogBind | LogCallbackException,

      /// <summary>
      /// The default extra flags for new connections.
      /// </summary>
      Default = LogCallbackException
  }

  // These are the options to the internal sqlite3_config call.
  internal enum SQLiteConfigOpsEnum
  {
    SQLITE_CONFIG_NONE = 0, // nil 
    SQLITE_CONFIG_SINGLETHREAD = 1, // nil 

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

448
449
450
451
452
453
454







455
456
457
458
459
460
461
...
494
495
496
497
498
499
500







501
502
503
504
505
506
507
#else
        catch /* NOTE: Must catch ALL. */
        {
            // do nothing (Windows CE).
        }
#endif








        return 0;
    }

    /// <summary>
    /// Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function.
    /// WARNING: Must not throw exceptions.
    /// </summary>
................................................................................
#else
        catch /* NOTE: Must catch ALL. */
        {
            // do nothing (Windows CE).
        }
#endif








        return 0;
    }

    /// <summary>
    /// The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method.
    /// WARNING: Must not throw exceptions.
    /// </summary>







>
>
>
>
>
>
>







 







>
>
>
>
>
>
>







448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
...
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
#else
        catch /* NOTE: Must catch ALL. */
        {
            // do nothing (Windows CE).
        }
#endif

        //
        // NOTE: This must be done to prevent the core SQLite library from
        //       using our (invalid) result.
        //
        if (_base != null)
            _base.Cancel();

        return 0;
    }

    /// <summary>
    /// Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function.
    /// WARNING: Must not throw exceptions.
    /// </summary>
................................................................................
#else
        catch /* NOTE: Must catch ALL. */
        {
            // do nothing (Windows CE).
        }
#endif

        //
        // NOTE: This must be done to prevent the core SQLite library from
        //       using our (invalid) result.
        //
        if (_base != null)
            _base.Cancel();

        return 0;
    }

    /// <summary>
    /// The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method.
    /// WARNING: Must not throw exceptions.
    /// </summary>

Changes to Tests/basic.eagle.

1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
Source=test\.db\} 0 \{test\.db, Uri=test\.db\} 0 \{60, Default Timeout=60\} 0\
\{False, Enlist=False\} 0 \{True, FailIfMissing=True\} 0 \{False, Legacy\
Format=False\} 0 \{True, Read Only=True\} 0 \{secret, Password=secret\} 0\
\{4096, Page Size=4096\} 0 \{1024, Max Page Count=1024\} 0 \{8192, Cache\
Size=8192\} 0 \{UnixEpoch, DateTimeFormat=UnixEpoch\} 0 \{Utc,\
DateTimeKind=Utc\} 0 \{sqlite_schema, BaseSchemaName=sqlite_schema\} 0\
\{Memory, Journal Mode=Memory\} 0 \{Serializable, Default\
IsolationLevel=Serializable\} 0 \{False, Foreign Keys=False\} 0 \{None,\
Flags=None\}$}}

###############################################################################

runTest {test data-1.17 {SQLiteConvert ToDateTime (Julian Day)} -body {
  set dateTime [object invoke System.Data.SQLite.SQLiteConvert ToDateTime \
      2455928.0 Utc]








|
|







1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
Source=test\.db\} 0 \{test\.db, Uri=test\.db\} 0 \{60, Default Timeout=60\} 0\
\{False, Enlist=False\} 0 \{True, FailIfMissing=True\} 0 \{False, Legacy\
Format=False\} 0 \{True, Read Only=True\} 0 \{secret, Password=secret\} 0\
\{4096, Page Size=4096\} 0 \{1024, Max Page Count=1024\} 0 \{8192, Cache\
Size=8192\} 0 \{UnixEpoch, DateTimeFormat=UnixEpoch\} 0 \{Utc,\
DateTimeKind=Utc\} 0 \{sqlite_schema, BaseSchemaName=sqlite_schema\} 0\
\{Memory, Journal Mode=Memory\} 0 \{Serializable, Default\
IsolationLevel=Serializable\} 0 \{False, Foreign Keys=False\} 0\
\{LogCallbackException, Flags=LogCallbackException\}$}}

###############################################################################

runTest {test data-1.17 {SQLiteConvert ToDateTime (Julian Day)} -body {
  set dateTime [object invoke System.Data.SQLite.SQLiteConvert ToDateTime \
      2455928.0 Utc]