This commit is contained in:
Alexander Tretiakov 2019-05-26 01:51:21 +03:00
parent 212731b3e2
commit 461fb1eaa8
4 changed files with 7 additions and 6 deletions

View File

@ -1553,6 +1553,7 @@ private:
static std::pair<String, String> parseParameter(const String & s)
{
size_t pos = s.find('_') + 1;
/// String begins with "--param_", so check is no needed
/// Cut two first dash "--" and divide arg from name and value
return {s.substr(2, pos - 2), s.substr(pos)};
}

View File

@ -9,11 +9,11 @@ ${CLICKHOUSE_CURL} -sS $CLICKHOUSE_URL -d "CREATE TABLE ps (i UInt8, s String) E
${CLICKHOUSE_CURL} -sS $CLICKHOUSE_URL -d "INSERT INTO ps VALUES (1, 'Hello, world')";
${CLICKHOUSE_CURL} -sS $CLICKHOUSE_URL -d "INSERT INTO ps VALUES (2, 'test')";
${CLICKHOUSE_CURL} "${CLICKHOUSE_URL}?param_id=1"\
-d "SELECT * FROM ps WHERE i = {id:UInt8}";
${CLICKHOUSE_CURL} "${CLICKHOUSE_URL}?param_phrase=Hello,+world"\
-d "SELECT * FROM ps WHERE s = {phrase:String}";
${CLICKHOUSE_CURL} "${CLICKHOUSE_URL}?param_id=2&param_phrase=test"\
-d "SELECT * FROM ps WHERE i = {id:UInt8} and s = {phrase:String}";
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}?param_id=1"\
-d "SELECT * FROM ps WHERE i = {id:UInt8} ORDER BY i, s";
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}?param_phrase=Hello,+world"\
-d "SELECT * FROM ps WHERE s = {phrase:String} ORDER BY i, s";
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}?param_id=2&param_phrase=test"\
-d "SELECT * FROM ps WHERE i = {id:UInt8} and s = {phrase:String} ORDER BY i, s";
${CLICKHOUSE_CURL} -sS $CLICKHOUSE_URL -d "DROP TABLE ps";