MCPcopy Create free account
hub / github.com/ByConity/ByConity / parseQuery

Method parseQuery

programs/client/Client.cpp:1884–1918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1882
1883
1884 ASTPtr parseQuery(const char *& pos, const char * end, bool allow_multi_statements)
1885 {
1886 const auto & settings = context->getSettingsRef();
1887 ParserQuery parser(end, ParserSettings::valueOf(settings));
1888 ASTPtr res;
1889
1890 size_t max_length = 0;
1891 if (!allow_multi_statements)
1892 max_length = settings.max_query_size;
1893
1894 if (is_interactive || ignore_error)
1895 {
1896 String message;
1897 res = tryParseQuery(parser, pos, end, message, true, "", allow_multi_statements, max_length, settings.max_parser_depth);
1898
1899 if (!res)
1900 {
1901 std::cerr << std::endl << message << std::endl << std::endl;
1902 return nullptr;
1903 }
1904 }
1905 else
1906 res = parseQueryAndMovePosition(parser, pos, end, "", allow_multi_statements, max_length, settings.max_parser_depth);
1907
1908 if (is_interactive)
1909 {
1910 std::cout << std::endl;
1911 WriteBufferFromOStream res_buf(std::cout, 4096);
1912 formatAST(*res, res_buf);
1913 res_buf.next();
1914 std::cout << std::endl << std::endl;
1915 }
1916
1917 return res;
1918 }
1919
1920
1921 void sendData(Block & sample, const ColumnsDescription & columns_description)

Callers

nothing calls this directly

Calls 4

tryParseQueryFunction · 0.85
formatASTFunction · 0.85
nextMethod · 0.45

Tested by

no test coverage detected