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


namespace  anonymous_namespace{}


std::string StringPrintf (const char *fmt,...)
 Like sprintf, but returns an std::string. More...
std::string GenerateExpressionLabel (const RelationalExpression *expr)
int anonymous_namespace{}::IntegerDigits (double d)
 Find the number of integer digits (i.e. More...
std::string anonymous_namespace{}::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{}::EngineeringFormat (double d)
 Format 'd' in engineering format, i.e. More...
constexpr uint64_t anonymous_namespace{}::Power (uint64_t base, int power)
 Integer exponentiation. More...
std::string FormatNumberReadably (double d)
std::string FormatNumberReadably (uint64_t l)


constexpr int anonymous_namespace{}::kPlainNumberLength = 6
 The maximal number of digits we use in decimal numbers (e.g. More...
constexpr int anonymous_namespace{}::kMantissaLength = 3
 The maximal number of digits in engineering format mantissas, e.g. More...
constexpr double anonymous_namespace{}::kMinNonZeroNumber = 1.0e-12
 The smallest number (absolute value) that we do not format as "0". More...
constexpr int anonymous_namespace{}::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{}::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.