Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Remove one set of surrounding single or double quotes from the data source value. This is needed because the connection string may have been built using the SQLiteConnectionStringBuilder class, which reuses connection string construction logic from inside the .NET Framwork itself. Fix for ticket [8c3bee31c8]. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7d432770a95cee8372b884d601428174 |
User & Date: | mistachkin 2012-08-28 01:03:03.387 |
References
2012-08-28
| ||
01:03 | • Closed ticket [8c3bee31c8]: cannot open database file name containing spaces when built by SQLiteConnectionStringBuilder plus 4 other changes artifact: ab66c99584 user: mistachkin | |
Context
2012-08-28
| ||
02:31 | Add links to the official NuGet packages to the download page. check-in: 9e12cdcbf9 user: mistachkin tags: trunk | |
01:03 | Remove one set of surrounding single or double quotes from the data source value. This is needed because the connection string may have been built using the SQLiteConnectionStringBuilder class, which reuses connection string construction logic from inside the .NET Framwork itself. Fix for ticket [8c3bee31c8]. check-in: 7d432770a9 user: mistachkin tags: trunk | |
2012-08-24
| ||
10:09 | Add doc comments for the ToFullPath connection string property. check-in: c9ec60e016 user: mistachkin tags: trunk | |
Changes
Changes to System.Data.SQLite/SQLiteConnection.cs.
︙ | |||
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 | 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 | + | bool fullUri = false; string fileName; if (Convert.ToInt32(FindKey(opts, "Version", DefaultVersion.ToString()), CultureInfo.InvariantCulture) != DefaultVersion) throw new NotSupportedException(String.Format(CultureInfo.CurrentCulture, "Only SQLite Version {0} is supported at this time", DefaultVersion)); fileName = FindKey(opts, "Data Source", DefaultDataSource); fileName = UnwrapFileName(fileName); if (String.IsNullOrEmpty(fileName)) { fileName = FindKey(opts, "Uri", DefaultUri); if (String.IsNullOrEmpty(fileName)) { fileName = FindKey(opts, "FullUri", DefaultFullUri); |
︙ | |||
1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 | 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | { if (pArg != IntPtr.Zero) Marshal.FreeHGlobal(pArg); } return rc; } /// <summary> /// Removes one set of surrounding single -OR- double quotes from the file /// name and returns the resulting file name. If the string is null, empty, /// or contains quotes that are not balanced, nothing is done and the original /// string will be returned. /// </summary> /// <param name="sourceFile">The database file name to process.</param> /// <returns>The modified database file name.</returns> private string UnwrapFileName(string sourceFile) { if (String.IsNullOrEmpty(sourceFile)) { // // NOTE: The string is null or empty, return it verbatim. // return sourceFile; } int length = sourceFile.Length; if (((sourceFile[0] == '\'') && (sourceFile[length - 1] == '\'')) || ((sourceFile[0] == '"') && (sourceFile[length - 1] == '"'))) { // // NOTE: Remove the first and last character. // return sourceFile.Substring(1, length - 2); } // // NOTE: No match, return the input string verbatim. // return sourceFile; } /// <summary> /// Expand the filename of the data source, resolving the |DataDirectory| /// macro as appropriate. /// </summary> /// <param name="sourceFile">The database filename to expand</param> /// <param name="toFullPath"> |
︙ |
Added Tests/tkt-8c3bee31c8.eagle.