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

Method comFieldList

src/Server/MySQLHandler.cpp:464–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464void MySQLHandler::comFieldList(ReadBuffer & payload)
465{
466 ComFieldList packet;
467 packet.readPayloadWithUnpacked(payload);
468 String database = connection_context->getCurrentDatabase();
469 StoragePtr table_ptr = DatabaseCatalog::instance().getTable({database, packet.table}, connection_context);
470 auto metadata_snapshot = table_ptr->getInMemoryMetadataPtr();
471 for (const NameAndTypePair & column : metadata_snapshot->getColumns().getAll())
472 {
473 ColumnDefinition column_definition(
474 database, packet.table, packet.table, column.name, column.name, CharacterSet::binary, 100, ColumnType::MYSQL_TYPE_STRING, 0, 0, true
475 );
476 packet_endpoint->sendPacket(column_definition);
477 }
478 packet_endpoint->sendPacket(OKPacket(0xfe, client_capabilities, 0, 0, 0), true);
479}
480
481void MySQLHandler::comPing()
482{

Callers

nothing calls this directly

Calls 8

OKPacketClass · 0.85
getCurrentDatabaseMethod · 0.80
sendPacketMethod · 0.80
getTableMethod · 0.45
getAllMethod · 0.45
getColumnsMethod · 0.45

Tested by

no test coverage detected