Merge remote-tracking branch 'upstream/master' into fix10

This commit is contained in:
proller 2019-02-12 12:51:01 +03:00
commit af29067fa9
15 changed files with 35 additions and 14 deletions

View File

@ -3,7 +3,6 @@ set -e -x
source default-config
# TODO Non debian systems
./install-os-packages.sh svn
./install-os-packages.sh cmake

View File

@ -240,7 +240,7 @@ void PerformanceTest::runQueries(
statistics.startWatches();
try
{
executeQuery(connection, query, statistics, stop_conditions, interrupt_listener, context);
executeQuery(connection, query, statistics, stop_conditions, interrupt_listener, context, test_info.settings);
if (test_info.exec_type == ExecutionType::Loop)
{
@ -254,7 +254,7 @@ void PerformanceTest::runQueries(
break;
}
executeQuery(connection, query, statistics, stop_conditions, interrupt_listener, context);
executeQuery(connection, query, statistics, stop_conditions, interrupt_listener, context, test_info.settings);
}
}
}

View File

@ -44,14 +44,14 @@ void executeQuery(
TestStats & statistics,
TestStopConditions & stop_conditions,
InterruptListener & interrupt_listener,
Context & context)
Context & context,
const Settings & settings)
{
statistics.watch_per_query.restart();
statistics.last_query_was_cancelled = false;
statistics.last_query_rows_read = 0;
statistics.last_query_bytes_read = 0;
Settings settings;
RemoteBlockInputStream stream(connection, query, {}, context, &settings);
stream.setProgressCallback(

View File

@ -4,6 +4,7 @@
#include "TestStopConditions.h"
#include <Common/InterruptListener.h>
#include <Interpreters/Context.h>
#include <Interpreters/Settings.h>
#include <Client/Connection.h>
namespace DB
@ -14,5 +15,6 @@ void executeQuery(
TestStats & statistics,
TestStopConditions & stop_conditions,
InterruptListener & interrupt_listener,
Context & context);
Context & context,
const Settings & settings);
}

View File

@ -416,6 +416,7 @@ namespace ErrorCodes
extern const int CANNOT_SCHEDULE_TASK = 439;
extern const int INVALID_LIMIT_EXPRESSION = 440;
extern const int CANNOT_PARSE_DOMAIN_VALUE_FROM_STRING = 441;
extern const int BAD_DATABASE_FOR_TEMPORARY_TABLE = 442;
extern const int KEEPER_EXCEPTION = 999;
extern const int POCO_EXCEPTION = 1000;

View File

@ -12,8 +12,13 @@ namespace DB
namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
extern const int TOO_LARGE_ARRAY_SIZE;
}
/// Reasonable threshold.
static constexpr size_t max_arrays_size_in_block = 1000000000;
/* arrayWithConstant(num, const) - make array of constants with length num.
* arrayWithConstant(3, 'hello') = ['hello', 'hello', 'hello']
* arrayWithConstant(1, 'hello') = ['hello']
@ -55,6 +60,8 @@ public:
for (size_t i = 0; i < num_rows; ++i)
{
offset += col_num->getUInt(i);
if (unlikely(offset > max_arrays_size_in_block))
throw Exception("Too large array size while executing function " + getName(), ErrorCodes::TOO_LARGE_ARRAY_SIZE);
offsets.push_back(offset);
}

View File

@ -63,6 +63,7 @@ namespace ErrorCodes
extern const int DATABASE_ALREADY_EXISTS;
extern const int QUERY_IS_PROHIBITED;
extern const int THERE_IS_NO_DEFAULT_VALUE;
extern const int BAD_DATABASE_FOR_TEMPORARY_TABLE;
}
@ -547,6 +548,11 @@ BlockIO InterpreterCreateQuery::createTable(ASTCreateQuery & create)
return executeDDLQueryOnCluster(query_ptr, context, std::move(databases));
}
/// Temporary tables are created out of databases.
if (create.temporary && !create.database.empty())
throw Exception("Temporary tables cannot be inside a database. You should not specify a database for a temporary table.",
ErrorCodes::BAD_DATABASE_FOR_TEMPORARY_TABLE);
String path = context.getPath();
String current_database = context.getCurrentDatabase();

View File

@ -38,9 +38,9 @@
-->
<query><![CDATA[select sum(UserID + 1 in (select UserID from hits_100m_single)) from hits_100m_single]]></query>
<query><![CDATA[select sum((UserID + 1, RegionID) in (select UserID, RegionID from hits_100m_single)) from hits_100m_single]]></query>
<query><![CDATA[select sum(URL in (select URL from hits_100m where URL != '')) from hits_100m_single]]></query>
<query><![CDATA[select sum(MobilePhoneModel in (select MobilePhoneModel from hits_1000m where MobilePhoneModel != '')) from hits_1000m_single]]></query>
<query><![CDATA[select sum((MobilePhoneModel, UserID + 1) in (select MobilePhoneModel, UserID from hits_1000m where MobilePhoneModel != '')) from hits_1000m_single]]></query>
<query><![CDATA[select sum(URL in (select URL from hits_100m_single where URL != '')) from hits_100m_single]]></query>
<query><![CDATA[select sum(MobilePhoneModel in (select MobilePhoneModel from hits_1000m_single where MobilePhoneModel != '')) from hits_1000m_single]]></query>
<query><![CDATA[select sum((MobilePhoneModel, UserID + 1) in (select MobilePhoneModel, UserID from hits_1000m_single where MobilePhoneModel != '')) from hits_1000m_single]]></query>
<main_metric>
<min_time/>

View File

@ -76,7 +76,6 @@
<value>toISOWeek</value>
<value>toISOYear</value>
<value>toStartOfDay</value>
<value>toDate</value>
<value>toMonday</value>
<value>toStartOfMonth</value>

View File

@ -9,11 +9,11 @@
<stop_conditions>
<all_of>
<total_time_ms>10000</total_time_ms>
<total_time_ms>8000</total_time_ms>
</all_of>
<any_of>
<average_speed_not_changing_for_ms>5000</average_speed_not_changing_for_ms>
<total_time_ms>20000</total_time_ms>
<total_time_ms>15000</total_time_ms>
</any_of>
</stop_conditions>
@ -22,7 +22,7 @@
</main_metric>
<settings>
<max_memory_usage>20000000000</max_memory_usage>
<max_memory_usage>30000000000</max_memory_usage>
</settings>
<substitutions>

View File

@ -0,0 +1,5 @@
CREATE TEMPORARY TABLE t1 (x UInt8);
INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
CREATE TEMPORARY TABLE test.t2 (x UInt8); -- { serverError 442 }

View File

@ -0,0 +1 @@
SELECT arrayWithConstant(-231.37104, -138); -- { serverError 128 }

View File

@ -31,7 +31,7 @@ def test_single_page(input_path, lang):
logging.info('Link to nowhere: %s' % href)
if duplicate_anchor_points:
logging.error('Found %d duplicate anchor points' % duplicate_anchor_points)
logging.warning('Found %d duplicate anchor points' % duplicate_anchor_points)
if links_to_nowhere:
logging.error('Found %d links to nowhere' % links_to_nowhere)
sys.exit(10)