提交 a4b28db4 编写于 作者: A Alexey Milovidov

Merge branch 'master' of github.com:yandex/ClickHouse

......@@ -35,6 +35,7 @@ namespace ErrorCodes
extern const int CANNOT_PARSE_DATE;
extern const int CANNOT_PARSE_DATETIME;
extern const int CANNOT_READ_ARRAY_FROM_TEXT;
extern const int CANNOT_PARSE_NUMBER;
}
/// Helper functions for formatted input.
......@@ -243,7 +244,12 @@ ReturnType readIntTextImpl(T & x, ReadBuffer & buf)
if (std::is_signed<T>::value)
negative = true;
else
return ReturnType(false);
{
if (throw_exception)
throw Exception("Unsigned type must not contain '-' symbol", ErrorCodes::CANNOT_PARSE_NUMBER);
else
return ReturnType(false);
}
break;
case '0':
case '1':
......@@ -887,6 +893,7 @@ inline T parse(const char * data, size_t size)
T res;
ReadBufferFromMemory buf(data, size);
readText(res, buf);
assertEOF(buf);
return res;
}
......
......@@ -8,8 +8,32 @@
#include <Poco/HexBinaryEncoder.h>
static void parse_trash_string_as_uint_must_fail(const std::string & str)
{
using namespace DB;
unsigned x = 0xFF;
try
{
x = parse<unsigned>(str);
}
catch (...)
{
/// Ok
return;
}
std::cerr << "Parsing must fail, but finished sucessfully x=" << x;
exit(-1);
}
int main(int argc, char ** argv)
{
parse_trash_string_as_uint_must_fail("trash");
parse_trash_string_as_uint_must_fail("-1");
if (argc != 2)
{
std::cerr << "Usage: " << std::endl
......
......@@ -136,7 +136,14 @@ static std::chrono::steady_clock::duration parseSessionTimeout(const HTMLForm &
unsigned max_session_timeout = config.getUInt("max_session_timeout", 3600);
std::string session_timeout_str = params.get("session_timeout");
session_timeout = parse<unsigned>(session_timeout_str);
try
{
session_timeout = parse<unsigned>(session_timeout_str);
}
catch (...)
{
throw Exception(getCurrentExceptionMessage(false) + ". Invalid session timeout", ErrorCodes::INVALID_SESSION_TIMEOUT);
}
if (session_timeout > max_session_timeout)
throw Exception("Session timeout '" + session_timeout_str + "' is larger than max_session_timeout: " + toString(max_session_timeout)
......
......@@ -44,7 +44,7 @@ check "$url$session&session_check=0" "$select" "Exception" 0 "session_check=0 do
request $url$session "SET max_rows_to_read=7777777"
check "$url$session&session_timeout=string" "$select" "Exception.*Invalid session timeout" 1 "Non-numeric value accepted as a timeout."
check "$url$session&session_timeout=3601" "$select" "Exception.*Invalid session timeout" 1 "More then 3600 seconds accepted as a timeout."
check "$url$session&session_timeout=3601" "$select" "Exception.*Maximum session timeout*" 1 "More then 3600 seconds accepted as a timeout."
check "$url$session&session_timeout=-1" "$select" "Exception.*Invalid session timeout" 1 "Negative timeout accepted."
check "$url$session&session_timeout=0" "$select" "Exception" 0 "Zero timeout not accepted."
check "$url$session&session_timeout=3600" "$select" "Exception" 0 "3600 second timeout not accepted."
......
此差异已折叠。
......@@ -22,13 +22,22 @@ pre {
input {
display: block;
margin-bottom: 4px;
margin: 0 0 4px 0;
}
a.reference {
border-bottom: none;
}
input[type="submit"] {
border: none!important;
background: #fc0;
}
#svg-flag {
border: 1px solid #eee;
}
@font-face {
font-family: 'Yandex Sans Text Web';
src: url(https://yastatic.net/adv-www/_/yy5JveR58JFkc97waf-xp0i6_jM.eot);
......
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg-flag" viewBox="0 0 25 15" height="12" width="20" border="1">
<defs id="defs14"/>
<rect id="rect4" fill="#00247d" height="15" width="25"/>
<path id="path6" stroke-width="3" stroke="#fff" d="M0 0L25 15M25 0L0 15"/>
<path id="path8" stroke-width="5" stroke="#fff" d="M12.5 0V15M0 7.5H25"/>
<path id="path10" stroke-width="3" stroke="#cf142b" d="M12.5 0V15M0 7.5H25"/>
</svg>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg-flag" height="12" width="20" viewBox="0 0 10 6" border="1">
<defs id="defs12"/>
<rect id="rect4" height="3" width="10" fill="#fff"/>
<rect id="rect6" height="3" width="10" y="3" fill="#d52b1e"/>
<rect id="rect8" height="2" width="10" y="2" fill="#0039a6"/>
</svg>
......@@ -125,7 +125,7 @@ html_theme_options = {
'link': '#08f',
'link_hover': 'red',
'extra_nav_links': collections.OrderedDict([
('Switch to Russian 🇷🇺 ', '/docs/ru/'),
('Switch to Russian <img id="svg-flag" src="/docs/en/_static/ru.svg" width="20" height="12" />', '/docs/ru/'),
('Single page documentation', '/docs/en/single/'),
('Website home', '/'),
('GitHub', 'https://github.com/yandex/ClickHouse'),
......
Перешардирование
Resharding
----------------
.. code-block:: sql
......
......@@ -125,7 +125,7 @@ html_theme_options = {
'link': '#08f',
'link_hover': 'red',
'extra_nav_links': collections.OrderedDict([
('Switch to English 🇬🇧', '/docs/en/'),
('Switch to English <img id="svg-flag" src="/docs/ru/_static/en.svg" width="20" height="12" />', '/docs/en/'),
('Документация на одной странице', '/docs/ru/single/'),
('Главная страница сайта', '/'),
('GitHub', 'https://github.com/yandex/ClickHouse'),
......
此差异已折叠。
#!/bin/bash
set -e
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
cd $CURDIR
......
......@@ -12,14 +12,8 @@ function make_control {
# set environment variables REVISION, AUTHOR
function gen_revision_author {
REVISION=$(get_revision)
if [ -z $VERSION_PREFIX ] ; then
VERSION_PREFIX="v1.1."
fi
if [ -z $VERSION_POSTFIX ] ; then
VERSION_POSTFIX="-testing"
fi
VERSION_PREFIX="${VERSION_PREFIX:-v1.1.}"
VERSION_POSTFIX="${VERSION_POSTFIX:--testing}"
if [[ $STANDALONE != 'yes' ]]; then
......
ClickHouse website quickstart:
1. If npm is not installed: `apt-get install npm` for Debian/Ubuntu, `brew install npm` for Mac OS or download and install manually https://nodejs.org/en/download/
2. Run setup\_gulp.sh once to install prerequisites via npm
3. Use `gulp build` to minify website to "public" folder or just `gulp` to run local webserver with livereload serving it
1. Make sure you have `npm`, `docker` and `python` installed and available in your `$PATH`.
2. Run `setup\_gulp.sh` once to install build prerequisites via npm.
3. Use `gulp build` to minify website to "public" subfolder or just `gulp` to run local webserver with livereload serving it (note: livereload browser extension is required to make it actually reload pages on edits automatically).
4. There's Dockerfile that can be used to build and run ClickHouse website inside docker.
4. Deployment to https://clickhouse.yandex is managed by `release.sh`, but it is only usable from inside Yandex private network.
......@@ -49,7 +49,13 @@ gulp.task('reference', [], function () {
.pipe(gulp.dest(outputDir))
});
gulp.task('docs', [], function () {
gulp.task('docstxt', [], function () {
run('cd ' + docsDir + '; make');
return gulp.src(paths.docs)
.pipe(gulp.dest(outputDir + '/../docs'))
});
gulp.task('docs', ['docstxt'], function () {
run('cd ' + docsDir + '; make');
return gulp.src(paths.docs)
.pipe(gulp.dest(outputDir + '/../docs'))
......
......@@ -847,6 +847,11 @@ clickhouse-client
window.history.replaceState('', document.title, window.location.href.replace(location.hash, '') + this.hash);
});
var hostParts = window.location.host.split('.');
if (hostParts.length > 2 && hostParts[0] != 'test') {
window.location.host = hostParts[0] + '.' + hostParts[1];
}
var available_distributives = ['xenial', 'trusty', 'precise'];
available_distributives.forEach(function (name) {
$('#ubuntu_' + name).on('click', function () {
......
......@@ -50,15 +50,6 @@ function getParams() {
<script type="text/javascript" src="https://yandex.st/jquery/1.7.2/jquery.min.js"></script>
<div class="island">
<div style="background:#fc0;margin-bottom:5em;padding:3em;">
<div>
<span style="font-size:3em;line-height:1.1em">Warning!</span>
<p style="font-size:1.2em;line-height:1.1em">
ClickHouse documentation has been moved to new location and the rest of this page is considered deprecated.<br>
<a href="docs/en/" style="font-weight:bold;">Go to current ClickHouse documentation</a>
</p>
</div>
</div>
<div style="float: left; margin-right: -100%; margin-top: 3px; margin-left: 3px;">
<a href="/">
<svg xmlns="http://www.w3.org/2000/svg" width="90" height="80" viewBox="0 0 9 8">
......
......@@ -52,16 +52,6 @@ function getParams() {
<script type="text/javascript" src="https://yandex.st/jquery/1.7.2/jquery.min.js"></script>
<div class="island">
<div style="background:#fc0;margin-bottom:5em;padding:3em;">
<div>
<span style="font-size:3em;line-height:1.1em">Внимание!</span>
<p style="font-size:1.2em;line-height:1.1em">
Документация по ClickHouse переехала на другой адрес и оставшаяся часть данной страницы более не
является актуальной.<br>
<a href="docs/ru/" style="font-weight:bold;">Перейти к текущей документации по ClickHouse</a>
</p>
</div>
</div>
<div style="float: left; margin-right: -100%; margin-top: 3px; margin-left: 3px;">
<a href="/">
<svg xmlns="http://www.w3.org/2000/svg" width="90" height="80" viewBox="0 0 9 8">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册