Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
8de41586
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
8de41586
编写于
11月 24, 2020
作者:
A
Alexander Kuzmenkov
提交者:
GitHub
11月 24, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17206 from ClickHouse/aku/noescape
Remove escaping from toString(std::string)
上级
828d27d8
951a59ef
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
8 deletion
+8
-8
src/IO/WriteHelpers.h
src/IO/WriteHelpers.h
+3
-3
src/Storages/ColumnsDescription.cpp
src/Storages/ColumnsDescription.cpp
+5
-5
未找到文件。
src/IO/WriteHelpers.h
浏览文件 @
8de41586
...
...
@@ -859,15 +859,15 @@ template <typename T>
inline
std
::
enable_if_t
<
std
::
is_floating_point_v
<
T
>
,
void
>
writeText
(
const
T
&
x
,
WriteBuffer
&
buf
)
{
writeFloatText
(
x
,
buf
);
}
inline
void
writeText
(
const
String
&
x
,
WriteBuffer
&
buf
)
{
write
EscapedString
(
x
,
buf
);
}
inline
void
writeText
(
const
String
&
x
,
WriteBuffer
&
buf
)
{
write
String
(
x
.
c_str
(),
x
.
size
()
,
buf
);
}
/// Implemented as template specialization (not function overload) to avoid preference over templates on arithmetic types above.
template
<
>
inline
void
writeText
<
bool
>
(
const
bool
&
x
,
WriteBuffer
&
buf
)
{
writeBoolText
(
x
,
buf
);
}
/// unlike the method for std::string
/// assumes here that `x` is a null-terminated string.
inline
void
writeText
(
const
char
*
x
,
WriteBuffer
&
buf
)
{
write
EscapedString
(
x
,
strlen
(
x
)
,
buf
);
}
inline
void
writeText
(
const
char
*
x
,
size_t
size
,
WriteBuffer
&
buf
)
{
write
Escaped
String
(
x
,
size
,
buf
);
}
inline
void
writeText
(
const
char
*
x
,
WriteBuffer
&
buf
)
{
write
CString
(
x
,
buf
);
}
inline
void
writeText
(
const
char
*
x
,
size_t
size
,
WriteBuffer
&
buf
)
{
writeString
(
x
,
size
,
buf
);
}
inline
void
writeText
(
const
DayNum
&
x
,
WriteBuffer
&
buf
)
{
writeDateText
(
LocalDate
(
x
),
buf
);
}
inline
void
writeText
(
const
LocalDate
&
x
,
WriteBuffer
&
buf
)
{
writeDateText
(
x
,
buf
);
}
...
...
src/Storages/ColumnsDescription.cpp
浏览文件 @
8de41586
...
...
@@ -63,34 +63,34 @@ void ColumnDescription::writeText(WriteBuffer & buf) const
{
writeBackQuotedString
(
name
,
buf
);
writeChar
(
' '
,
buf
);
DB
::
writeText
(
type
->
getName
(),
buf
);
writeEscapedString
(
type
->
getName
(),
buf
);
if
(
default_desc
.
expression
)
{
writeChar
(
'\t'
,
buf
);
DB
::
writeText
(
DB
::
toString
(
default_desc
.
kind
),
buf
);
writeChar
(
'\t'
,
buf
);
DB
::
writeText
(
queryToString
(
default_desc
.
expression
),
buf
);
writeEscapedString
(
queryToString
(
default_desc
.
expression
),
buf
);
}
if
(
!
comment
.
empty
())
{
writeChar
(
'\t'
,
buf
);
DB
::
writeText
(
"COMMENT "
,
buf
);
DB
::
writeText
(
queryToString
(
ASTLiteral
(
Field
(
comment
))),
buf
);
writeEscapedString
(
queryToString
(
ASTLiteral
(
Field
(
comment
))),
buf
);
}
if
(
codec
)
{
writeChar
(
'\t'
,
buf
);
DB
::
writeText
(
queryToString
(
codec
),
buf
);
writeEscapedString
(
queryToString
(
codec
),
buf
);
}
if
(
ttl
)
{
writeChar
(
'\t'
,
buf
);
DB
::
writeText
(
"TTL "
,
buf
);
DB
::
writeText
(
queryToString
(
ttl
),
buf
);
writeEscapedString
(
queryToString
(
ttl
),
buf
);
}
writeChar
(
'\n'
,
buf
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录