| 126 | |
| 127 | |
| 128 | void writeQueryAroundTheError( |
| 129 | WriteBuffer & out, |
| 130 | const char * begin, |
| 131 | const char * end, |
| 132 | bool hilite, |
| 133 | const Token * positions_to_hilite, |
| 134 | size_t num_positions_to_hilite) |
| 135 | { |
| 136 | if (hilite) |
| 137 | { |
| 138 | out << ":\n\n"; |
| 139 | writeQueryWithHighlightedErrorPositions(out, begin, end, positions_to_hilite, num_positions_to_hilite); |
| 140 | out << "\n\n"; |
| 141 | } |
| 142 | else |
| 143 | { |
| 144 | if (num_positions_to_hilite) |
| 145 | out << ": " << std::string(positions_to_hilite[0].begin, std::min(SHOW_CHARS_ON_SYNTAX_ERROR, end - positions_to_hilite[0].begin)) << ". "; |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | |
| 150 | void writeCommonErrorMessage( |
no test coverage detected