MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetString

Method GetString

src/engine/server/databases/mysql.cpp:592–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590}
591
592void CMysqlConnection::GetString(int Col, char *pBuffer, int BufferSize)
593{
594 Col -= 1;
595
596 for(int i = 0; i < BufferSize; i++)
597 {
598 pBuffer[i] = '\0';
599 }
600
601 MYSQL_BIND Bind;
602 unsigned long Length;
603 my_bool IsNull;
604 my_bool Error;
605 mem_zero(&Bind, sizeof(Bind));
606 Bind.buffer_type = MYSQL_TYPE_STRING;
607 Bind.buffer = pBuffer;
608 // leave one character for null-termination
609 Bind.buffer_length = BufferSize - 1;
610 Bind.length = &Length;
611 Bind.is_null = &IsNull;
612 Bind.is_unsigned = false;
613 Bind.error = &Error;
614 if(mysql_stmt_fetch_column(m_pStmt.get(), &Bind, Col, 0))
615 {
616 StoreErrorStmt("fetch_column:string");
617 dbg_assert_failed("Error in GetString(%d): error fetching column %s", Col + 1, m_aErrorDetail);
618 }
619 dbg_assert(!IsNull, "Error in GetString(%d): NULL", Col + 1);
620 dbg_assert(!Error, "Error in GetString(%d): truncation occurred", Col + 1);
621}
622
623int CMysqlConnection::GetBlob(int Col, unsigned char *pBuffer, int BufferSize)
624{

Callers 15

OnPacketMethod · 0.45
ConBanExtMethod · 0.45
ConBanRegionMethod · 0.45
ConBanRegionRangeMethod · 0.45
ProcessClientPacketMethod · 0.45
ConKickMethod · 0.45
ConStatusMethod · 0.45
ConAuthAddMethod · 0.45
ConAuthAddHashedMethod · 0.45
ConAuthUpdateMethod · 0.45
ConAuthUpdateHashedMethod · 0.45
ConAuthRemoveMethod · 0.45

Calls 2

mem_zeroFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected