| 8 | { |
| 9 | |
| 10 | bool parseDatabaseAndTableName(IParser::Pos & pos, Expected & expected, String & database_str, String & table_str, bool rewrite_db) |
| 11 | { |
| 12 | ParserToken s_dot(TokenType::Dot); |
| 13 | ParserIdentifier table_parser; |
| 14 | |
| 15 | ASTPtr database; |
| 16 | ASTPtr table; |
| 17 | |
| 18 | database_str = ""; |
| 19 | table_str = ""; |
| 20 | |
| 21 | if (!table_parser.parse(pos, database, expected)) |
| 22 | return false; |
| 23 | |
| 24 | if (s_dot.ignore(pos)) |
| 25 | { |
| 26 | if (!table_parser.parse(pos, table, expected)) |
| 27 | { |
| 28 | database_str = ""; |
| 29 | return false; |
| 30 | } |
| 31 | if (rewrite_db) |
| 32 | tryRewriteCnchDatabaseName(database, pos.getContext()); |
| 33 | |
| 34 | tryGetIdentifierNameInto(database, database_str); |
| 35 | tryGetIdentifierNameInto(table, table_str); |
| 36 | } |
| 37 | else |
| 38 | { |
| 39 | database_str = ""; |
| 40 | tryGetIdentifierNameInto(database, table_str); |
| 41 | } |
| 42 | |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | |
| 47 | bool parseDatabaseAndTableNameOrAsterisks(IParser::Pos & pos, Expected & expected, String & database, bool & any_database, String & table, bool & any_table) |
no test coverage detected