Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
717accb2
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
717accb2
编写于
6月 05, 2018
作者:
O
Omar Tawfik
提交者:
GitHub
6月 05, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Merge pull request #25047 from Therzok/sqlite-blob" (#27484)
上级
d3a28d45
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
13 addition
and
44 deletion
+13
-44
build/Targets/Packages.props
build/Targets/Packages.props
+1
-1
src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj
src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj
+2
-2
src/VisualStudio/Setup/VisualStudioSetup.csproj
src/VisualStudio/Setup/VisualStudioSetup.csproj
+6
-6
src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/SqlConnection.cs
...es/Core/Desktop/Workspace/SQLite/Interop/SqlConnection.cs
+3
-5
src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/Util.cs
src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/Util.cs
+0
-21
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.Accessor.cs
...ktop/Workspace/SQLite/SQLitePersistentStorage.Accessor.cs
+1
-2
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs
.../Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs
+0
-4
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_DocumentSerialization.cs
...e/SQLite/SQLitePersistentStorage_DocumentSerialization.cs
+0
-1
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_ProjectSerialization.cs
...ce/SQLite/SQLitePersistentStorage_ProjectSerialization.cs
+0
-1
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_SolutionSerialization.cs
...e/SQLite/SQLitePersistentStorage_SolutionSerialization.cs
+0
-1
未找到文件。
build/Targets/Packages.props
浏览文件 @
717accb2
...
...
@@ -230,7 +230,7 @@
<SystemXmlXmlDocumentVersion>
4.3.0
</SystemXmlXmlDocumentVersion>
<SystemXmlXmlSerializerVersion>
4.3.0
</SystemXmlXmlSerializerVersion>
<SystemXmlXPathXDocumentVersion>
4.3.0
</SystemXmlXPathXDocumentVersion>
<SQLitePCLRawbundle_greenVersion>
1.1.
11
</SQLitePCLRawbundle_greenVersion>
<SQLitePCLRawbundle_greenVersion>
1.1.
2
</SQLitePCLRawbundle_greenVersion>
<UIAComWrapperVersion>
1.1.0.14
</UIAComWrapperVersion>
<MicrosoftVSSDKBuildToolsVersion>
15.8.68-develop-g109a00ff
</MicrosoftVSSDKBuildToolsVersion>
<VSExternalAPIsCodingConventionsVersion>
1.0.60704.2
</VSExternalAPIsCodingConventionsVersion>
...
...
src/VisualStudio/CSharp/Test/CSharpVisualStudioTest.csproj
浏览文件 @
717accb2
...
...
@@ -80,11 +80,11 @@
<PackageReference
Include=
"Microsoft.VisualStudio.Validation"
Version=
"$(MicrosoftVisualStudioValidationVersion)"
/>
</ItemGroup>
<ItemGroup>
<Content
Include=
"$(NuGetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\
$(SQLitePCLRawbundle_greenVersion)\runtimes\win
-x86\native\e_sqlite3.dll"
>
<Content
Include=
"$(NuGetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\
1.1.2\runtimes\win7
-x86\native\e_sqlite3.dll"
>
<Link>
x86\e_sqlite3.dll
</Link>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</Content>
<Content
Include=
"$(NuGetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\
$(SQLitePCLRawbundle_greenVersion)\runtimes\win
-x64\native\e_sqlite3.dll"
>
<Content
Include=
"$(NuGetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\
1.1.2\runtimes\win7
-x64\native\e_sqlite3.dll"
>
<Link>
x64\e_sqlite3.dll
</Link>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</Content>
...
...
src/VisualStudio/Setup/VisualStudioSetup.csproj
浏览文件 @
717accb2
...
...
@@ -241,16 +241,16 @@
<NuGetPackageToIncludeInVsix
Include=
"Mono.Cecil"
/>
</ItemGroup>
<ItemGroup>
<VSIXSourceItem
Include=
"$(NuGetPackageRoot)\SQLitePCLRaw.bundle_green\
$(SQLitePCLRawbundle_greenVersion)
\lib\net45\SQLitePCLRaw.batteries_green.dll"
/>
<VSIXSourceItem
Include=
"$(NuGetPackageRoot)\SQLitePCLRaw.bundle_green\
$(SQLitePCLRawbundle_greenVersion)
\lib\net45\SQLitePCLRaw.batteries_v2.dll"
/>
<VSIXSourceItem
Include=
"$(NuGetPackageRoot)\SQLitePCLRaw.provider.e_sqlite3.net45\
$(SQLitePCLRawbundle_greenVersion)
\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll"
/>
<VSIXSourceItem
Include=
"$(NuGetPackageRoot)\SQLitePCLRaw.core\
$(SQLitePCLRawbundle_greenVersion)
\lib\net45\SQLitePCLRaw.core.dll"
/>
<Content
Include=
"$(NuGetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\
$(SQLitePCLRawbundle_greenVersion)\runtimes\win
-x86\native\e_sqlite3.dll"
>
<VSIXSourceItem
Include=
"$(NuGetPackageRoot)\SQLitePCLRaw.bundle_green\
1.1.2
\lib\net45\SQLitePCLRaw.batteries_green.dll"
/>
<VSIXSourceItem
Include=
"$(NuGetPackageRoot)\SQLitePCLRaw.bundle_green\
1.1.2
\lib\net45\SQLitePCLRaw.batteries_v2.dll"
/>
<VSIXSourceItem
Include=
"$(NuGetPackageRoot)\SQLitePCLRaw.provider.e_sqlite3.net45\
1.1.2
\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll"
/>
<VSIXSourceItem
Include=
"$(NuGetPackageRoot)\SQLitePCLRaw.core\
1.1.2
\lib\net45\SQLitePCLRaw.core.dll"
/>
<Content
Include=
"$(NuGetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\
1.1.2\runtimes\win7
-x86\native\e_sqlite3.dll"
>
<Link>
x86\e_sqlite3.dll
</Link>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
<IncludeInVSIX>
true
</IncludeInVSIX>
</Content>
<Content
Include=
"$(NuGetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\
$(SQLitePCLRawbundle_greenVersion)\runtimes\win
-x64\native\e_sqlite3.dll"
>
<Content
Include=
"$(NuGetPackageRoot)\sqlitepclraw.lib.e_sqlite3.v110_xp\
1.1.2\runtimes\win7
-x64\native\e_sqlite3.dll"
>
<Link>
x64\e_sqlite3.dll
</Link>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
<IncludeInVSIX>
true
</IncludeInVSIX>
...
...
src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/SqlConnection.cs
浏览文件 @
717accb2
...
...
@@ -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.
...
...
src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/Util.cs
已删除
100644 → 0
浏览文件 @
d3a28d45
// 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"
);
}
}
}
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.Accessor.cs
浏览文件 @
717accb2
...
...
@@ -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
(
DataTableName
Ptr
,
DataColumnNamePtr
,
rowId
);
return
connection
.
ReadBlob
(
DataTableName
,
DataColumnName
,
rowId
);
}
return
null
;
...
...
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs
浏览文件 @
717accb2
...
...
@@ -54,7 +54,6 @@ internal partial class SQLitePersistentStorage : AbstractPersistentStorage
/// -----------------------------------------------
/// </summary>
private
const
string
SolutionDataTableName
=
"SolutionData"
+
Version
;
private
static
readonly
byte
[]
SolutionDataTableNamePtr
=
Util
.
ToUtf8WithNullTerminator
(
SolutionDataTableName
);
/// <summary>
/// Inside the DB we have a table for data that we want associated with a <see cref="Project"/>.
...
...
@@ -72,7 +71,6 @@ internal partial class SQLitePersistentStorage : AbstractPersistentStorage
/// -----------------------------------------------
/// </summary>
private
const
string
ProjectDataTableName
=
"ProjectData"
+
Version
;
private
static
readonly
byte
[]
ProjectDataTableNamePtr
=
Util
.
ToUtf8WithNullTerminator
(
ProjectDataTableName
);
/// <summary>
/// Inside the DB we have a table for data that we want associated with a <see cref="Document"/>.
...
...
@@ -90,11 +88,9 @@ internal partial class SQLitePersistentStorage : AbstractPersistentStorage
/// ----------------------------------------------
/// </summary>
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
();
...
...
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_DocumentSerialization.cs
浏览文件 @
717accb2
...
...
@@ -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
);
...
...
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_ProjectSerialization.cs
浏览文件 @
717accb2
...
...
@@ -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
);
...
...
src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage_SolutionSerialization.cs
浏览文件 @
717accb2
...
...
@@ -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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录