mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Json_writer_object add integers
This commit is contained in:
committed by
Sergei Krivonos
parent
691f7e165a
commit
cba065f4fe
@ -19,6 +19,9 @@
|
||||
#include "my_base.h"
|
||||
|
||||
#if !defined(NDEBUG) || defined(JSON_WRITER_UNIT_TEST) || defined ENABLED_JSON_WRITER_CONSISTENCY_CHECKS
|
||||
#include <set>
|
||||
#include <stack>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
@ -31,6 +34,8 @@
|
||||
#define VALIDITY_ASSERT(x) DBUG_ASSERT(x)
|
||||
#endif
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
class Opt_trace_stmt;
|
||||
class Opt_trace_context;
|
||||
class Json_writer;
|
||||
@ -462,17 +467,22 @@ public:
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Json_writer_object& add(const char *name, ulonglong value)
|
||||
{
|
||||
DBUG_ASSERT(!closed);
|
||||
if (my_writer)
|
||||
{
|
||||
add_member(name);
|
||||
context.add_ll(static_cast<longlong>(value));
|
||||
my_writer->add_ull(value);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
Json_writer_object& add(const char *name, longlong value)
|
||||
|
||||
template<class IntT,
|
||||
typename= typename ::std::enable_if<std::is_integral<IntT>::value>::type
|
||||
>
|
||||
Json_writer_object& add(const char *name, IntT value)
|
||||
{
|
||||
DBUG_ASSERT(!closed);
|
||||
if (my_writer)
|
||||
@ -482,6 +492,7 @@ public:
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Json_writer_object& add(const char *name, double value)
|
||||
{
|
||||
DBUG_ASSERT(!closed);
|
||||
@ -492,18 +503,7 @@ public:
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
#ifndef _WIN64
|
||||
Json_writer_object& add(const char *name, size_t value)
|
||||
{
|
||||
DBUG_ASSERT(!closed);
|
||||
if (my_writer)
|
||||
{
|
||||
add_member(name);
|
||||
context.add_ll(static_cast<longlong>(value));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
Json_writer_object& add(const char *name, const char *value)
|
||||
{
|
||||
DBUG_ASSERT(!closed);
|
||||
|
@ -6939,7 +6939,7 @@ static bool ror_intersect_add(ROR_INTERSECT_INFO *info,
|
||||
DBUG_PRINT("info", ("info->total_cost= %g", info->total_cost));
|
||||
}
|
||||
else
|
||||
trace_costs->add("disk_sweep_cost", static_cast<longlong>(0));
|
||||
trace_costs->add("disk_sweep_cost", 0);
|
||||
|
||||
DBUG_PRINT("info", ("New out_rows: %g", info->out_rows));
|
||||
DBUG_PRINT("info", ("New cost: %g, %scovering", info->total_cost,
|
||||
|
@ -404,7 +404,7 @@ static void trace_table_dependencies(THD *thd,
|
||||
{
|
||||
if (map & (1ULL << j))
|
||||
{
|
||||
trace_one_table.add("map_bit", static_cast<longlong>(j));
|
||||
trace_one_table.add("map_bit", j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user