Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Refactor core SQLite library return code handling to make use of the enumerated SQLiteErrorCode type. Initial work on supporting the sqlite3_errstr() API. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a6c16dc93b61edd947a9b4b5d8de4ea3 |
User & Date: | mistachkin 2012-09-11 08:05:27.070 |
Context
2012-09-11
| ||
08:15 | Bump all versions to 1.0.83.0. check-in: 45b48f33af user: mistachkin tags: trunk | |
08:05 | Refactor core SQLite library return code handling to make use of the enumerated SQLiteErrorCode type. Initial work on supporting the sqlite3_errstr() API. check-in: a6c16dc93b user: mistachkin tags: trunk | |
03:40 | Show the MSBuild arguments when batch file variables are displayed. check-in: f46cda9f0a user: mistachkin tags: trunk | |
Changes
Changes to Doc/Extra/version.html.
︙ | |||
39 40 41 42 43 44 45 46 47 48 49 50 51 52 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | + + + + + + + + + + + | </td> </tr> </table> </div> <div id="mainSection"> <div id="mainBody"> <h1 class="heading">Version History</h1> <p><b>1.0.83.0 - November XX, 2012 <font color="red">(release scheduled)</font></b></p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_14.html">SQLite 3.7.14</a>.</li> <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li> <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li> <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li> <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The ErrorCode field of the LogEventArgs is now an object instead of an integer. <b>** Potentially Incompatible Change **</b></li> <li>The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. <b>** Potentially Incompatible Change **</b></li> </ul> <p><b>1.0.82.0 - September 3, 2012</b></p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_14.html">SQLite 3.7.14</a>.</li> <li>Properly handle quoted data source values in the connection string. Fix for <a href="http://system.data.sqlite.org/index.html/info/8c3bee31c8">[8c3bee31c8]</a>.</li> <li>The <a href="http://nuget.org/packages/System.Data.SQLite">primary NuGet package</a> now supports x86 / x64 and the .NET Framework 2.0 / 4.0 (i.e. in a single package).</li> <li>Change the default value for the Synchronous connection string property to Full to match the default used by the SQLite core library itself. <b>** Potentially Incompatible Change **</b></li> <li>Add the ability to skip applying default connection settings to opened databases via the new SetDefaults connection string property.</li> |
︙ |
Changes to System.Data.SQLite/SQLite3.cs.
︙ | |||
14 15 16 17 18 19 20 21 22 23 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | + + + + + + + + + + + + + + + + - + | using System.Diagnostics; #endif using System.Globalization; using System.Runtime.InteropServices; using System.Text; /// <summary> /// This is the method signature for the SQLite core library logging callback /// function for use with sqlite3_log() and the SQLITE_CONFIG_LOG. /// /// WARNING: This delegate is used more-or-less directly by native code, do /// not modify its type signature. /// </summary> /// <param name="pUserData"> /// The extra data associated with this message, if any. /// </param> /// <param name="errorCode"> /// The error code associated with this message. /// </param> /// <param name="pMessage"> /// The message string to be logged. /// </param> #if !PLATFORM_COMPACTFRAMEWORK [UnmanagedFunctionPointer(CallingConvention.Cdecl)] #endif |
︙ | |||
227 228 229 230 231 232 233 | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | - + - + - + - + - + | { get { return UnsafeNativeMethods.sqlite3_memory_highwater(0); } } |
︙ | |||
277 278 279 280 281 282 283 | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | - + - + - + | } if (_sql == null) { IntPtr db; #if !SQLITE_STANDARD |
︙ | |||
319 320 321 322 323 324 325 | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + | ref totalCount); return totalCount; } internal override void SetTimeout(int nTimeoutMS) { |
︙ | |||
443 444 445 446 447 448 449 | 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 | - + - + - + - + - + - + | SQLiteConnectionFlags flags = (cnn != null) ? cnn.Flags : SQLiteConnectionFlags.Default; #if !PLATFORM_COMPACTFRAMEWORK if ((flags & SQLiteConnectionFlags.LogPrepare) == SQLiteConnectionFlags.LogPrepare) { if ((strSql == null) || (strSql.Length == 0) || (strSql.Trim().Length == 0)) |
︙ | |||
530 531 532 533 534 535 536 | 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 | - + - + - + - + | finally { _buildingSchema = false; } } #endif } |
︙ | |||
599 600 601 602 603 604 605 | 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | - + - + | return result.ToString(); } protected static void LogBind(SQLiteStatementHandle handle, int index, DateTime value) { IntPtr handleIntPtr = handle; |
︙ | |||
634 635 636 637 638 639 640 | 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 | - + - + - + - + - - + + - - + + - + - + - + - + - + - + | return result.ToString(); } protected static void LogBind(SQLiteStatementHandle handle, int index, byte[] value) { IntPtr handleIntPtr = handle; |
︙ | |||
741 742 743 744 745 746 747 | 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 | - - + + | #if !PLATFORM_COMPACTFRAMEWORK if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) { LogBind(handle, index, b); } #endif |
︙ | |||
768 769 770 771 772 773 774 | 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 | - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - + | #if !PLATFORM_COMPACTFRAMEWORK if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) { LogBind(handle, index, value); } |
︙ | |||
893 894 895 896 897 898 899 | 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 | - + - + | #endif #if !PLATFORM_COMPACTFRAMEWORK if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) { IntPtr handleIntPtr = handle; |
︙ | |||
1026 1027 1028 1029 1030 1031 1032 | 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 | - + - + | internal override void ColumnMetaData(string dataBase, string table, string column, out string dataType, out string collateSequence, out bool notNull, out bool primaryKey, out bool autoIncrement) { IntPtr dataTypePtr; IntPtr collSeqPtr; int nnotNull; int nprimaryKey; int nautoInc; |
︙ | |||
1153 1154 1155 1156 1157 1158 1159 | 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 | - + - + - + - + - - - + + + | internal override int AggregateCount(IntPtr context) { return UnsafeNativeMethods.sqlite3_aggregate_count(context); } internal override void CreateFunction(string strFunction, int nArgs, bool needCollSeq, SQLiteCallback func, SQLiteCallback funcstep, SQLiteFinalCallback funcfinal) { |
︙ | |||
1373 1374 1375 1376 1377 1378 1379 | 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 | - + - + - - + + - - + + | /// Enables or disabled extended result codes returned by SQLite internal override void SetExtendedResultCodes(bool bOnOff) { UnsafeNativeMethods.sqlite3_extended_result_codes(_sql, (bOnOff ? -1 : 0)); } /// Gets the last SQLite error code |
︙ | |||
1430 1431 1432 1433 1434 1435 1436 | 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 | - + - - + + | /// <summary> /// Allows the setting of a logging callback invoked by SQLite when a /// log event occurs. Only one callback may be set. If NULL is passed, /// the logging callback is unregistered. /// </summary> /// <param name="func">The callback function to invoke.</param> /// <returns>Returns a result code</returns> |
︙ | |||
1537 1538 1539 1540 1541 1542 1543 | 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 | - + - + - + + + + + + - - - - - - + | IntPtr handlePtr = handle; if (handlePtr == IntPtr.Zero) throw new InvalidOperationException( "Backup object has an invalid handle pointer."); |
︙ | |||
1645 1646 1647 1648 1649 1650 1651 | 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 | - + - + | IntPtr handlePtr = handle; if (handlePtr == IntPtr.Zero) throw new InvalidOperationException( "Backup object has an invalid handle pointer."); |
︙ | |||
1700 1701 1702 1703 1704 1705 1706 | 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 | - + - + | #endif // // NOTE: This method [ab]uses the fact that SQLite will always // return SQLITE_ERROR for any unknown configuration option // *unless* the SQLite library has already been initialized. // In that case it will always return SQLITE_MISUSE. // |
︙ | |||
1775 1776 1777 1778 1779 1780 1781 | 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 | - - + + - + - + - + | #endif } internal override long GetRowIdForCursor(SQLiteStatement stmt, int cursor) { #if !SQLITE_STANDARD long rowid; |
Changes to System.Data.SQLite/SQLite3_UTF16.cs.
︙ | |||
107 108 109 110 111 112 113 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | - + - + - + | } if (_sql == null) { IntPtr db; #if !SQLITE_STANDARD |
︙ | |||
169 170 171 172 173 174 175 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | - - + + | #if !PLATFORM_COMPACTFRAMEWORK if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) { LogBind(handle, index, value); } #endif |
︙ |
Changes to System.Data.SQLite/SQLiteBackup.cs.
︙ | |||
46 47 48 49 50 51 52 | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - + | /// <summary> /// The last result from the StepBackup method of the SQLite3 class. /// This is used to determine if the call to the FinishBackup method of /// the SQLite3 class should throw an exception when it receives a non-Ok /// return code from the core SQLite library. /// </summary> |
︙ |
Changes to System.Data.SQLite/SQLiteBase.cs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | + | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { using System; // using System.Runtime.InteropServices; /// <summary> /// This internal class provides the foundation of SQLite support. It defines all the abstract members needed to implement /// a SQLite data provider, and inherits from SQLiteConvert which allows for simple translations of string to and from SQLite. /// </summary> internal abstract class SQLiteBase : SQLiteConvert, IDisposable { |
︙ | |||
43 44 45 46 47 48 49 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + - + | /// <summary> /// Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. /// If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is /// global to the process. /// </summary> /// <param name="value">Non-zero to enable memory usage tracking, zero otherwise.</param> /// <returns>A standard SQLite return code (i.e. zero for success and non-zero for failure).</returns> |
︙ | |||
121 122 123 124 125 126 127 | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | - + | internal abstract bool Step(SQLiteStatement stmt); /// <summary> /// Resets a prepared statement so it can be executed again. If the error returned is SQLITE_SCHEMA, /// transparently attempt to rebuild the SQL statement and throw an error if that was not possible. /// </summary> /// <param name="stmt">The statement to reset</param> /// <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> |
︙ | |||
193 194 195 196 197 198 199 | 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | - + - + - + - + | /// <returns></returns> internal abstract void SetExtendedResultCodes(bool bOnOff); /// <summary> /// Returns the numeric result code for the most recent failed SQLite API call /// associated with the database connection. /// </summary> /// <returns>Result code</returns> |
︙ | |||
357 358 359 360 361 362 363 364 365 366 367 368 369 370 | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /////////////////////////////////////////////////////////////////////////////////////////////// // These statics are here for lack of a better place to put them. // They exist here because they are called during the finalization of // a SQLiteStatementHandle, SQLiteConnectionHandle, and SQLiteFunctionCookieHandle. // Therefore these functions have to be static, and have to be low-level. /////////////////////////////////////////////////////////////////////////////////////////////// private static string[] _errorMessages = { /* SQLITE_OK */ "not an error", /* SQLITE_ERROR */ "SQL logic error or missing database", /* SQLITE_INTERNAL */ "internal logic error", /* SQLITE_PERM */ "access permission denied", /* SQLITE_ABORT */ "callback requested query abort", /* SQLITE_BUSY */ "database is locked", /* SQLITE_LOCKED */ "database table is locked", /* SQLITE_NOMEM */ "out of memory", /* SQLITE_READONLY */ "attempt to write a readonly database", /* SQLITE_INTERRUPT */ "interrupted", /* SQLITE_IOERR */ "disk I/O error", /* SQLITE_CORRUPT */ "database disk image is malformed", /* SQLITE_NOTFOUND */ "unknown operation", /* SQLITE_FULL */ "database or disk is full", /* SQLITE_CANTOPEN */ "unable to open database file", /* SQLITE_PROTOCOL */ "locking protocol", /* SQLITE_EMPTY */ "table contains no data", /* SQLITE_SCHEMA */ "database schema has changed", /* SQLITE_TOOBIG */ "string or blob too big", /* SQLITE_CONSTRAINT */ "constraint failed", /* SQLITE_MISMATCH */ "datatype mismatch", /* SQLITE_MISUSE */ "library routine called out of sequence", /* SQLITE_NOLFS */ "large file support is disabled", /* SQLITE_AUTH */ "authorization denied", /* SQLITE_FORMAT */ "auxiliary database format error", /* SQLITE_RANGE */ "bind or column index out of range", /* SQLITE_NOTADB */ "file is encrypted or is not a database", }; /////////////////////////////////////////////////////////////////////////////////////////////// private static string FallbackGetErrorString(SQLiteErrorCode rc) { if (_errorMessages == null) return null; int index = (int)rc; if ((index < 0) || (index >= _errorMessages.Length)) index = (int)SQLiteErrorCode.Error; /* Make into generic error. */ return _errorMessages[index]; } internal static string GetErrorString(SQLiteErrorCode rc) { //try //{ // IntPtr ptr = UnsafeNativeMethods.sqlite3_errstr(rc); // // if (ptr != IntPtr.Zero) // return Marshal.PtrToStringAnsi(ptr); //} //catch (EntryPointNotFoundException) //{ // // do nothing. //} return FallbackGetErrorString(rc); } internal static string GetLastError(SQLiteConnectionHandle hdl, IntPtr db) { if ((hdl == null) || (db == IntPtr.Zero)) return "null connection or database handle"; lock (hdl) |
︙ | |||
386 387 388 389 390 391 392 | 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | - - + + - + - + - + - + - + - + - + - + | } internal static void FinishBackup(SQLiteConnectionHandle hdl, IntPtr backup) { if ((hdl == null) || (backup == IntPtr.Zero)) return; lock (hdl) { |
︙ |
Changes to System.Data.SQLite/SQLiteConnection.cs.
︙ | |||
486 487 488 489 490 491 492 | 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | - + | } } #if !PLATFORM_COMPACTFRAMEWORK catch (Exception e) { if ((_flags & SQLiteConnectionFlags.LogBackup) == SQLiteConnectionFlags.LogBackup) { |
︙ | |||
1535 1536 1537 1538 1539 1540 1541 | 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 | - + | /// <summary> /// Sets the status of the memory usage tracking subsystem in the SQLite core library. By default, this is enabled. /// If this is disabled, memory usage tracking will not be performed. This is not really a per-connection value, it is /// global to the process. /// </summary> /// <param name="value">Non-zero to enable memory usage tracking, zero otherwise.</param> /// <returns>A standard SQLite return code (i.e. zero for success and non-zero for failure).</returns> |
︙ | |||
1584 1585 1586 1587 1588 1589 1590 | 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 | - + | { CheckDisposed(); return _connectionState; } } /// Passes a shutdown request off to SQLite. |
︙ | |||
1632 1633 1634 1635 1636 1637 1638 | 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 | - + - + | public void SetExtendedResultCodes(bool bOnOff) { CheckDisposed(); if (_sql != null) _sql.SetExtendedResultCodes(bOnOff); } /// Enables or disabled extended result codes returned by SQLite |
︙ | |||
1737 1738 1739 1740 1741 1742 1743 | 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 | - + - + | /// <param name="count">The number of times to retry the I/O operation. A negative value /// will cause the current count to be queried and replace that negative value.</param> /// <param name="interval">The number of milliseconds to wait before retrying the I/O /// operation. This number is multiplied by the number of retry attempts so far to come /// up with the final number of milliseconds to wait. A negative value will cause the /// current interval to be queried and replace that negative value.</param> /// <returns>Zero for success, non-zero for error.</returns> |
︙ |
Changes to System.Data.SQLite/SQLiteDataReader.cs.
︙ | |||
227 228 229 230 231 232 233 | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | - + | if (!_throwOnDisposed) return; if (_command == null) throw new InvalidOperationException("DataReader has been closed"); if (_version == 0) |
︙ |
Changes to System.Data.SQLite/SQLiteException.cs.
︙ | |||
33 34 35 36 37 38 39 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - - - + + + - + | } #endif /// <summary> /// Public constructor for generating a SQLite error given the base error code /// </summary> /// <param name="errorCode">The SQLite error code to report</param> |
︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | - + - + - - - + + + - - - + - - - + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | get { return _errorCode; } } /// <summary> /// Initializes the exception class with the SQLite error code. /// </summary> /// <param name="errorCode">The SQLite error code</param> |
Changes to System.Data.SQLite/SQLiteLog.cs.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | - + - + + - + - + + + + - + | namespace System.Data.SQLite { using System; using System.Data.Common; using System.Diagnostics; /// <summary> |
︙ | |||
165 166 167 168 169 170 171 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | - + - + - - + + | // event on to any registered handler. We only want to // do this once. // if (_callback == null) { _callback = new SQLiteLogCallback(LogCallback); |
︙ | |||
214 215 216 217 218 219 220 | 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | - + - + - + | // // BUGBUG: This will cause serious problems if other AppDomains // have any open SQLite connections; however, there is // currently no way around this limitation. // if (_sql != null) { |
︙ | |||
294 295 296 297 298 299 300 | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | set { lock (syncRoot) { _enabled = value; } } } /// <summary> /// Log a message to all the registered log event handlers without going /// through the SQLite library. /// </summary> /// <param name="message">The message to be logged.</param> public static void LogMessage( string message ) { LogMessage(null, message); } /// <summary> /// Log a message to all the registered log event handlers without going /// through the SQLite library. /// </summary> |
︙ | |||
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | + + + + + + + + + + + + | InitializeDefaultHandler(); Log -= _defaultHandler; } /// <summary> /// Internal proxy function that calls any registered application log /// event handlers. /// /// WARNING: This method is used more-or-less directly by native code, /// do not modify its type signature. /// </summary> /// <param name="pUserData"> /// The extra data associated with this message, if any. /// </param> /// <param name="errorCode"> /// The error code associated with this message. /// </param> /// <param name="pMessage"> /// The message string to be logged. /// </param> private static void LogCallback( IntPtr pUserData, int errorCode, IntPtr pMessage ) { bool enabled; |
︙ | |||
401 402 403 404 405 406 407 | 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | - + + + + + + + - + - - + | { message = message.Trim(); if (message.Length == 0) message = "<empty>"; } |
Changes to System.Data.SQLite/SQLiteStatement.cs.
︙ | |||
252 253 254 255 256 257 258 | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | - + - + - + | case TypeCode.Double: return ((double)obj) != (double)0.0 ? true : false; case TypeCode.Decimal: return ((decimal)obj) != Decimal.Zero ? true : false; case TypeCode.String: return Convert.ToBoolean(obj, provider); default: |
︙ |
Changes to System.Data.SQLite/SQLiteTransaction.cs.
︙ | |||
195 196 197 198 199 200 201 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | - + - + - + | { if (throwError == true) throw new ArgumentNullException("No connection associated with this transaction"); else return false; } if (_cnn._version != _version) { |
Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
︙ | |||
545 546 547 548 549 550 551 | 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | [DllImport(SQLITE_DLL)] internal static extern IntPtr sqlite3_column_text16_interop(IntPtr stmt, int index, out int len); [DllImport(SQLITE_DLL)] internal static extern IntPtr sqlite3_errmsg_interop(IntPtr db, out int len); [DllImport(SQLITE_DLL)] |
︙ | |||
747 748 749 750 751 752 753 | 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 | - + - + | internal static extern IntPtr sqlite3_errmsg(IntPtr db); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif |
︙ | |||
788 789 790 791 792 793 794 | 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 | - + - + - + | [DllImport(SQLITE_DLL)] internal static extern IntPtr sqlite3_context_collseq(IntPtr context, out int type, out int enc, out int len); [DllImport(SQLITE_DLL)] internal static extern int sqlite3_context_collcompare(IntPtr context, byte[] p1, int p1len, byte[] p2, int p2len); [DllImport(SQLITE_DLL)] |
︙ | |||
889 890 891 892 893 894 895 | 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 | - + - + - + - + - + - + - + - + - + - + - + - + - + | internal static extern long sqlite3_memory_highwater(int resetFlag); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif |
︙ | |||
991 992 993 994 995 996 997 | 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 | - + | internal static extern int sqlite3_column_count(IntPtr stmt); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif |
︙ | |||
1042 1043 1044 1045 1046 1047 1048 | 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 | - + | internal static extern TypeAffinity sqlite3_column_type(IntPtr stmt, int index); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif |
︙ | |||
1158 1159 1160 1161 1162 1163 1164 | 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 | - + | internal static extern IntPtr sqlite3_aggregate_context(IntPtr context, int nBytes); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)] #else [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)] #endif |
︙ | |||
1180 1181 1182 1183 1184 1185 1186 | 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 | - + - + | #if INTEROP_CODEC #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif |
︙ | |||
1218 1219 1220 1221 1222 1223 1224 | 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 | - + - + - + | // Since sqlite3_config() takes a variable argument list, we have to overload declarations // for all possible calls that we want to use. #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, EntryPoint = "sqlite3_config", CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL, EntryPoint = "sqlite3_config")] #endif |
︙ | |||
1260 1261 1262 1263 1264 1265 1266 | 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 | - + - + - + - + + + + + + + + - + - + - + | internal static extern IntPtr sqlite3_next_stmt(IntPtr db, IntPtr stmt); #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif |
︙ |
Changes to Tests/backup.eagle.
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - - + + - - + + - - + + | set params(results) [list \ "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\ 1048576 1048576 10\\} 0\$" \ "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\ 1048576 1048576 10\\} 0\$" \ "1 \\{System\\.Reflection\\.TargetInvocationException: Exception has been\ thrown by the target of an invocation\\. --->\ |
︙ |
Changes to Tests/basic.eagle.
︙ | |||
1257 1258 1259 1260 1261 1262 1263 | 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 | - + | unset -nocomplain result results errors code sql dataSource id db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \ regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 1\ \{System\.Reflection\.TargetInvocationException: Exception has been thrown by\ the target of an invocation\. ---> System\.Data\.SQLite\.SQLiteException:\ |
︙ | |||
1512 1513 1514 1515 1516 1517 1518 | 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 | - - + + | object invoke -flags +NonPublic System.Data.SQLite.UnsafeNativeMethods \ sqlite3_config_int SQLITE_CONFIG_MEMSTATUS 1 } unset -nocomplain result sqlite3 } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \ |
︙ | |||
1755 1756 1757 1758 1759 1760 1761 | 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 | - + | catch {object removecallback threadStart} unset -nocomplain t found i db fileName result directory rename threadStart "" } -constraints {eagle windows monoBug28 command.sql compile.DATA SQLite\ |
Changes to Tests/tkt-ccfa69fc32.eagle.
︙ | |||
80 81 82 83 84 85 86 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - + | set result } -cleanup { unset -nocomplain code output error result add } -constraints {eagle monoToDo SQLite file_System.Data.SQLite.dll\ file_System.Data.SQLite.Linq.dll file_testlinq.exe file_northwindEF.db} -match \ glob -result {0 {1581 1730 1833 2116 2139} 0 {System.Data.UpdateException: *\ |
︙ |
Changes to readme.htm.
1 2 3 4 5 6 7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - + | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> ADO.NET SQLite Data Provider<br /> |
︙ | |||
182 183 184 185 186 187 188 189 190 191 192 193 194 195 | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | + + + + + + + + + + + + + | at the sqlite.org website. Several additional pieces are compiled on top of it to extend its functionality, but the core engine's source is not changed.</p> <p> </p> <h2><b>Version History</b></h2> <p> <b>1.0.83.0 - November XX, 2012</b> </p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_14.html">SQLite 3.7.14</a>.</li> <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li> <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li> <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li> <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The ErrorCode field of the LogEventArgs is now an object instead of an integer. <b>** Potentially Incompatible Change **</b></li> <li>The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. <b>** Potentially Incompatible Change **</b></li> </ul> <p> <b>1.0.82.0 - September 3, 2012</b> </p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_14.html">SQLite 3.7.14</a>.</li> <li>Properly handle quoted data source values in the connection string. Fix for [8c3bee31c8].</li> <li>The <a href="http://nuget.org/packages/System.Data.SQLite">primary NuGet package</a> now supports x86 / x64 and the .NET Framework 2.0 / 4.0 (i.e. in a single package).</li> |
︙ |
Changes to test/TestCases.cs.
︙ | |||
1618 1619 1620 1621 1622 1623 1624 | 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 | - - + + - + | SQLiteConnection cnn = new SQLiteConnection(_cnnstring.ConnectionString); cnn.Open(); // Turn on extended result codes cnn.SetExtendedResultCodes(true); |
︙ |
Changes to www/news.wiki.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + + + + + + + + + + + + + | <title>News</title> <b>Version History</b> <p> <b>1.0.83.0 - November XX, 2012 <font color="red">(release scheduled)</font></b> </p> <ul> <li>Updated to [http://www.sqlite.org/releaselog/3_7_14.html|SQLite 3.7.14].</li> <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li> <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li> <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li> <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The ErrorCode field of the LogEventArgs is now an object instead of an integer. <b>** Potentially Incompatible Change **</b></li> <li>The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. <b>** Potentially Incompatible Change **</b></li> </ul> <p> <b>1.0.82.0 - September 3, 2012</b> </p> <ul> <li>Updated to [http://www.sqlite.org/releaselog/3_7_14.html|SQLite 3.7.14].</li> <li>Properly handle quoted data source values in the connection string. Fix for [8c3bee31c8].</li> <li>The [http://nuget.org/packages/System.Data.SQLite|primary NuGet package] now supports x86 / x64 and the .NET Framework 2.0 / 4.0 (i.e. in a single package).</li> |
︙ |