You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/alipay/oceanbase/rpc/location/LocationUtil.java
+14-7Lines changed: 14 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -154,13 +154,19 @@ public class LocationUtil {
154
154
+ "FROM oceanbase.__all_virtual_proxy_schema A inner join oceanbase.__all_server B on A.svr_ip = B.svr_ip and A.sql_port = B.inner_port "
155
155
+ "WHERE tenant_name = ? and database_name=? and table_name = ? and tablet_id = 0";
156
156
157
-
privatestaticfinalStringPROXY_LOCATION_SQL_PARTITION_V4 = "SELECT /*+READ_CONSISTENCY(WEAK)*/ A.tablet_id as tablet_id, A.svr_ip as svr_ip, A.sql_port as sql_port, "
158
-
+ "A.table_id as table_id, A.role as role, A.replica_num as replica_num, A.part_num as part_num, B.svr_port as svr_port, B.status as status, B.stop_time as stop_time "
159
-
+ ", A.spare1 as replica_type, D.ls_id as ls_id "
160
-
+ "FROM oceanbase.__all_virtual_proxy_schema A inner join oceanbase.__all_server B on A.svr_ip = B.svr_ip and A.sql_port = B.inner_port "
161
-
+ "inner join oceanbase.DBA_OB_TENANTS C on C.tenant_name = A.tenant_name "
162
-
+ "left join oceanbase.CDB_OB_TABLET_TO_LS D on D.tenant_id = C.tenant_id and D.tablet_id = A.tablet_id "
163
-
+ "WHERE C.tenant_name = ? and database_name= ? and table_name = ? and A.tablet_id in ({0}) ";
157
+
privatestaticfinalStringPROXY_LOCATION_SQL_PARTITION_V4 = "SELECT /*+READ_CONSISTENCY(WEAK)*/ * FROM ( "
158
+
+ " SELECT A.tablet_id as tablet__id, A.svr_ip as svr_ip, A.sql_port as sql_port, A.table_id as table_id, "
159
+
+ " A.role as role, A.replica_num as replica_num, A.part_num as part_num, B.svr_port as svr_port, B.status as status, "
160
+
+ " B.stop_time as stop_time, A.spare1 as replica_type "
161
+
+ " FROM oceanbase.__all_virtual_proxy_schema A "
162
+
+ " INNER JOIN oceanbase.__all_server B ON A.svr_ip = B.svr_ip AND A.sql_port = B.inner_port "
163
+
+ " WHERE A.tablet_id IN ({0}) AND A.tenant_name = ? AND A.database_name = ? AND A.table_name = ?) AS left_table "
164
+
+ "LEFT JOIN ("
165
+
+ " SELECT D.ls_id, D.tablet_id "
166
+
+ " FROM oceanbase.__all_virtual_tablet_to_ls D "
167
+
+ " INNER JOIN oceanbase.DBA_OB_TENANTS C ON D.tenant_id = C.tenant_id "
168
+
+ " WHERE C.tenant_name = ? "
169
+
+ ") AS right_table ON left_table.tablet__id = right_table.tablet_id;";
0 commit comments