Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
c24f4c57
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,发现更多精彩内容 >>
提交
c24f4c57
编写于
5月 23, 2017
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Style; removed useless catch [#CLICKHOUSE-2955].
上级
d7e5e650
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
37 deletion
+28
-37
dbms/src/Dictionaries/MySQLDictionarySource.cpp
dbms/src/Dictionaries/MySQLDictionarySource.cpp
+2
-2
dbms/src/Dictionaries/ODBCDictionarySource.cpp
dbms/src/Dictionaries/ODBCDictionarySource.cpp
+2
-2
dbms/src/Dictionaries/readInvalidateQuery.cpp
dbms/src/Dictionaries/readInvalidateQuery.cpp
+23
-32
dbms/src/Dictionaries/readInvalidateQuery.h
dbms/src/Dictionaries/readInvalidateQuery.h
+1
-1
未找到文件。
dbms/src/Dictionaries/MySQLDictionarySource.cpp
浏览文件 @
c24f4c57
...
...
@@ -181,8 +181,8 @@ std::string MySQLDictionarySource::doInvalidateQuery(const std::string & request
Block
sample_block
;
ColumnPtr
column
(
std
::
make_shared
<
ColumnString
>
());
sample_block
.
insert
(
ColumnWithTypeAndName
(
column
,
std
::
make_shared
<
DataTypeString
>
(),
"Sample Block"
));
MySQLBlockInputStream
block
InputS
tream
(
pool
.
Get
(),
request
,
sample_block
,
1
);
return
readInvalidateQuery
(
block
InputS
tream
);
MySQLBlockInputStream
block
_input_s
tream
(
pool
.
Get
(),
request
,
sample_block
,
1
);
return
readInvalidateQuery
(
block
_input_s
tream
);
}
}
...
...
dbms/src/Dictionaries/ODBCDictionarySource.cpp
浏览文件 @
c24f4c57
...
...
@@ -116,8 +116,8 @@ std::string ODBCDictionarySource::doInvalidateQuery(const std::string & request)
Block
sample_block
;
ColumnPtr
column
(
std
::
make_shared
<
ColumnString
>
());
sample_block
.
insert
(
ColumnWithTypeAndName
(
column
,
std
::
make_shared
<
DataTypeString
>
(),
"Sample Block"
));
ODBCBlockInputStream
block
InputS
tream
(
pool
->
get
(),
request
,
sample_block
,
1
);
return
readInvalidateQuery
(
block
InputS
tream
);
ODBCBlockInputStream
block
_input_s
tream
(
pool
->
get
(),
request
,
sample_block
,
1
);
return
readInvalidateQuery
(
block
_input_s
tream
);
}
}
dbms/src/Dictionaries/readInvalidateQuery.cpp
浏览文件 @
c24f4c57
...
...
@@ -11,44 +11,35 @@ extern const int TOO_MUCH_ROWS;
extern
const
int
RECEIVED_EMPTY_DATA
;
}
std
::
string
readInvalidateQuery
(
IProfilingBlockInputStream
&
block
InputS
tream
)
std
::
string
readInvalidateQuery
(
IProfilingBlockInputStream
&
block
_input_s
tream
)
{
block
InputS
tream
.
readPrefix
();
block
_input_s
tream
.
readPrefix
();
std
::
string
response
;
try
{
Block
block
=
blockInputStream
.
read
();
if
(
!
block
)
throw
Exception
(
"Empty response"
,
ErrorCodes
::
RECEIVED_EMPTY_DATA
);
auto
columns
=
block
.
columns
();
if
(
columns
>
1
)
throw
Exception
(
"Expected single column in resultset, got "
+
std
::
to_string
(
columns
),
ErrorCodes
::
TOO_MUCH_COLUMNS
);
auto
rows
=
block
.
rows
();
if
(
rows
==
0
)
throw
Exception
(
"Expected single row in resultset, got 0"
,
ErrorCodes
::
RECEIVED_EMPTY_DATA
);
if
(
rows
>
1
)
throw
Exception
(
"Expected single row in resultset, got at least "
+
std
::
to_string
(
rows
),
ErrorCodes
::
TOO_MUCH_ROWS
);
auto
column
=
block
.
getByPosition
(
0
).
column
;
response
=
column
->
getDataAt
(
0
).
toString
();
while
(
block
=
blockInputStream
.
read
())
{
if
(
block
.
rows
()
>
0
)
throw
Exception
(
"Expected single row in resultset, got at least "
+
std
::
to_string
(
rows
+
1
),
ErrorCodes
::
TOO_MUCH_ROWS
);
}
}
catch
(
Exception
&
exception
)
Block
block
=
block_input_stream
.
read
();
if
(
!
block
)
throw
Exception
(
"Empty response"
,
ErrorCodes
::
RECEIVED_EMPTY_DATA
);
auto
columns
=
block
.
columns
();
if
(
columns
>
1
)
throw
Exception
(
"Expected single column in resultset, got "
+
std
::
to_string
(
columns
),
ErrorCodes
::
TOO_MUCH_COLUMNS
);
auto
rows
=
block
.
rows
();
if
(
rows
==
0
)
throw
Exception
(
"Expected single row in resultset, got 0"
,
ErrorCodes
::
RECEIVED_EMPTY_DATA
);
if
(
rows
>
1
)
throw
Exception
(
"Expected single row in resultset, got at least "
+
std
::
to_string
(
rows
),
ErrorCodes
::
TOO_MUCH_ROWS
);
auto
column
=
block
.
getByPosition
(
0
).
column
;
response
=
column
->
getDataAt
(
0
).
toString
();
while
(
block
=
block_input_stream
.
read
())
{
blockInputStream
.
cancel
();
blockInputStream
.
readSuffix
();
throw
;
if
(
block
.
rows
()
>
0
)
throw
Exception
(
"Expected single row in resultset, got at least "
+
std
::
to_string
(
rows
+
1
),
ErrorCodes
::
TOO_MUCH_ROWS
);
}
block
InputS
tream
.
readSuffix
();
block
_input_s
tream
.
readSuffix
();
return
response
;
}
...
...
dbms/src/Dictionaries/readInvalidateQuery.h
浏览文件 @
c24f4c57
...
...
@@ -7,7 +7,7 @@ namespace DB
{
// Using in MySQLDictionarySource and ODBCDictionarySource after processing invalidate_query
std
::
string
readInvalidateQuery
(
IProfilingBlockInputStream
&
block
InputS
tream
);
std
::
string
readInvalidateQuery
(
IProfilingBlockInputStream
&
block
_input_s
tream
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录