diff options
Diffstat (limited to 'sql/my_json_writer.h')
-rw-r--r-- | sql/my_json_writer.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sql/my_json_writer.h b/sql/my_json_writer.h index 0bd1e550439..4b69ba70675 100644 --- a/sql/my_json_writer.h +++ b/sql/my_json_writer.h @@ -18,6 +18,9 @@ #include "my_base.h" #if !defined(NDEBUG) || defined(JSON_WRITER_UNIT_TEST) +#include <set> +#include <stack> +#include <string> #include <vector> #endif @@ -30,6 +33,8 @@ #define VALIDITY_ASSERT(x) DBUG_ASSERT(x) #endif +#include <type_traits> + class Opt_trace_stmt; class Opt_trace_context; class Json_writer; @@ -440,17 +445,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) @@ -460,6 +470,7 @@ public: } return *this; } + Json_writer_object& add(const char *name, double value) { DBUG_ASSERT(!closed); @@ -470,18 +481,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); |