change compat_mode default from MYSQL to INVALID

This commit is contained in:
obdev 2023-12-08 07:47:33 +00:00 committed by ob-robot
parent 6a2fd09d6b
commit e52308603f
10 changed files with 10 additions and 2 deletions

View File

@ -248,7 +248,7 @@ class ObRuntimeContext
OB_UNIS_VERSION(1);
public:
ObRuntimeContext()
: compat_mode_(Worker::CompatMode::MYSQL)
: compat_mode_(Worker::CompatMode::INVALID)
{}
Worker::CompatMode compat_mode_;
#ifdef ERRSIM

View File

@ -17,7 +17,7 @@
TEST(TestWorker, CompatMode)
{
using oceanbase::lib::Worker;
set_compat_mode(oceanbase::lib::Worker::CompatMode::MYSQL);
// MySQL Mode as default.
EXPECT_EQ(oceanbase::lib::Worker::CompatMode::MYSQL, THIS_WORKER.get_compatibility_mode());
EXPECT_TRUE(oceanbase::lib::is_mysql_mode());

View File

@ -345,6 +345,7 @@ TEST_F(TestLSMigrationParam, test_deleted_tablet_info)
char buf[buf_len] = {};
share::ObLSID ls_id(1);
ObTabletID tablet_id(200001);
set_compat_mode(Worker::CompatMode::MYSQL);
ObMigrationTabletParam param;
ret = param.build_deleted_tablet_info(ls_id, tablet_id);
ASSERT_EQ(OB_SUCCESS, ret);

View File

@ -886,6 +886,7 @@ TEST_F(TestJsonBase, test_get_allocator)
TEST_F(TestJsonBase, test_seek)
{
set_compat_mode(lib::Worker::CompatMode::MYSQL);
ObArenaAllocator allocator(ObModIds::TEST);
ObIJsonBase *j_tree = NULL;
ObIJsonBase *j_bin = NULL;

View File

@ -361,6 +361,7 @@ TEST_F(TestJsonBin, test_bin_lookup)
TEST_F(TestJsonBin, test_wrapper_to_string_object)
{
set_compat_mode(lib::Worker::CompatMode::MYSQL);
// json text 转 json tree
common::ObString json_text("{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"json_text\" : \"test!\" }");
common::ObArenaAllocator allocator(ObModIds::TEST);

View File

@ -685,6 +685,7 @@ TEST_F(TestJsonPath, test_member_node)
TEST_F(TestJsonPath, test_ellipsis_node)
{
int ret = OB_SUCCESS;
set_compat_mode(oceanbase::lib::Worker::CompatMode::MYSQL);
ObArenaAllocator allocator(ObModIds::TEST);
ObJsonPath test_path("$**[10]", &allocator);
ret = test_path.parse_path();

View File

@ -2234,6 +2234,7 @@ TEST_F(TestJsonTree, oracle_sub_type)
TEST_F(TestJsonTree, test_sort)
{
set_compat_mode(lib::Worker::CompatMode::MYSQL);
// correct json text
common::ObString json_text("{ \"a\" : \"value1\", \"a\" : \"value2\", \
\"b\" : \"value3\", \"b\" : \"value4\" }");

View File

@ -96,6 +96,7 @@ void TestRawExprCanonicalizer::canon(const char* expr, const char *&canon_expr)
TEST_F(TestRawExprCanonicalizer, basic_test)
{
set_compat_mode(Worker::CompatMode::MYSQL);
std::ifstream if_tests("./expr/test_raw_expr_canonicalizer.test");
ASSERT_TRUE(if_tests.is_open());
std::string line;

View File

@ -95,6 +95,7 @@ void TestRawExprResolver::resolve(const char* expr, const char *&json_expr)
TEST_F(TestRawExprResolver, all)
{
set_compat_mode(Worker::CompatMode::MYSQL);
static const char* test_file = "./expr/test_raw_expr_resolver.test";
static const char* tmp_file = "./expr/test_raw_expr_resolver.tmp";
static const char* result_file = "./expr/test_raw_expr_resolver.result";

View File

@ -704,6 +704,7 @@ void ObQueryRangeTest::get_query_range_collation(const char *sql_expr, const cha
TEST_F(ObQueryRangeTest, collation_test)
{
set_compat_mode(lib::Worker::CompatMode::MYSQL);
static const char* test_file = "./test_query_range_collation.test";
static const char* tmp_file = "./test_query_range_collation.tmp";
static const char* result_file = "./test_query_range_collation.result";