mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
Using lexer: better error messages [#CLICKHOUSE-2].
This commit is contained in:
parent
47d9083c08
commit
708b69abed
@ -76,6 +76,13 @@ void writeQueryWithHighlightedErrorPositions(
|
|||||||
const char * current_position_to_hilite = positions_to_hilite[position_to_hilite_idx];
|
const char * current_position_to_hilite = positions_to_hilite[position_to_hilite_idx];
|
||||||
out.write(pos, current_position_to_hilite - pos);
|
out.write(pos, current_position_to_hilite - pos);
|
||||||
|
|
||||||
|
if (current_position_to_hilite == end)
|
||||||
|
{
|
||||||
|
out << "\033[41;1m \033[0m";
|
||||||
|
pos = end;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
size_t bytes_to_hilite = UTF8::seqLength(*current_position_to_hilite);
|
size_t bytes_to_hilite = UTF8::seqLength(*current_position_to_hilite);
|
||||||
|
|
||||||
/// Bright on red background.
|
/// Bright on red background.
|
||||||
@ -84,6 +91,7 @@ void writeQueryWithHighlightedErrorPositions(
|
|||||||
out << "\033[0m";
|
out << "\033[0m";
|
||||||
pos = current_position_to_hilite + bytes_to_hilite;
|
pos = current_position_to_hilite + bytes_to_hilite;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.write(pos, end - pos);
|
out.write(pos, end - pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user