MySQL 9.1.0
Source Code Documentation
print_utils.cc File Reference
#include "sql/join_optimizer/print_utils.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include "sql/item_cmpfunc.h"
#include "sql/join_optimizer/relational_expression.h"
#include "sql/mem_root_array.h"

Namespaces

namespace  anonymous_namespace{print_utils.cc}
 

Functions

std::string StringPrintf (const char *fmt,...)
 Like sprintf, but returns an std::string. More...
 
std::string GenerateExpressionLabel (const RelationalExpression *expr)
 
std::string anonymous_namespace{print_utils.cc}::DecimalFormat (double d, int log_precision)
 Format 'd' as a decimal number with enough decimals to get a rounding error less than d*10^log_precision, without any trailing fractional zeros. More...
 
std::string anonymous_namespace{print_utils.cc}::EngineeringFormat (double d)
 Format 'd' in engineering format, i.e. More...
 
constexpr uint64_t anonymous_namespace{print_utils.cc}::Power (uint64_t base, int power)
 Integer exponentiation. More...
 
std::string FormatNumberReadably (double d)
 
std::string FormatNumberReadably (uint64_t l)
 

Variables

constexpr int anonymous_namespace{print_utils.cc}::kPlainNumberLength = 6
 The maximal number of digits we use in decimal numbers (e.g. More...
 
constexpr int anonymous_namespace{print_utils.cc}::kMantissaLength = 3
 The maximal number of digits in engineering format mantissas, e.g. More...
 
constexpr double anonymous_namespace{print_utils.cc}::kMinNonZeroNumber = 1.0e-12
 The smallest number (absolute value) that we do not format as "0". More...
 
constexpr int anonymous_namespace{print_utils.cc}::kLogPrecision = -2
 For decimal numbers, include enough decimals to ensure that any rounding error is less than <number>*10^kLogPrecision (i.e. More...
 
const double anonymous_namespace{print_utils.cc}::kMinPlainFormatNumber
 The smallest number (absolute value) that we format as decimal (rather than engineering format). More...
 

Function Documentation

◆ FormatNumberReadably() [1/2]

std::string FormatNumberReadably ( double  d)

◆ FormatNumberReadably() [2/2]

std::string FormatNumberReadably ( uint64_t  l)

◆ GenerateExpressionLabel()

std::string GenerateExpressionLabel ( const RelationalExpression expr)

◆ StringPrintf()

std::string StringPrintf ( const char *  fmt,
  ... 
)

Like sprintf, but returns an std::string.

This is not the most efficient of formatting functions, but it is only intended for debugging/tracing use.