Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: support oceanbase oracle AT mode #6173

Open
wants to merge 32 commits into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
34cefe5
feature: support jdbc driver parser for OceanBase
hsien999 Jul 26, 2022
11c8ee8
feature: support sql parser for OceanBase
hsien999 Jul 26, 2022
52c865b
test: add unit test cases for sql parser of OceanBase(Oracle mode)
hsien999 Jul 27, 2022
d99e0c5
feature: support insert executor for sql parser of OceanBase(Oracle m…
hsien999 Jul 27, 2022
766eb09
test: add unit test cases for insert executor of OceanBase(Oracle mode)
hsien999 Jul 27, 2022
646ee80
feature: support table meta cache for OceanBase(Oracle mode)
hsien999 Jul 28, 2022
4a0ce3e
test: add and fix some tests in rm-datasource and sql-parser module
hsien999 Jul 28, 2022
e3153e3
feature: support undo log executors and keyword checker for OceanBase…
hsien999 Jul 29, 2022
a16627f
feature: add unit test cases for undo log executors and keyword check…
hsien999 Jul 29, 2022
58605e5
refactor: fix ColumnUtils, simplify to make codes more readable and r…
hsien999 Jul 29, 2022
e5c711a
Merge branch 'seata:develop' into feature_support_oceanbase
hsien999 Jul 29, 2022
8291c8c
refactor: fix check styles
hsien999 Jul 29, 2022
0f0fac1
refactor: fix check styles
hsien999 Jul 29, 2022
0bf268c
feature: support log and lock store for OceanBase(Oracle mode)
hsien999 Jul 29, 2022
e9e9d34
Merge branch 'develop' into feature_support_oceanbase
hsien999 Aug 11, 2022
c482078
Merge remote-tracking branch 'origin/develop' into feature_support_oc…
hsien999 Sep 1, 2022
dfa7272
refactor: resolve merge conflicts
hsien999 Sep 1, 2022
8b6d632
feature: support sql recognizer and executor for multi insert stateme…
hsien999 Sep 6, 2022
477597c
Merge remote-tracking branch 'origin/develop' into feature_support_oc…
hsien999 Sep 8, 2022
c13528b
refactor: resolve merge conflicts
hsien999 Sep 21, 2022
c91a981
Merge remote-tracking branch 'origin/develop' into feature_support_oc…
hsien999 Sep 21, 2022
4d08c42
refactor: eliminate some redundancy with oracle
hsien999 Oct 6, 2022
42aa35b
refactor: eliminate some redundancy with oracle
hsien999 Oct 8, 2022
342be33
Merge remote-tracking branch 'origin/develop' into feature_support_oc…
hsien999 Oct 8, 2022
795013d
Merge remote-tracking branch 'origin/develop' into feature_support_oc…
hsien999 Oct 13, 2022
8adab1c
refactor: resolve merge conflicts
hsien999 Oct 13, 2022
c581333
bugfix: fix db type parser bugs
hsien999 Oct 16, 2022
7bdf657
Merge remote-tracking branch 'hsien999_seata/feature_support_oceanbas…
jiayaoO3O Dec 18, 2023
13d0766
feature_support_oceanbase
jiayaoO3O Dec 20, 2023
3aa4418
optimize: add License
jiayaoO3O Dec 20, 2023
275c929
Merge branch '2.x' into feature_support_oceanbase
jiayaoO3O Dec 20, 2023
a9a3353
Merge branch '2.x' into feature_support_oceanbase
xingfudeshi Dec 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/java/io/seata/core/protocol/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Version {
/**
* The constant CURRENT.
*/
private static final String CURRENT = VersionInfo.VERSION;
private static final String CURRENT = "2.0.0-SNAPSHOT";
private static final String VERSION_0_7_1 = "0.7.1";
private static final String VERSION_1_5_0 = "1.5.0";
private static final int MAX_VERSION_DOT = 3;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 1999-2019 Seata.io Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.core.store.db.sql.lock;

import io.seata.common.loader.LoadLevel;

/**
* Database lock store sql for OceanBaseOracle
*
* @author hsien999
*/
@LoadLevel(name = "oceanbase_oracle")
public class OceanBaseOracleLockStoreSql extends OracleLockStoreSql {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 1999-2019 Seata.io Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.core.store.db.sql.log;

import io.seata.common.loader.LoadLevel;

/**
* Database log store sql for OceanBaseOracle
*
* @author hsien999
*/
@LoadLevel(name = "oceanbase_oracle")
public class OceanBaseOracleLogStoreSqls extends OracleLogStoreSqls {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ io.seata.core.store.db.sql.lock.H2LockStoreSql
io.seata.core.store.db.sql.lock.SqlServerLockStoreSql
io.seata.core.store.db.sql.lock.MariadbLockStoreSql
io.seata.core.store.db.sql.lock.PolarDBXLockStoreSql
io.seata.core.store.db.sql.lock.DmLockStoreSql
io.seata.core.store.db.sql.lock.DmLockStoreSql
io.seata.core.store.db.sql.lock.OceanBaseOracleLockStoreSql
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ io.seata.core.store.db.sql.log.H2LogStoreSqls
io.seata.core.store.db.sql.log.SqlServerLogStoreSqls
io.seata.core.store.db.sql.log.MariadbLogStoreSqls
io.seata.core.store.db.sql.log.PolarDBXLogStoreSqls
io.seata.core.store.db.sql.log.DmLogStoreSqls
io.seata.core.store.db.sql.log.DmLogStoreSqls
io.seata.core.store.db.sql.log.OceanBaseOracleLogStoreSqls
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void init(DataSource dataSource, String resourceGroupId) {
try (Connection connection = dataSource.getConnection()) {
jdbcUrl = connection.getMetaData().getURL();
dbType = JdbcUtils.getDbType(jdbcUrl);
if (JdbcConstants.ORACLE.equals(dbType)) {
if (JdbcConstants.ORACLE.equals(dbType) || JdbcConstants.OCEANBASE_ORACLE.equals(dbType)) {
userName = connection.getMetaData().getUserName();
} else if (JdbcConstants.MYSQL.equals(dbType)) {
validMySQLVersion(connection);
Expand Down Expand Up @@ -239,6 +239,8 @@ private void initResourceId() {
initSqlServerResourceId();
} else if (JdbcConstants.DM.equals(dbType)) {
initDMResourceId();
} else if (JdbcConstants.OCEANBASE_ORACLE.equals(dbType) && userName != null) {
initOceanBaseOracleResourceId();
} else {
initDefaultResourceId();
}
Expand Down Expand Up @@ -266,6 +268,25 @@ private void initOracleResourceId() {
}
}

private void initOceanBaseOracleResourceId() {
String startsWith = "jdbc:oceanbase:loadbalance://";
if (jdbcUrl.startsWith(startsWith)) {
String url;
if (jdbcUrl.contains("?")) {
url = jdbcUrl.substring(0, jdbcUrl.indexOf('?'));
} else {
url = jdbcUrl;
}
resourceId = url.replace(",", "|");
} else {
if (jdbcUrl.contains("?")) {
resourceId = jdbcUrl.substring(0, jdbcUrl.indexOf('?')) + "/" + userName;
} else {
resourceId = jdbcUrl + "/" + userName;
}
}
}

/**
* prevent mysql url like
* jdbc:mysql:loadbalance://192.168.100.2:3306,192.168.100.1:3306/seata
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 1999-2019 Seata.io Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.rm.datasource.exec.oceanbaseoracle;

import io.seata.common.loader.LoadLevel;
import io.seata.common.loader.Scope;
import io.seata.rm.datasource.StatementProxy;
import io.seata.rm.datasource.exec.StatementCallback;
import io.seata.rm.datasource.exec.oracle.OracleInsertExecutor;
import io.seata.sqlparser.SQLRecognizer;
import io.seata.sqlparser.util.JdbcConstants;

/**
* Insert executor for OceanBaseOracle
*
* @author hsien999
*/
@LoadLevel(name = JdbcConstants.OCEANBASE_ORACLE, scope = Scope.PROTOTYPE)
public class OceanBaseOracleInsertExecutor extends OracleInsertExecutor {

public OceanBaseOracleInsertExecutor(StatementProxy statementProxy, StatementCallback statementCallback,
SQLRecognizer sqlRecognizer) {
super(statementProxy, statementCallback, sqlRecognizer);
}
}
Loading
Loading