Skip to content

Commit 70e3bb0

Browse files
author
Catalin Besleaga
committed
WL#15045 Expand the json client library for HeatWave[relocate,noclose]
Moved the files used to make the json_client_library to the sql-common folder. Extended json_dom-t.cc with an extra benchmark test. Change-Id: I7ff681918d479883699b60267b1037f2d0139f10
1 parent 5de6452 commit 70e3bb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+181
-129
lines changed

Doxyfile-ignored

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2015, 2021, Oracle and/or its affiliates.
1+
# Copyright (c) 2015, 2022, Oracle and/or its affiliates.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0,
@@ -137,6 +137,7 @@ plugin/group_replication/src/applier.cc:[0-9]+: warning:
137137
plugin/version_token/version_token.cc:[0-9]+: warning:
138138
sql-common/client.cc:[0-9]+: warning:
139139
sql-common/compression.cc:[0-9]+: warning:
140+
sql-common/json_dom.h:[0-9]+: warning:
140141
sql-common/net_serv.cc:[0-9]+: warning:
141142
sql/auth/partitioned_rwlock.h:[0-9]+: warning:
142143
sql/auth/sha2_password.cc:[0-9]+: warning:
@@ -151,7 +152,6 @@ sql/handler.h:[0-9]+: warning:
151152
sql/item.h:[0-9]+: warning:
152153
sql/item_func.h:[0-9]+: warning:
153154
sql/join_optimizer/explain_access_path.h:[0-9]+: warning:
154-
sql/json_dom.h:[0-9]+: warning:
155155
sql/key.cc:[0-9]+: warning:
156156
sql/log.cc:[0-9]+: warning:
157157
sql/log_event.h:[0-9]+: warning:

client/CMakeLists.txt

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,7 @@ OPTION(WITH_JSON_BINLOG_LIBRARY
9999
IF(WITH_JSON_BINLOG_LIBRARY)
100100
UNSET(INSTALL_JSON_BINLOG_LIBRARY)
101101
INSTALL(FILES
102-
../sql/json_binary.h
103-
DESTINATION ${INSTALL_INCLUDEDIR}/sql
104-
COMPONENT Development
105-
)
106-
INSTALL(FILES
102+
../sql-common/json_binary.h
107103
../sql-common/json_error_handler.h
108104
DESTINATION ${INSTALL_INCLUDEDIR}/sql-common
109105
COMPONENT Development
@@ -131,10 +127,10 @@ ENDIF()
131127
# Always build it, but do not *use* it for mysqlbinlog unless
132128
# WITH_JSON_BINLOG_LIBRARY=ON
133129
ADD_SHARED_LIBRARY(json_binlog
134-
${CMAKE_SOURCE_DIR}/sql/json_binary.cc
135-
${CMAKE_SOURCE_DIR}/sql/json_dom.cc
136-
${CMAKE_SOURCE_DIR}/sql/json_path.cc
137-
${CMAKE_SOURCE_DIR}/sql/json_syntax_check.cc
130+
${CMAKE_SOURCE_DIR}/sql-common/json_binary.cc
131+
${CMAKE_SOURCE_DIR}/sql-common/json_dom.cc
132+
${CMAKE_SOURCE_DIR}/sql-common/json_path.cc
133+
${CMAKE_SOURCE_DIR}/sql-common/json_syntax_check.cc
138134
${CMAKE_SOURCE_DIR}/sql-common/sql_string.cc
139135

140136
COMPILE_DEFINITIONS DISABLE_PSI_MUTEX EXPORT_JSON_FUNCTIONS
@@ -147,10 +143,10 @@ ADD_SHARED_LIBRARY(json_binlog
147143
)
148144

149145
ADD_CONVENIENCE_LIBRARY(json_client_library
150-
${CMAKE_SOURCE_DIR}/sql/json_binary.cc
151-
${CMAKE_SOURCE_DIR}/sql/json_dom.cc
152-
${CMAKE_SOURCE_DIR}/sql/json_path.cc
153-
${CMAKE_SOURCE_DIR}/sql/json_syntax_check.cc
146+
${CMAKE_SOURCE_DIR}/sql-common/json_binary.cc
147+
${CMAKE_SOURCE_DIR}/sql-common/json_dom.cc
148+
${CMAKE_SOURCE_DIR}/sql-common/json_path.cc
149+
${CMAKE_SOURCE_DIR}/sql-common/json_syntax_check.cc
154150
${CMAKE_SOURCE_DIR}/sql-common/sql_string.cc
155151

156152
COMPILE_DEFINITIONS DISABLE_PSI_MUTEX

client/json_binlog_main.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#include <string>
3131

32-
#include "sql/json_binary.h"
32+
#include "sql-common/json_binary.h"
3333

3434
int main() {
3535
json_binary::Value value = json_binary::parse_binary(nullptr, 0);

client/json_client_library_main.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include <iostream>
2929
#include <string>
3030

31-
#include "sql/json_dom.h"
32-
#include "sql/json_path.h"
31+
#include "sql-common/json_dom.h"
32+
#include "sql-common/json_path.h"
3333

3434
#include "sql_string.h"
3535

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,27 @@
2020
along with this program; if not, write to the Free Software
2121
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
2222

23-
#include "sql/json_binary.h"
23+
#include "sql-common/json_binary.h"
2424

2525
#include <string.h>
26+
2627
#include <algorithm> // std::min
2728
#include <cassert>
2829
#include <map>
2930
#include <memory>
3031
#include <string>
3132
#include <utility>
32-
3333
#include "m_ctype.h"
34+
3435
#include "my_byteorder.h"
3536
#include "my_sys.h"
3637
#include "mysqld_error.h"
3738
#ifdef MYSQL_SERVER
3839
#include "sql/check_stack.h"
3940
#endif
40-
#include "sql/field.h" // Field_json
41-
#include "sql/json_dom.h" // Json_dom
42-
#include "sql/json_syntax_check.h"
41+
#include "sql-common/json_dom.h" // Json_dom
42+
#include "sql-common/json_syntax_check.h"
43+
#include "sql/field.h" // Field_json
4344
#include "sql/sql_class.h" // THD
4445
#include "sql/sql_const.h"
4546
#include "sql/system_variables.h"

sql/json_dom.cc renamed to sql-common/json_dom.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
along with this program; if not, write to the Free Software
2121
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
2222

23-
#include "sql/json_dom.h"
23+
#include "sql-common/json_dom.h"
2424

2525
#include <errno.h>
2626
#include <float.h>
@@ -43,29 +43,29 @@
4343

4444
#include "base64.h"
4545
#include "decimal.h"
46-
#include "json_binary.h"
4746
#include "m_ctype.h"
4847
#include "m_string.h" // my_gcvt, _dig_vec_lower
49-
#include "malloc_allocator.h"
5048
#include "my_byteorder.h"
5149
#include "my_compare.h"
5250
#include "my_dbug.h"
53-
#include "my_decimal.h"
5451
#include "my_double2ulonglong.h"
5552
#include "my_sys.h"
5653
#include "my_time.h"
5754
#include "mysql/components/services/bits/psi_bits.h"
5855
#include "mysql/service_mysql_alloc.h"
5956
#include "mysql_com.h"
6057
#include "mysqld_error.h" // ER_*
58+
#include "sql/malloc_allocator.h"
59+
#include "sql/my_decimal.h"
6160
#ifdef MYSQL_SERVER
6261
#include "sql/check_stack.h"
6362
#endif
63+
#include "sql-common/json_binary.h"
64+
#include "sql-common/json_path.h"
65+
#include "sql-common/json_syntax_check.h"
6466
#include "sql/current_thd.h" // current_thd
6567
#include "sql/derror.h" // ER_THD
6668
#include "sql/field.h"
67-
#include "sql/json_path.h"
68-
#include "sql/json_syntax_check.h"
6969
#include "sql/psi_memory_key.h" // key_memory_JSON
7070
#include "sql/sql_class.h" // THD
7171
#include "sql/sql_const.h" // STACK_MIN_SIZE

sql/json_dom.h renamed to sql-common/json_dom.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@
3737

3838
#include "field_types.h" // enum_field_types
3939
#include "my_compiler.h"
40+
4041
#include "my_inttypes.h"
4142
#include "my_time.h" // my_time_flags_t
4243
#include "mysql/mysql_lex_string.h"
43-
#include "mysql_time.h" // MYSQL_TIME
44-
#include "prealloced_array.h" // Prealloced_array
45-
#include "sql/json_binary.h" // json_binary::Value
46-
#include "sql/malloc_allocator.h" // Malloc_allocator
47-
#include "sql/my_decimal.h" // my_decimal
44+
#include "mysql_time.h" // MYSQL_TIME
45+
#include "prealloced_array.h" // Prealloced_array
46+
#include "sql-common/json_binary.h" // json_binary::Value
47+
#include "sql/malloc_allocator.h" // Malloc_allocator
48+
#include "sql/my_decimal.h" // my_decimal
4849

4950
class Field_json;
5051
class Json_array;
@@ -65,7 +66,7 @@ using Json_array_ptr = std::unique_ptr<Json_array>;
6566
using Json_object_ptr = std::unique_ptr<Json_object>;
6667

6768
/**
68-
@file sql/json_dom.h
69+
@file
6970
JSON DOM.
7071
7172
When a JSON value is retrieved from a column, a prior it exists in
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
attached to WL#7909.
2929
*/
3030

31-
#include "sql/json_path.h"
31+
#include "sql-common/json_path.h"
3232

3333
#include "my_rapidjson_size_t.h" // IWYU pragma: keep
3434

@@ -44,7 +44,7 @@
4444
#include "m_string.h"
4545

4646
#include "my_inttypes.h"
47-
#include "sql/json_dom.h"
47+
#include "sql-common/json_dom.h"
4848
#include "sql/psi_memory_key.h" // key_memory_JSON
4949
#include "sql/sql_const.h" // STRING_BUFFER_USUAL_SIZE
5050
#include "sql_string.h" // String
File renamed without changes.

0 commit comments

Comments
 (0)