diff --git a/build/Targets/Packages.props b/build/Targets/Packages.props index 0b307367edbf95d4ef9233bc962e74fefb5310c6..f38eaa44bac401aa7a1f35bd6fd5d0bb10d91538 100644 --- a/build/Targets/Packages.props +++ b/build/Targets/Packages.props @@ -230,7 +230,7 @@ 4.3.0 4.3.0 4.3.0 - 1.1.11 + 1.1.2 1.1.0.14 15.8.68-develop-g109a00ff 1.0.60704.2 diff --git a/src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj b/src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj index d3be9665ab16121ce72c78195038ce0ae4f34da1..e9da335c44cca185bebb0afc7b64cec900d61997 100644 --- a/src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj +++ b/src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj @@ -80,11 +80,11 @@ - + x86\e_sqlite3.dll PreserveNewest - + x64\e_sqlite3.dll PreserveNewest diff --git a/src/VisualStudio/Setup/VisualStudioSetup.csproj b/src/VisualStudio/Setup/VisualStudioSetup.csproj index ab245a7d5753c6a9c452a79d69fa40e4ff8490ee..1514d51d42a6ffea5603df32ee879027bee8cb8b 100644 --- a/src/VisualStudio/Setup/VisualStudioSetup.csproj +++ b/src/VisualStudio/Setup/VisualStudioSetup.csproj @@ -241,16 +241,16 @@ - - - - - + + + + + x86\e_sqlite3.dll PreserveNewest true - + x64\e_sqlite3.dll PreserveNewest true diff --git a/src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/SqlConnection.cs b/src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/SqlConnection.cs index c43d878bd2db8e231a85b9121f5fdd1d59497e06..e5e1e5d4076795a82a57cf1b5b5c568d49878d6a 100644 --- a/src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/SqlConnection.cs +++ b/src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/SqlConnection.cs @@ -184,7 +184,7 @@ private void Rollback(bool throwOnError) public int LastInsertRowId() => (int)raw.sqlite3_last_insert_rowid(_handle); - public Stream ReadBlob(byte[] dataTableName, byte[] dataColumnName, long rowId) + public Stream ReadBlob(string dataTableName, string dataColumnName, long rowId) { // NOTE: we do need to do the blob reading in a transaction because of the // following: https://www.sqlite.org/c3ref/blob_open.html @@ -204,12 +204,10 @@ public Stream ReadBlob(byte[] dataTableName, byte[] dataColumnName, long rowId) return stream; } - - private static readonly byte[] mainPtr = Util.ToUtf8WithNullTerminator("main"); - private Stream ReadBlob_InTransaction(byte[] tableName, byte[] columnName, long rowId) + private Stream ReadBlob_InTransaction(string tableName, string columnName, long rowId) { const int ReadOnlyFlags = 0; - var result = raw.sqlite3_blob_open(_handle, mainPtr, tableName, columnName, rowId, ReadOnlyFlags, out var blob); + var result = raw.sqlite3_blob_open(_handle, "main", tableName, columnName, rowId, ReadOnlyFlags, out var blob); if (result == raw.SQLITE_ERROR) { // can happen when rowId points to a row that hasn't been written to yet. diff --git a/src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/Util.cs b/src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/Util.cs deleted file mode 100644 index c3754d34f4548d841eb6b091d232d8aae73ab089..0000000000000000000000000000000000000000 --- a/src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/Util.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Text; - -namespace Microsoft.CodeAnalysis.SQLite -{ - internal static class Util - { - internal static byte[] ToUtf8WithNullTerminator(string text) - { - if (text == null) - { - return null; - } - - // SQLite expects null terminated UTF8, so append an extra null terminator - return Encoding.UTF8.GetBytes(text + "\0"); - } - } -} diff --git a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.Accessor.cs b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.Accessor.cs index a0ba4e8f9f6a171793077ddb2f215b6bd1e75428..890d67c0f8b328f2204e44c63f594a120f40bc5c 100644 --- a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.Accessor.cs +++ b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.Accessor.cs @@ -45,7 +45,6 @@ public Accessor(SQLitePersistentStorage storage) } protected abstract string DataTableName { get; } - protected abstract byte[] DataTableNamePtr { get; } protected abstract bool TryGetDatabaseId(SqlConnection connection, TKey key, out TDatabaseId dataId); protected abstract void BindFirstParameter(SqlStatement statement, TDatabaseId dataId); @@ -147,7 +146,7 @@ private Stream ReadBlob(SqlConnection connection, TDatabaseId dataId) // data for a row in our system can change, the ID will always stay the // same, and the data will always be valid for our ID. So there is no // safety issue here. - return connection.ReadBlob(DataTableNamePtr, DataColumnNamePtr, rowId); + return connection.ReadBlob(DataTableName, DataColumnName, rowId); } return null; diff --git a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs index e749af881f5233393366f71a8f800aca2645a510..a18c545e71afb3a26397f47b132b9c53a15d57b3 100644 --- a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs +++ b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs @@ -54,7 +54,6 @@ internal partial class SQLitePersistentStorage : AbstractPersistentStorage /// ----------------------------------------------- /// private const string SolutionDataTableName = "SolutionData" + Version; - private static readonly byte[] SolutionDataTableNamePtr = Util.ToUtf8WithNullTerminator(SolutionDataTableName); /// /// Inside the DB we have a table for data that we want associated with a . @@ -72,7 +71,6 @@ internal partial class SQLitePersistentStorage : AbstractPersistentStorage /// ----------------------------------------------- /// private const string ProjectDataTableName = "ProjectData" + Version; - private static readonly byte[] ProjectDataTableNamePtr = Util.ToUtf8WithNullTerminator(ProjectDataTableName); /// /// Inside the DB we have a table for data that we want associated with a . @@ -90,11 +88,9 @@ internal partial class SQLitePersistentStorage : AbstractPersistentStorage /// ---------------------------------------------- /// private const string DocumentDataTableName = "DocumentData" + Version; - private static readonly byte[] DocumentDataTableNamePtr = Util.ToUtf8WithNullTerminator(DocumentDataTableName); private const string DataIdColumnName = "DataId"; private const string DataColumnName = "Data"; - private static readonly byte[] DataColumnNamePtr = Util.ToUtf8WithNullTerminator(DataColumnName); private readonly CancellationTokenSource _shutdownTokenSource = new CancellationTokenSource(); diff --git a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_DocumentSerialization.cs b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_DocumentSerialization.cs index ec83462ba3bc37bf5cc5d77740c9c3ea573df573..7d2bea6740bad6f5d6f40e1b929b9c46195e9929 100644 --- a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_DocumentSerialization.cs +++ b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_DocumentSerialization.cs @@ -29,7 +29,6 @@ public DocumentAccessor(SQLitePersistentStorage storage) : base(storage) } protected override string DataTableName => DocumentDataTableName; - protected override byte[] DataTableNamePtr => DocumentDataTableNamePtr; protected override (DocumentId, string) GetWriteQueueKey((Document document, string name) key) => (key.document.Id, key.name); diff --git a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_ProjectSerialization.cs b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_ProjectSerialization.cs index f7afe877d3b9129deafc9616f4e1482cfb73bbf9..5b603e5c0bdf2847e1e5074df73bccb73cdaac37 100644 --- a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_ProjectSerialization.cs +++ b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_ProjectSerialization.cs @@ -29,7 +29,6 @@ public ProjectAccessor(SQLitePersistentStorage storage) : base(storage) } protected override string DataTableName => ProjectDataTableName; - protected override byte[] DataTableNamePtr => ProjectDataTableNamePtr; protected override (ProjectId projectId, string name) GetWriteQueueKey((Project project, string name) key) => (key.project.Id, key.name); diff --git a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_SolutionSerialization.cs b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_SolutionSerialization.cs index afb82a41e14f8ce11cde94e29e3074db9a5f46db..38149892ce27f68123861bad4f2a106e34d52b8c 100644 --- a/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_SolutionSerialization.cs +++ b/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_SolutionSerialization.cs @@ -27,7 +27,6 @@ public SolutionAccessor(SQLitePersistentStorage storage) : base(storage) } protected override string DataTableName => SolutionDataTableName; - protected override byte[] DataTableNamePtr => SolutionDataTableNamePtr; protected override string GetWriteQueueKey(string key) => key;