| 205 | } |
| 206 | |
| 207 | void writeBlockData(const Block & block) |
| 208 | { |
| 209 | WriteBufferFromOwnString sqlbuf; |
| 210 | sqlbuf << (storage.replace_query ? "REPLACE" : "INSERT") << " INTO "; |
| 211 | if (!remote_database_name.empty()) |
| 212 | sqlbuf << backQuoteMySQL(remote_database_name) << "."; |
| 213 | sqlbuf << backQuoteMySQL(remote_table_name); |
| 214 | sqlbuf << " (" << dumpNamesWithBackQuote(block) << ") VALUES "; |
| 215 | |
| 216 | auto writer = FormatFactory::instance().getOutputFormat("Values", sqlbuf, metadata_snapshot->getSampleBlock(), storage.getContext()); |
| 217 | writer->write(block); |
| 218 | |
| 219 | if (!storage.on_duplicate_clause.empty()) |
| 220 | sqlbuf << " ON DUPLICATE KEY " << storage.on_duplicate_clause; |
| 221 | |
| 222 | sqlbuf << ";"; |
| 223 | |
| 224 | auto query = this->entry->query(sqlbuf.str()); |
| 225 | query.execute(); |
| 226 | } |
| 227 | |
| 228 | Blocks splitBlocks(const Block & block, const size_t & max_rows) const |
| 229 | { |
nothing calls this directly
no test coverage detected