Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit a4fb22f

Browse files
committed
init miniob-2025
1 parent aef9e24 commit a4fb22f

65 files changed

Lines changed: 570 additions & 615 deletions

Some content is hidden

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

deps/3rd/benchmark

Submodule benchmark updated 116 files

deps/3rd/googletest

Submodule googletest updated 123 files

src/common/sys/rc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ See the Mulan PSL v2 for more details. */
9797
DEFINE_RC(READ_ONLY_VIEW_DELETE_ERROR) \
9898
DEFINE_RC(READ_ONLY_VIEW_UPDATE_ERROR) \
9999
DEFINE_RC(EXPRESSION_FIELD_NOT_INSERTABLE) \
100-
DEFINE_RC(EXPRESSION_FIELD_NOT_UPDATEABLE)
100+
DEFINE_RC(EXPRESSION_FIELD_NOT_UPDATEABLE) \
101+
DEFINE_RC(JSON_MEMBER_MISSING) \
102+
DEFINE_RC(JSON_PARSE_FAILED)
101103

102104
enum class RC
103105
{

src/observer/common/init.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ int init_global_objects(ProcessParam *process_param, Ini &properties)
137137

138138
int ret = 0;
139139

140-
RC rc =
141-
GCTX.handler_->init("miniob", process_param->trx_kit_name().c_str(), process_param->durability_mode().c_str());
140+
RC rc = GCTX.handler_->init("miniob",
141+
process_param->trx_kit_name().c_str(),
142+
process_param->durability_mode().c_str(),
143+
process_param->storage_engine().c_str());
142144
if (OB_FAIL(rc)) {
143145
LOG_ERROR("failed to init handler. rc=%s", strrc(rc));
144146
return -1;

src/observer/common/type/boolean_type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See the Mulan PSL v2 for more details. */
1010

1111
#pragma once
1212

13-
#include "common/rc.h"
13+
#include "common/sys/rc.h"
1414
#include "common/type/data_type.h"
1515

1616
//

src/observer/common/type/integer_type.cpp

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,7 @@ int IntegerType::compare(const Column &left, const Column &right, int left_idx,
3434
{
3535
ASSERT(left.attr_type() == AttrType::INTS, "left type is not integer");
3636
ASSERT(right.attr_type() == AttrType::INTS, "right type is not integer");
37-
return common::compare_int((void *)&((int*)left.data())[left_idx],
38-
(void *)&((int*)right.data())[right_idx]);
39-
}
40-
41-
RC IntegerType::cast_to(const Value &val, AttrType type, Value &result) const
42-
{
43-
switch (type) {
44-
case AttrType::FLOATS: {
45-
float float_value = val.get_int();
46-
result.set_float(float_value);
47-
return RC::SUCCESS;
48-
}
49-
default:
50-
LOG_WARN("unsupported type %d", type);
51-
return RC::SCHEMA_FIELD_TYPE_MISMATCH;
52-
}
37+
return common::compare_int((void *)&((int *)left.data())[left_idx], (void *)&((int *)right.data())[right_idx]);
5338
}
5439

5540
RC IntegerType::add(const Value &left, const Value &right, Value &result) const
@@ -98,17 +83,6 @@ RC IntegerType::to_string(const Value &val, string &result) const
9883
return RC::SUCCESS;
9984
}
10085

101-
int IntegerType::cast_cost(AttrType type)
102-
{
103-
if (type == AttrType::INTS)
104-
return 0; // INT -> INT
105-
if (type == AttrType::FLOATS)
106-
return 1; // INT -> FLOAT
107-
if (type == AttrType::BOOLEANS)
108-
return 1; // INT -> BOOL (非严格转换)
109-
return INT32_MAX; // 不支持转换
110-
}
111-
11286
RC IntegerType::cast_to(const Value &val, AttrType type, Value &result, bool allow_type_promotion) const
11387
{
11488
switch (type) {

src/observer/common/type/integer_type.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class IntegerType : public DataType
3232
RC multiply(const Value &left, const Value &right, Value &result) const override;
3333
RC negative(const Value &val, Value &result) const override;
3434

35-
RC cast_to(const Value &val, AttrType type, Value &result) const override;
35+
RC cast_to(const Value &val, AttrType type, Value &result, bool allow_type_promotion = true) const override;
3636

3737
int cast_cost(const AttrType type) override
3838
{
@@ -47,7 +47,4 @@ class IntegerType : public DataType
4747
RC set_value_from_str(Value &val, const string &data) const override;
4848

4949
RC to_string(const Value &val, string &result) const override;
50-
51-
int cast_cost(AttrType type) override;
52-
RC cast_to(const Value &val, AttrType type, Value &result, bool allow_type_promotion = true) const override;
5350
};

src/observer/common/type/text_type.h

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

1313
#pragma once
1414

15-
#include "common/rc.h"
15+
#include "common/sys/rc.h"
1616
#include "common/type/data_type.h"
1717

1818
/**

0 commit comments

Comments
 (0)