MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / OffsetStatementToString

Function OffsetStatementToString

src/Client/BuzzHouse/AST/SQLProtoStr.cpp:2745–2766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2743}
2744
2745static void OffsetStatementToString(String & ret, const bool has_limit, const OffsetStatement & off)
2746{
2747 ret += (has_limit && off.comma()) ? "," : "OFFSET";
2748 ret += " ";
2749 ExprToString(ret, off.row_count());
2750 if ((!has_limit || !off.comma()) && (off.has_rows() || off.has_fetch()))
2751 {
2752 ret += " ";
2753 ret += off.has_rows() ? RowsKeyword_Name(off.rows()).substr(4) : "ROWS";
2754 }
2755 if (off.has_fetch())
2756 {
2757 ret += " ";
2758 FetchStatementToString(ret, off.fetch());
2759 ret += " ";
2760 ret += off.with_ties() ? "WITH TIES" : "ONLY";
2761 }
2762 else if (has_limit && off.comma() && off.with_ties())
2763 {
2764 ret += " WITH TIES";
2765 }
2766}
2767
2768CONV_FN(SelectStatementCore, ssc)
2769{

Callers 1

CONV_FNFunction · 0.85

Calls 3

commaMethod · 0.45
rowsMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected