Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
hnwyllmm committed Oct 8, 2024
2 parents e1c412a + d5c6536 commit fb38c31
Show file tree
Hide file tree
Showing 1,562 changed files with 955,081 additions and 532,105 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ src/sql/parser/sql_parser_oracle_gbk_mode_lex.c
src/sql/parser/sql_parser_oracle_gbk_mode_lex.h
src/sql/parser/sql_parser_oracle_gbk_mode_tab.c
src/sql/parser/sql_parser_oracle_gbk_mode_tab.h
src/sql/parser/sql_parser_oracle_hkscs_mode_lex.c
src/sql/parser/sql_parser_oracle_hkscs_mode_lex.h
src/sql/parser/sql_parser_oracle_hkscs_mode_tab.c
src/sql/parser/sql_parser_oracle_hkscs_mode_tab.h
src/sql/parser/non_reserved_keywords_oracle_hkscs_mode.c
src/sql/parser/sql_parser_oracle_utf8_mode_lex.c
src/sql/parser/sql_parser_oracle_utf8_mode_lex.h
src/sql/parser/sql_parser_oracle_utf8_mode_tab.c
Expand Down
4 changes: 3 additions & 1 deletion cmake/Env.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ if(OB_BUILD_CPP_ODPS)
endif()

# should not use initial-exec for tls-model if building OBCDC.
if(NOT OB_BUILD_CDC)
if(OB_BUILD_CDC)
add_definitions(-DOB_BUILD_CDC_DISABLE_VSAG)
else()
add_definitions(-DENABLE_INITIAL_EXEC_TLS_MODEL)
endif()

Expand Down
2 changes: 1 addition & 1 deletion deps/init/oceanbase.el7.aarch64.deps
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ devdeps-protobuf-c-1.4.1-100000072023102410.el7.aarch64.rpm
devdeps-roaringbitmap-croaring-3.0.0-42024042816.el7.aarch64.rpm
devdeps-apache-arrow-9.0.0-302024052920.el7.aarch64.rpm
devdeps-apache-orc-1.8.3-392024091317.el7.aarch64.rpm
devdeps-vsag-1.0.0-102024082710.el7.aarch64.rpm
devdeps-vsag-1.0.0-212024092509.el7.aarch64.rpm

[tools]
obdevtools-binutils-2.30-12022100413.el7.aarch64.rpm
Expand Down
2 changes: 1 addition & 1 deletion deps/init/oceanbase.el7.x86_64.deps
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ devdeps-roaringbitmap-croaring-3.0.0-42024042816.el7.x86_64.rpm
devdeps-apache-arrow-9.0.0-222024052223.el7.x86_64.rpm
devdeps-hyperscan-5.4.2-242024090219.el7.x86_64.rpm
devdeps-apache-orc-1.8.3-392024091317.el7.x86_64.rpm
devdeps-vsag-1.0.0-102024082710.el7.x86_64.rpm
devdeps-vsag-1.0.0-212024092509.el7.x86_64.rpm

[tools]
obdevtools-binutils-2.30-12022100413.el7.x86_64.rpm
Expand Down
2 changes: 1 addition & 1 deletion deps/init/oceanbase.el8.aarch64.deps
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ devdeps-protobuf-c-1.4.1-100000072023102410.el8.aarch64.rpm
devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.aarch64.rpm
devdeps-apache-arrow-9.0.0-322024052923.el8.aarch64.rpm
devdeps-apache-orc-1.8.3-392024091317.el8.aarch64.rpm
devdeps-vsag-1.0.0-102024082710.el8.aarch64.rpm
devdeps-vsag-1.0.0-212024092509.el8.aarch64.rpm

[tools]
obdevtools-binutils-2.30-12022100413.el8.aarch64.rpm
Expand Down
2 changes: 1 addition & 1 deletion deps/init/oceanbase.el8.x86_64.deps
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.x86_64.rpm
devdeps-apache-arrow-9.0.0-172024052218.el8.x86_64.rpm
devdeps-hyperscan-5.4.2-242024090219.el8.x86_64.rpm
devdeps-apache-orc-1.8.3-392024091317.el8.x86_64.rpm
devdeps-vsag-1.0.0-102024082710.el8.x86_64.rpm
devdeps-vsag-1.0.0-212024092509.el8.x86_64.rpm
devdeps-cloud-qpl-1.1.0-272023061419.el8.x86_64.rpm

[tools]
Expand Down
2 changes: 1 addition & 1 deletion deps/init/oceanbase.el9.aarch64.deps
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ devdeps-protobuf-c-1.4.1-100000072023102410.el8.aarch64.rpm
devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.aarch64.rpm
devdeps-apache-arrow-9.0.0-322024052923.el8.aarch64.rpm
devdeps-apache-orc-1.8.3-392024091317.el8.aarch64.rpm
devdeps-vsag-1.0.0-102024082710.el8.aarch64.rpm
devdeps-vsag-1.0.0-212024092509.el8.aarch64.rpm

[deps-el9]
devdeps-apr-1.6.5-232023090616.el9.aarch64.rpm target=el9
Expand Down
2 changes: 1 addition & 1 deletion deps/init/oceanbase.el9.x86_64.deps
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ devdeps-apache-arrow-9.0.0-172024052218.el8.x86_64.rpm
devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.x86_64.rpm
devdeps-hyperscan-5.4.2-242024090219.el8.x86_64.rpm
devdeps-apache-orc-1.8.3-392024091317.el8.x86_64.rpm
devdeps-vsag-1.0.0-102024082710.el8.x86_64.rpm
devdeps-vsag-1.0.0-212024092509.el8.x86_64.rpm

[deps-el9]
devdeps-apr-1.6.5-232023090616.el9.x86_64.rpm target=el9
Expand Down
17 changes: 16 additions & 1 deletion deps/oblib/src/common/ob_common_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ struct ObQueryFlag
#define OBSF_BIT_IS_SELECT_FOLLOWER 1
#define OBSF_BIT_ENABLE_LOB_PREFETCH 1
#define OBSF_BIT_IS_BARE_ROW_SCAN 1
#define OBSF_BIT_RESERVED 24
#define OBSF_BIT_MR_MV_SCAN 2
#define OBSF_BIT_RESERVED 22

static const uint64_t OBSF_MASK_SCAN_ORDER = (0x1UL << OBSF_BIT_SCAN_ORDER) - 1;
static const uint64_t OBSF_MASK_DAILY_MERGE = (0x1UL << OBSF_BIT_DAILY_MERGE) - 1;
Expand Down Expand Up @@ -87,6 +88,7 @@ struct ObQueryFlag
static const uint64_t OBSF_MASK_IS_MDS_QUERY = (0x1UL << OBSF_BIT_IS_MDS_QUERY) - 1;
static const uint64_t OBSF_MASK_IS_SELECT_FOLLOWER = (0x1UL << OBSF_BIT_IS_SELECT_FOLLOWER) - 1;
static const uint64_t OBSF_MASK_ENABLE_LOB_PREFETCH = (0x1UL << OBSF_BIT_ENABLE_LOB_PREFETCH) - 1;
static const uint64_t OBSF_MASK_IS_DIRECT_SCAN = (0x1UL << OBSF_BIT_IS_BARE_ROW_SCAN) - 1;


enum ScanOrder
Expand Down Expand Up @@ -116,6 +118,12 @@ struct ObQueryFlag
ReservedMode = 2,
};

enum MRMVScanMode
{
NormalMode = 0,
RefreshMode = 1,
RealTimeMode = 2,
};
union
{
uint64_t flag_;
Expand Down Expand Up @@ -155,6 +163,7 @@ struct ObQueryFlag
uint64_t is_mds_query_ : OBSF_BIT_IS_MDS_QUERY;
uint64_t enable_lob_prefetch_ : OBSF_BIT_ENABLE_LOB_PREFETCH;
uint64_t is_bare_row_scan_ : OBSF_BIT_IS_BARE_ROW_SCAN; // 1: to scan mult version row directly without compact.
uint64_t mr_mv_scan_ : OBSF_BIT_MR_MV_SCAN; // 0: normal table scan. 1. major refresh mview base table scan in refresh 2. major refresh rt-mview base table scan
uint64_t reserved_ : OBSF_BIT_RESERVED;
};
};
Expand Down Expand Up @@ -242,6 +251,7 @@ struct ObQueryFlag
inline bool is_for_foreign_key_check() const { return for_foreign_key_check_; }
inline bool is_sstable_cut() const { return is_sstable_cut_; }
inline bool is_skip_read_lob() const { return skip_read_lob_; }
inline bool is_bare_row_scan() const {return is_bare_row_scan_; }
inline bool is_mds_query() const { return is_mds_query_; }
inline void set_is_select_follower() { is_select_follower_ = true; }
inline bool is_select_follower() const { return is_select_follower_; }
Expand All @@ -254,6 +264,9 @@ struct ObQueryFlag
set_not_use_block_cache();
set_not_use_bloomfilter_cache();
}
inline bool is_mr_mview_refresh_base_scan() const { return RefreshMode == mr_mv_scan_; }
inline bool is_mr_rt_mview_base_scan() const { return RealTimeMode == mr_mv_scan_; }
inline bool is_mr_mview_query() const { return is_mr_mview_refresh_base_scan() || is_mr_rt_mview_base_scan(); }

TO_STRING_KV("scan_order", scan_order_,
"daily_merge", daily_merge_,
Expand All @@ -279,12 +292,14 @@ struct ObQueryFlag
"is_sstable_cut", is_sstable_cut_,
"skip_read_lob", skip_read_lob_,
"is_lookup_for_4377", is_lookup_for_4377_,
"is_bare_row_scan", is_bare_row_scan_,
"enable_rich_format", enable_rich_format_,
"is_for_foreign_key_check", for_foreign_key_check_,
"is_mds_query", is_mds_query_,
"is_select_follower", is_select_follower_,
"enable_lob_prefetch", enable_lob_prefetch_,
"is_bare_row_scan", is_bare_row_scan_,
"mr_mv_scan", mr_mv_scan_,
"reserved", reserved_);
OB_UNIS_VERSION(1);
};
Expand Down
2 changes: 1 addition & 1 deletion deps/oblib/src/common/object/ob_obj_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ inline int obj_print_plain_str<ObHexStringType>(const ObObj &obj, char *buffer,
PRINT_META(); \
BUF_PRINTO(ob_obj_type_str(obj.get_type())); \
J_COLON(); \
if (obj.is_binary() || src_type == CHARSET_UTF16) { \
if (obj.is_binary() || src_type == CHARSET_UTF16 || src_type == CHARSET_UTF16LE) { \
hex_print(obj.get_string_ptr(), obj.get_string_len(), buf, buf_len, pos); \
} else { \
BUF_PRINTO(obj.get_varchar()); \
Expand Down
83 changes: 83 additions & 0 deletions deps/oblib/src/common/object/ob_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,13 @@ DEF_TO_STRING(ObLobLocatorV2)
J_KV(K(*retry_info));
J_COMMA();
}
if (buf_len > pos && extern_header->flags_.has_read_snapshot_
&& size_ >= offset + sizeof(ObMemLobReadSnapshot)) {
ObMemLobReadSnapshot *read_snapshot = reinterpret_cast<ObMemLobReadSnapshot *>(ptr_ + offset);
offset += sizeof(ObMemLobReadSnapshot) + read_snapshot->size_;
J_KV(K(*read_snapshot));
J_COMMA();
}
if (buf_len > pos) {
ObString rowkey_str(MIN(extern_header->rowkey_size_, buf_len - pos), ptr_ + offset);
offset += extern_header->rowkey_size_;
Expand Down Expand Up @@ -349,6 +356,7 @@ DEF_TO_STRING(ObLobLocatorV2)
uint32_t ObLobLocatorV2::calc_locator_full_len(const ObMemLobExternFlags &flags,
uint32_t rowkey_size,
uint32_t disk_lob_full_size,
uint32_t read_snapshot_size,
bool is_simple)
{
uint32_t loc_len = MEM_LOB_COMMON_HEADER_LEN;
Expand All @@ -364,6 +372,9 @@ uint32_t ObLobLocatorV2::calc_locator_full_len(const ObMemLobExternFlags &flags,
if (flags.has_retry_info_) {
loc_len += MEM_LOB_EXTERN_RETRYINFO_LEN;
}
if (flags.has_read_snapshot_) {
loc_len += sizeof(ObMemLobReadSnapshot) + read_snapshot_size;
}
loc_len += MEM_LOB_ADDR_LEN; //ToDo:@gehao server address.
loc_len += rowkey_size;
}
Expand All @@ -387,6 +398,7 @@ int ObLobLocatorV2::fill(ObMemLobType type,
const ObLobCommon *disk_loc,
uint32_t disk_lob_full_size,
uint32_t disk_lob_header_size,
uint32_t read_snapshot_size,
bool is_simple)
{
validate_has_lob_header(has_lob_header_);
Expand Down Expand Up @@ -449,6 +461,13 @@ int ObLobLocatorV2::fill(ObMemLobType type,
*extern_len += MEM_LOB_EXTERN_RETRYINFO_LEN;
}

if (flags.has_read_snapshot_) {
ObMemLobReadSnapshot *read_snapshot = reinterpret_cast<ObMemLobReadSnapshot *>(ptr_ + offset);
read_snapshot->size_ = read_snapshot_size;
offset += sizeof(ObMemLobReadSnapshot) + read_snapshot_size;
*extern_len += sizeof(ObMemLobReadSnapshot) + read_snapshot_size;
}

if ((offset + rowkey_str.length()) && OB_UNLIKELY(offset > size_)) {
ret = OB_BUF_NOT_ENOUGH;
COMMON_LOG(WARN, "Lob: invalid buffer size for rowkey",
Expand Down Expand Up @@ -793,6 +812,35 @@ int ObLobLocatorV2::get_retry_info(ObMemLobRetryInfo *&retry_info) const
return ret;
}

int ObLobLocatorV2::get_read_snapshot_data(ObString &read_snapshot_data) const
{
int ret = OB_SUCCESS;
ObMemLobExternHeader *extern_header = NULL;
if (OB_SUCC(get_extern_header(extern_header))) {
char *cur_pos = extern_header->data_ + MEM_LOB_EXTERN_SIZE_LEN;
if (extern_header->flags_.has_tx_info_) {
cur_pos += MEM_LOB_EXTERN_TXINFO_LEN;
}
if (extern_header->flags_.has_location_info_) {
cur_pos += MEM_LOB_EXTERN_LOCATIONINFO_LEN;
}
if (extern_header->flags_.has_retry_info_) {
cur_pos += MEM_LOB_EXTERN_RETRYINFO_LEN;
}

if (extern_header->flags_.has_read_snapshot_) {
ObMemLobReadSnapshot *read_snapshot = reinterpret_cast<ObMemLobReadSnapshot *>(cur_pos);
if (read_snapshot->size_ > 0) {
read_snapshot_data.assign_ptr(read_snapshot->data_, read_snapshot->size_);
}
} else {
ret = OB_ERR_NULL_VALUE;
COMMON_LOG(WARN, "Lob: does not have tx read snapshot", K(this), K(ret));
}
}
return ret;
}

int ObLobLocatorV2::get_real_locator_len(int64_t &real_len) const
{
int ret = OB_SUCCESS;
Expand Down Expand Up @@ -967,6 +1015,34 @@ int ObLobLocatorV2::set_retry_info(const ObMemLobRetryInfo &retry_info)
return ret;
}

int ObLobLocatorV2::set_read_snapshot_data(const ObString &read_snapshot_data)
{
validate_has_lob_header(has_lob_header_);
int ret = OB_SUCCESS;
ObMemLobExternHeader *extern_header = NULL;
if (OB_SUCC(get_extern_header(extern_header))) {
char *cur_pos = extern_header->data_ + MEM_LOB_EXTERN_SIZE_LEN;
if (extern_header->flags_.has_tx_info_) {
cur_pos += MEM_LOB_EXTERN_TXINFO_LEN;
}
if (extern_header->flags_.has_location_info_) {
cur_pos += MEM_LOB_EXTERN_LOCATIONINFO_LEN;
}
if (extern_header->flags_.has_retry_info_) {
cur_pos += MEM_LOB_EXTERN_RETRYINFO_LEN;
}

if (extern_header->flags_.has_read_snapshot_) {
ObMemLobReadSnapshot *read_snapshot = reinterpret_cast<ObMemLobReadSnapshot *>(cur_pos);
read_snapshot->size_ = read_snapshot_data.length();
if (read_snapshot_data.length() > 0) {
MEMCPY(read_snapshot->data_, read_snapshot_data.ptr(), read_snapshot_data.length());
}
}
}
return ret;
}

OB_DEF_SERIALIZE(ObLobLocatorV2)
{
int ret = OB_SUCCESS;
Expand Down Expand Up @@ -1086,6 +1162,13 @@ bool ObDocId::is_valid() const
return ObTabletID(tablet_id_).is_valid() && seq_id_ > 0;
}

int ObDocId::hash(uint64_t &hash_val) const
{
hash_val = murmurhash(&tablet_id_, sizeof(seq_id_), OB_DOC_ID_HASH);
hash_val = murmurhash(&seq_id_, sizeof(seq_id_), hash_val);
return common::OB_SUCCESS;
}

ObString ObDocId::get_string() const
{
return ObString(OB_DOC_ID_COLUMN_BYTE_LENGTH, reinterpret_cast<const char *>(this));
Expand Down
Loading

0 comments on commit fb38c31

Please sign in to comment.