Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tkt-8d928c3e88 Excluding Merge-Ins
This is equivalent to a diff from c2e4f24377 to 45312da90e
2015-01-14
| ||
21:26 | Address all the LINQ issues mentioned in ticket [8d928c3e88]. Make the storage schema (SSDL) files more consistent with their provider names. check-in: 9ff0f0adf0 user: mistachkin tags: trunk | |
2015-01-13
| ||
04:08 | Fix extra single quotes around the formatted DateTime values in the LINQ assembly. Use GetSettingValue to access the new environment variables. Closed-Leaf check-in: 45312da90e user: mistachkin tags: tkt-8d928c3e88 | |
03:39 | In the LINQ assembly, when surrounding single quotes are required for a formatted DateTime value, be sure to escape contained single quotes. check-in: b999c9c818 user: mistachkin tags: tkt-8d928c3e88 | |
03:34 | Merge updates from trunk. check-in: a15efc1fd5 user: mistachkin tags: tkt-8d928c3e88 | |
03:34 | Attempt to make the 'legacy' NuGet package configuration transform work the same as the EF6 one. check-in: c2e4f24377 user: mistachkin tags: trunk | |
03:30 | Remove a comment that is no longer accurate. check-in: 812281ccef user: mistachkin tags: trunk | |
Changes to Doc/Extra/Provider/environment.html.
︙ | |||
76 77 78 79 80 81 82 83 84 85 86 87 88 89 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | + + + + + + + + + + + | </font> </p> <table width="80%" cellpadding="0" cellspacing="0"> <tr valign="top"> <th>Name</th> <th>Description</th> </tr> <tr valign="top"> <td>AppendManifestToken_SQLiteProviderManifest</td> <td>If this environment variable is set [to anything], it will be used by the System.Data.SQLite.Linq.SQLiteProviderManifest class (and the System.Data.SQLite.EF6.SQLiteProviderManifest class) to modify future provider manifest tokens by appending the value of the environment variable to the existing provider manifest token, if any. Typically, in order for the constructed provider manifest token to be syntactically correct, the environment variable value [to be appended] must begin with a semicolon.</td> </tr> <tr valign="top"> <td>Force_SQLiteLog</td> <td>If this environment variable is set [to anything], the SQLite logging subsystem may be initialized in a non-default application domain. By default, this is not allowed due to the potential for application domain unloading issues.</td> </tr> |
︙ | |||
149 150 151 152 153 154 155 156 157 158 159 160 161 162 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | + + + + + + | <td>PROCESSOR_ARCHITECTURE</td> <td>This environment variable is normally set by the operating system itself and should reflect the native processor architecture of the current process (e.g. a 32-bit x86 application running on a 64-bit x64 operating system should have the value "x86"). </td> </tr> <tr valign="top"> <td>SQLite_ForceLogPrepare</td> <td>If this environment variable is set [to anything], all calls to prepare a SQL query will be logged, regardless of the flags for the associated connection.</td> </tr> <tr valign="top"> <td>TypeName_SQLiteProviderServices</td> <td>If this environment variable is set [to anything], it will be used by the System.Data.SQLite.SQLiteFactory class as the type name containing the System.Data.Common.DbProviderServices implementation that should be used.</td> </tr> |
︙ |
Changes to Doc/Extra/Provider/version.html.
︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | + + + | <li>Defer disposing of connections created by the static SQLiteCommand.Execute method when a data reader is returned. Fix for <a href="http://system.data.sqlite.org/index.html/info/daeaf3150a">[daeaf3150a]</a>.</li> <li>Wrap SELECT statements in parenthesis if they have an ORDER BY, LIMIT, or OFFSET clause and a compound operator is involved. Fix for <a href="http://system.data.sqlite.org/index.html/info/0a32885109">[0a32885109]</a>.</li> <li>In the SQLiteDataReader.VerifyType method, remove duplicate "if" statement for the DbType.SByte value and move the remaining "if" to the Int64 affinity. Fix for <a href="http://system.data.sqlite.org/index.html/info/c5cc2fb334">[c5cc2fb334]</a>. <b>** Potentially Incompatible Change **</b></li> <li>Handle Julian Day values that fall outside of the supported range for OLE Automation dates. Fix for <a href="http://system.data.sqlite.org/index.html/info/3e783eecbe">[3e783eecbe]</a>. <b>** Potentially Incompatible Change **</b></li> <li>Make sure the interop files are copied when publishing a project that refers to a NuGet package containing them. Fix for <a href="http://system.data.sqlite.org/index.html/info/e796ac82c1">[e796ac82c1]</a>. <b>** Potentially Incompatible Change **</b></li> <li>Make sure the interop files are copied before the PostBuildEvent. Fix for <a href="http://system.data.sqlite.org/index.html/info/f16c93a932">[f16c93a932]</a>. <b>** Potentially Incompatible Change **</b></li> <li>Modify GetSchemaTable method to avoid setting SchemaTableColumn.IsKey column to true when more than one table is referenced. Fix for <a href="http://system.data.sqlite.org/index.html/info/47c6fa04d3">[47c6fa04d3]</a>. <b>** Potentially Incompatible Change **</b></li> <li>Add AppendManifestToken_SQLiteProviderManifest environment variable to enable better integration between LINQ and the underlying store connection.</li> <li>Add SQLite_ForceLogPrepare environment variable to force logging of all prepared SQL regardless of the flags for the associated connection.</li> <li>Honor the DateTimeFormat, DateTimeKind, DateTimeFormatString, BinaryGUID connection string and/or provider manifest token properties from within the LINQ assembly. Fix for <a href="http://system.data.sqlite.org/index.html/info/8d928c3e88">[8d928c3e88]</a>. <b>** Potentially Incompatible Change **</b></li> </ul> <p><b>1.0.94.0 - September 9, 2014</b></p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_6.html">SQLite 3.8.6</a>.</li> <li>Updated to <a href="http://www.nuget.org/packages/EntityFramework/6.1.1">Entity Framework 6.1.1</a>.</li> <li>Refactor and simplify NuGet packages in order to support per-solution SQLite interop assembly files. <b>** Potentially Incompatible Change **</b></li> <li>Add RefreshFlags method to the SQLiteDataReader class to forcibly refresh its connection flags.</li> |
︙ |
Changes to System.Data.SQLite.Linq/Resources/SQLiteProviderServices.StoreSchemaDefinition.EF6.ssdl.
︙ | |||
273 274 275 276 277 278 279 | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | - + | <AssociationSet Name="STableConstraints" Association="Self.TableTableConstraint" > <End Role="Parent" EntitySet="STables"/> <End Role="Constraint" EntitySet="SConstraints"/> </AssociationSet> <AssociationSet Name="SConstraintConstraintColumns" Association="Self.ConstraintConstraintColumn" > <End Role="ConstraintColumn" EntitySet="SConstraintColumns"/> <End Role="Constraint" EntitySet="SConstraints"/> |
︙ | |||
475 476 477 478 479 480 481 | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | - + | <EntityType Name="CheckConstraint"> <Key> <PropertyRef Name="Id" /> </Key> <Property Name="Id" Nullable="false" Type="nvarchar" /> <Property Name="Expression" Nullable="true" Type="nvarchar" /> </EntityType> |
︙ |
Changes to System.Data.SQLite.Linq/Resources/SQLiteProviderServices.StoreSchemaDefinition.Linq.ssdl.
1 | 1 2 3 4 5 6 7 8 9 | - + | <?xml version="1.0" encoding="utf-8"?> |
︙ | |||
273 274 275 276 277 278 279 | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | - + | <AssociationSet Name="STableConstraints" Association="Self.TableTableConstraint" > <End Role="Parent" EntitySet="STables"/> <End Role="Constraint" EntitySet="SConstraints"/> </AssociationSet> <AssociationSet Name="SConstraintConstraintColumns" Association="Self.ConstraintConstraintColumn" > <End Role="ConstraintColumn" EntitySet="SConstraintColumns"/> <End Role="Constraint" EntitySet="SConstraints"/> |
︙ | |||
475 476 477 478 479 480 481 | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | - + | <EntityType Name="CheckConstraint"> <Key> <PropertyRef Name="Id" /> </Key> <Property Name="Id" Nullable="false" Type="nvarchar" /> <Property Name="Expression" Nullable="true" Type="nvarchar" /> </EntityType> |
︙ |
Changes to System.Data.SQLite.Linq/SQL Generation/SqlBuilder.cs.
︙ | |||
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | + + + + | else { ISqlFragment sqlFragment = (o as ISqlFragment); if (null != sqlFragment) { sqlFragment.WriteSql(writer, sqlGenerator); } else if (o is char) { writer.Write((char)o); } else { throw new InvalidOperationException(); } } } } |
︙ |
Changes to System.Data.SQLite.Linq/SQL Generation/SqlGenerator.cs.
︙ | |||
116 117 118 119 120 121 122 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | - + | /// Renaming issues. /// When rows or columns are renamed, we produce names that are unique globally /// with respect to the query. The names are derived from the original names, /// with an integer as a suffix. e.g. CustomerId will be renamed to CustomerId1, /// CustomerId2 etc. /// /// Since the names generated are globally unique, they will not conflict when the |
︙ | |||
434 435 436 437 438 439 440 | 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 | - + | return functionNameToOperatorDictionary; } #endregion #region Constructor /// <summary> |
︙ | |||
462 463 464 465 466 467 468 | 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | - + | //Handle Query DbQueryCommandTree queryCommandTree = tree as DbQueryCommandTree; if (queryCommandTree != null) { SqlGenerator sqlGen = new SqlGenerator(manifest); parameters = null; |
︙ | |||
871 872 873 874 875 876 877 | 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 898 899 900 901 902 903 904 905 906 907 908 909 910 911 | - - + - + + + + + + + + - + + + + + + + | switch (typeKind) { case PrimitiveTypeKind.Int32: result.Append(e.Value.ToString()); break; case PrimitiveTypeKind.Binary: |
︙ | |||
919 920 921 922 923 924 925 | 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 | + + + + + + - + + | break; case PrimitiveTypeKind.Double: result.Append(((Double)e.Value).ToString(CultureInfo.InvariantCulture)); break; case PrimitiveTypeKind.Guid: { object value = e.Value; if (_manifest._binaryGuid && (value is Guid)) ToBlobLiteral(((Guid)value).ToByteArray(), result); else |
︙ | |||
1123 1124 1125 1126 1127 1128 1129 | 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 | - + | /// Lambda functions are not supported. /// The functions supported are: /// <list type="number"> /// <item>Canonical Functions - We recognize these by their dataspace, it is DataSpace.CSpace</item> /// <item>Store Functions - We recognize these by the BuiltInAttribute and not being Canonical</item> /// <item>User-defined Functions - All the rest except for Lambda functions</item> /// </list> |
︙ | |||
1174 1175 1176 1177 1178 1179 1180 | 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 | - + - - + + - + - + - - - - - + + + + + - + - - - + + + - - + + - + | } /// <summary> /// <see cref="Visit(DbFilterExpression)"/> for general details. /// We modify both the GroupBy and the Select fields of the SqlSelectStatement. /// GroupBy gets just the keys without aliases, /// and Select gets the keys and the aggregates with aliases. |
︙ | |||
1236 1237 1238 1239 1240 1241 1242 | 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 | - + | symbolTable.Add(e.Input.GroupVariableName, fromSymbol); // The enumerator is shared by both the keys and the aggregates, // so, we do not close it in between. RowType groupByType = MetadataHelpers.GetEdmType<RowType>(MetadataHelpers.GetEdmType<CollectionType>(e.ResultType).TypeUsage); |
︙ | |||
1288 1289 1290 1291 1292 1293 1294 | 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 | - + | // The inner query contains the default translation Key AS Alias innerQuery.Select.Append(separator); innerQuery.Select.AppendLine(); innerQuery.Select.Append(keySql); innerQuery.Select.Append(" AS "); innerQuery.Select.Append(alias); |
︙ | |||
1462 1463 1464 1465 1466 1467 1468 | 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 | - + | public override ISqlFragment Visit(DbLikeExpression e) { SqlBuilder result = new SqlBuilder(); result.Append(e.Argument.Accept(this)); result.Append(" LIKE "); result.Append(e.Pattern.Accept(this)); |
︙ | |||
1812 1813 1814 1815 1816 1817 1818 | 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 | - - + + - + | throw new NotSupportedException(); } /// <summary> /// For Sql9 it translates to: /// SELECT Y.x1, Y.x2, ..., Y.xn /// FROM ( |
︙ | |||
2615 2616 2617 2618 2619 2620 2621 | 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 | - - + + | throw new InvalidOperationException("Special handling should be called only for functions in the list of special functions"); return handlers[e.Function.Name](this, e); } /// <summary> /// Handles functions that are translated into TSQL operators. |
︙ | |||
2687 2688 2689 2690 2691 2692 2693 | 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 | - + - + | } private static ISqlFragment HandleGetDateFunction(SqlGenerator sqlgen, DbFunctionExpression e) { SqlBuilder result = new SqlBuilder(); Debug.Assert(e.Arguments.Count == 0, "Canonical getdate function should have no arguments"); |
︙ | |||
2767 2768 2769 2770 2771 2772 2773 | 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 | - + - + | { result.Append("CAST(STRFTIME('"); // expand the datepart literal as tsql kword result.Append(trans); result.Append("', "); |
︙ | |||
2810 2811 2812 2813 2814 2815 2816 | 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 | - + - + - + - + | /// <param name="e"></param> /// <returns></returns> private static ISqlFragment HandleCanonicalFunctionDateAdd(SqlGenerator sqlgen, DbFunctionExpression e) { SqlBuilder result = new SqlBuilder(); Debug.Assert(e.Arguments.Count == 2, "Canonical datepart functions should have exactly two arguments"); |
︙ | |||
2873 2874 2875 2876 2877 2878 2879 | 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 | - + | SqlBuilder result = new SqlBuilder(); result.Append("CAST(STRFTIME('"); result.Append(trans); result.Append("', "); Debug.Assert(e.Arguments.Count == 1, "Canonical datepart functions should have exactly one argument"); |
︙ | |||
3310 3311 3312 3313 3314 3315 3316 | 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 | - + | { symbolTable.Add(inputVarName, fromSymbol); } } /// <summary> /// Translates a list of SortClauses. |
︙ | |||
3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 | 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 | + + + + + + + + + + + + + + + + + + + - - + + | selectStatement.From.AppendLine(); selectStatement.From.Append(") "); return selectStatement; } /// <summary> /// Determines if values of the specified <see cref="SQLiteDateFormats" /> /// require wrapping in single quotes. /// </summary> /// <param name="format"> /// The <see cref="SQLiteDateFormats" /> format. /// </param> /// <returns> /// Non-zero if single quotes are required for a value in the specified /// <see cref="SQLiteDateFormats" />. /// </returns> private static bool NeedSingleQuotes( SQLiteDateFormats format ) { return format != SQLiteDateFormats.Ticks && format != SQLiteDateFormats.JulianDay && format != SQLiteDateFormats.UnixEpoch; } /// <summary> /// Before we embed a string literal in a SQL string, we should /// convert all ' to '', and enclose the whole string in single quotes. /// </summary> /// <param name="s"></param> /// <param name="isUnicode"></param> /// <returns>The escaped sql string.</returns> private static string EscapeSingleQuote(string s, bool isUnicode) { return "'" + s.Replace("'", "''") + "'"; } /// <summary> |
︙ | |||
3563 3564 3565 3566 3567 3568 3569 | 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 | - + | /// <returns></returns> private ISqlFragment HandleCountExpression(DbExpression e) { ISqlFragment result; if (e.ExpressionKind == DbExpressionKind.Constant) { |
︙ | |||
3648 3649 3650 3651 3652 3653 3654 | 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 | - + | /// <returns></returns> bool IsCompatible(SqlSelectStatement result, DbExpressionKind expressionKind) { switch (expressionKind) { case DbExpressionKind.Distinct: return result.Top == null |
︙ | |||
3771 3772 3773 3774 3775 3776 3777 | 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 | - + | /// For the rest, we need to treat them as there was a dummy /// <code> /// -- originally {expression} /// -- change that to /// SELECT * /// FROM {expression} as c /// </code> |
︙ | |||
3957 3958 3959 3960 3961 3962 3963 | 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 | + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + | // Should we actually support this? //result.Append(QuoteIdentifier((string)function.MetadataProperties["Schema"].Value ?? "dbo")); //result.Append("."); result.Append(QuoteIdentifier(storeFunctionName)); } } /// <summary> /// Appends the literal BLOB string representation of the specified /// byte array to the <see cref="SqlBuilder" />. /// </summary> /// <param name="bytes"> /// The byte array to be formatted as a literal BLOB string. /// </param> /// <param name="builder"> /// The <see cref="SqlBuilder" /> object to use. If null, an exception /// will be thrown. /// </param> private static void ToBlobLiteral( byte[] bytes, SqlBuilder builder ) { if (builder == null) throw new ArgumentNullException("builder"); |
︙ |
Changes to System.Data.SQLite.Linq/SQLiteProviderManifest.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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 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 | - - - - - + + + + + + + + + + - + + + + - - + + + + + + - + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #if USE_ENTITY_FRAMEWORK_6 namespace System.Data.SQLite.EF6 #else namespace System.Data.SQLite.Linq #endif { using System; |
︙ |
Changes to System.Data.SQLite.Linq/SQLiteProviderServices.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 | - - - - - + + + + + | #if USE_ENTITY_FRAMEWORK_6 namespace System.Data.SQLite.EF6 #else namespace System.Data.SQLite.Linq #endif { using System; |
︙ | |||
106 107 108 109 110 111 112 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | - - + + - - - + + - - - - + - - | command.Dispose(); throw; } } protected override string GetDbProviderManifestToken(DbConnection connection) { |
︙ |
Changes to System.Data.SQLite/Configurations/System.Data.SQLite.dll.config.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 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 | + + + + + + + + + + + + + + | <?xml version="1.0"?> <!-- * * System.Data.SQLite.dll.config - * * Written by Joe Mistachkin. * Released to the public domain, use at your own risk! * --> <configuration> <appSettings> <!-- NOTE: If this environment variable is set [to anything], it will be used by the System.Data.SQLite.Linq.SQLiteProviderManifest class (and the System.Data.SQLite.EF6.SQLiteProviderManifest class) to modify future provider manifest tokens by appending the value of the environment variable to the existing provider manifest token, if any. Typically, in order for the constructed provider manifest token to be syntactically correct, the environment variable value [to be appended] must begin with a semicolon. --> <!-- <add key="AppendManifestToken_SQLiteProviderManifest" value="" /> --> <!-- NOTE: If this configuration variable is set [to anything], the SQLite logging subsystem may be initialized in a non-default application domain. By default, this is not allowed due to the potential for application domain unloading issues. --> <!-- |
︙ | |||
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 | + + + + + + + + + | architecture of the current process (e.g. a 32-bit x86 application running on a 64-bit x64 operating system should have the value "x86"). --> <!-- <add key="PROCESSOR_ARCHITECTURE" value="%PROCESSOR_ARCHITECTURE%" /> --> <!-- NOTE: If this environment variable is set [to anything], all calls to prepare a SQL query will be logged, regardless of the flags for the associated connection. --> <!-- <add key="SQLite_ForceLogPrepare" value="1" /> --> <!-- NOTE: If this environment variable is set [to anything], it will be used by the System.Data.SQLite.SQLiteFactory class as the type name containing the System.Data.Common.DbProviderServices implementation that should be used. --> |
︙ |
Changes to System.Data.SQLite/SQLite3.cs.
︙ | |||
883 884 885 886 887 888 889 890 891 892 893 894 895 896 | 883 884 885 886 887 888 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | internal override string GetLastError(string defValue) { string result = SQLiteBase.GetLastError(_sql, _sql); if (String.IsNullOrEmpty(result)) result = defValue; return result; } /////////////////////////////////////////////////////////////////////////////////////////////// #region Query Diagnostics Support #if !PLATFORM_COMPACTFRAMEWORK /// <summary> /// This field is used to keep track of whether or not the /// "SQLite_ForceLogPrepare" environment variable has been queried. If so, /// it will only be non-zero if the environment variable was present. /// </summary> private static bool? forceLogPrepare = null; /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Determines if all calls to prepare a SQL query will be logged, /// regardless of the flags for the associated connection. /// </summary> /// <returns> /// Non-zero to log all calls to prepare a SQL query. /// </returns> private static bool ForceLogPrepare() { lock (syncRoot) { if (forceLogPrepare == null) { if (UnsafeNativeMethods.GetSettingValue( "SQLite_ForceLogPrepare", null) != null) { forceLogPrepare = true; } else { forceLogPrepare = false; } } return (bool)forceLogPrepare; } } #endif #endregion /////////////////////////////////////////////////////////////////////////////////////////////// internal override SQLiteStatement Prepare(SQLiteConnection cnn, string strSql, SQLiteStatement previous, uint timeoutMS, ref string strRemain) { if (!String.IsNullOrEmpty(strSql)) { // // NOTE: SQLite does not support the concept of separate schemas |
︙ | |||
911 912 913 914 915 916 917 | 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | + + + + - + | "{0}.", baseSchemaName), String.Empty); } } SQLiteConnectionFlags flags = (cnn != null) ? cnn.Flags : SQLiteConnectionFlags.Default; if ( #if !PLATFORM_COMPACTFRAMEWORK ForceLogPrepare() || #endif |
︙ |
Changes to System.Data.SQLite/SQLiteConnection.cs.
︙ | |||
348 349 350 351 352 353 354 | 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 | - - - + + + - + | internal const IsolationLevel DeferredIsolationLevel = IsolationLevel.ReadCommitted; internal const IsolationLevel ImmediateIsolationLevel = IsolationLevel.Serializable; private const SQLiteConnectionFlags DefaultFlags = SQLiteConnectionFlags.Default; private const SQLiteSynchronousEnum DefaultSynchronous = SQLiteSynchronousEnum.Default; private const SQLiteJournalModeEnum DefaultJournalMode = SQLiteJournalModeEnum.Default; private const IsolationLevel DefaultIsolationLevel = IsolationLevel.Serializable; |
︙ | |||
1195 1196 1197 1198 1199 1200 1201 | 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 | + + + + + + + + + + + + + + + + + + + + - + - + + - + | if (handle.IsClosed) throw new InvalidOperationException("The connection handle is closed."); } /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Parses a connection string into component parts using the custom /// connection string parser. An exception may be thrown if the syntax /// of the connection string is incorrect. /// </summary> /// <param name="connectionString"> /// The connection string to parse. /// </param> /// <param name="parseViaFramework"> /// Non-zero to parse the connection string using the algorithm provided /// by the framework itself. This is not applicable when running on the /// .NET Compact Framework. /// </param> /// <param name="allowNameOnly"> /// Non-zero if names are allowed without values. /// </param> /// <returns> /// The list of key/value pairs corresponding to the parameters specified /// within the connection string. /// </returns> |
︙ | |||
1886 1887 1888 1889 1890 1891 1892 | 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 | - - + + + - - - + + + + + + + + + + + + + + | else if (path.StartsWith ("/", StringComparison.OrdinalIgnoreCase)) return path; else throw new InvalidOperationException ("Invalid connection string: invalid URI"); } /// <summary> |
︙ | |||
1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 | 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 | + + - + + - + | if (arParts[n].Length == 0) continue; int indexOf = arParts[n].IndexOf('='); if (indexOf != -1) ls.Add(UnwrapString(arParts[n].Substring(0, indexOf).Trim()), UnwrapString(arParts[n].Substring(indexOf + 1).Trim())); else if (allowNameOnly) ls.Add(UnwrapString(arParts[n].Trim()), String.Empty); else throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, "Invalid ConnectionString format for part \"{0}\", no equal sign found", arParts[n])); } return ls; } /// <summary> /// Parses a connection string using the built-in (i.e. framework provided) /// connection string parser class and returns the key/value pairs. An /// exception may be thrown if the connection string is invalid or cannot be /// parsed. When compiled for the .NET Compact Framework, the custom /// connection string parser is always used instead because the framework /// provided one is unavailable there. /// </summary> /// <param name="connectionString"> /// The connection string to parse. /// </param> /// <param name="strict"> /// Non-zero to throw an exception if any connection string values are not of |
︙ | |||
1995 1996 1997 1998 1999 2000 2001 | 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 | - + | return result; #else // // NOTE: On the .NET Compact Framework, always use our custom connection // string parser as the built-in (i.e. framework provided) one is // unavailable. // |
︙ | |||
2402 2403 2404 2405 2406 2407 2408 | 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 | - + | if (_connectionState != ConnectionState.Closed) throw new InvalidOperationException(); Close(); SortedList<string, string> opts = ParseConnectionString( |
︙ |
Changes to Tests/basic.eagle.
︙ | |||
2257 2258 2259 2260 2261 2262 2263 | 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 | - + + | "OneTwo=ThreeFour" "\"OneTwo\"=\"ThreeFour\"" \ "One Two=Three Four" "\"One Two\"=\"Three Four\"" \ "OneTwo=ThreeFour;" "\"OneTwo\"=\"ThreeFour\";" \ "One Two=Three Four;" "\"One Two\"=\"Three Four\";"] foreach string $strings { set list [object invoke -flags +NonPublic \ |
︙ |
Added Tests/tkt-8d928c3e88.eagle.