| 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) |
nothing calls this directly
no test coverage detected