diff --git a/src/rootserver/ob_recovery_ls_service.cpp b/src/rootserver/ob_recovery_ls_service.cpp index 64aeea0b0d..cd756d5449 100644 --- a/src/rootserver/ob_recovery_ls_service.cpp +++ b/src/rootserver/ob_recovery_ls_service.cpp @@ -887,7 +887,11 @@ void ObRecoveryLSService::try_update_primary_ip_list() LOG_WARN("get servcie attr password failed", K(service_attr)); } else if (OB_FAIL(service_attr.get_user_str_(user_and_tenant))) { LOG_WARN("get user str failed", K(service_attr.user_.user_name_), K(service_attr.user_.tenant_name_)); - } else if (OB_FAIL(proxy.try_init(tenant_id_/*standby*/, service_attr.addr_, user_and_tenant.ptr(), passwd))) { + } else if (OB_FAIL(proxy.init(tenant_id_/*standby*/, + service_attr.addr_, + user_and_tenant.ptr(), + passwd, + service_attr.user_.mode_ == ObCompatibilityMode::MYSQL_MODE ? OB_SYS_DATABASE_NAME : OB_ORA_SYS_SCHEMA_NAME))) { LOG_WARN("proxy fail to connect to primary", K_(tenant_id), K(service_attr.addr_), K(user_and_tenant)); bool cur_primary_state = false; if (cur_primary_state != primary_is_avaliable_) { diff --git a/src/share/ob_log_restore_proxy.cpp b/src/share/ob_log_restore_proxy.cpp index ccfd36d815..5a0c98b373 100644 --- a/src/share/ob_log_restore_proxy.cpp +++ b/src/share/ob_log_restore_proxy.cpp @@ -304,7 +304,7 @@ int ObLogRestoreProxyUtil::try_init(const uint64_t tenant_id, } } } - if (OB_FAIL(ret) && (-ER_BAD_DB_ERROR == ret)) { + if (OB_FAIL(ret)) { LOG_WARN("proxy connect to primary oceanbase db failed, then try connect to sys db"); (void)destroy(); if (OB_SUCC(init(tenant_id, server_list, user_name, user_password, ORACLE_DB))) { diff --git a/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_basic_mysql.result b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_basic_mysql.result new file mode 100644 index 0000000000..9e05e12d03 --- /dev/null +++ b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_basic_mysql.result @@ -0,0 +1,134 @@ +# ---------------------------------------------------------------------- +# Test of GEOMETRY BASIC. +# ---------------------------------------------------------------------- +drop table if exists geo; +create table geo(id int primary key auto_increment, g geometry not null srid 4326, j json); +insert into geo(g, j) values(ST_GeomFromText('POINT(1 1)', 4326), '["hello"]'); +select id,st_astext(g),j from geo order by id; +id st_astext(g) j +1 POINT(1 1) ["hello"] +truncate table geo; +drop table geo; +# column(UINT32_MAX),insert(all valid srid is allowed) +create table geo(g geometry not null srid 432); +ERROR SR001: There's no spatial reference system with SRID 432. +create table geo(g geometry not null); +insert into geo values(ST_GeomFromText('POINT(1 1)', 0)); +insert into geo values(ST_GeomFromText('POINT(1 1)')); +insert into geo values(ST_GeomFromText('POINT(1 1)', 4326)); +insert into geo values(ST_GeomFromText('POINT(1 1)', 43)); +ERROR SR001: There's no spatial reference system with SRID 43. +drop table geo; +# column(4326),insert(4326 srid is allowed) +create table geo(g geometry not null srid 4326); +insert into geo values(ST_GeomFromText('POINT(1 1)', 0)); +ERROR HY000: The SRID of the geometry does not match the SRID of the column. The SRID of the geometry is 0, but the SRID of the column is 4326. Consider changing the SRID of the geometry or the SRID property of the column. +insert into geo values(ST_GeomFromText('POINT(1 1)')); +ERROR HY000: The SRID of the geometry does not match the SRID of the column. The SRID of the geometry is 0, but the SRID of the column is 4326. Consider changing the SRID of the geometry or the SRID property of the column. +insert into geo values(ST_GeomFromText('POINT(1 1)', 4326)); +insert into geo values(ST_GeomFromText('POINT(1 1)', 43)); +ERROR SR001: There's no spatial reference system with SRID 43. +drop table geo; +# column(0),insert(0 srid is allowed) +create table geo(g geometry not null srid 0); +insert into geo values(ST_GeomFromText('POINT(1 1)', 0)); +insert into geo values(ST_GeomFromText('POINT(1 1)')); +insert into geo values(ST_GeomFromText('POINT(1 1)', 4326)); +ERROR HY000: The SRID of the geometry does not match the SRID of the column. The SRID of the geometry is 4326, but the SRID of the column is 0. Consider changing the SRID of the geometry or the SRID property of the column. +insert into geo values(ST_GeomFromText('POINT(1 1)', 43)); +ERROR SR001: There's no spatial reference system with SRID 43. +drop table if exists gis_point; +create table if not exists gis_point ( +x decimal(19,16), +y decimal(19,16), +poi POINT not null srid 4326, +index `xy_index` (x, y) local, +index `poi_index` (poi) local +); +insert into gis_point values (1,1,ST_srid(point(1,1), 4326)), (2,2,ST_srid(point(2,2), 4326)); +insert into gis_point values (3,3,ST_srid(point(3,3), 4326)), (4,4,ST_srid(point(5,5), 4326)); +insert into gis_point values (6,6,ST_srid(point(6,6), 4326)), (7,7,ST_srid(point(7,7), 4326)); +insert into gis_point values (1,1,ST_srid(point(1,1), 4326)), (2,2,ST_srid(point(2,2), 4326)); +insert into gis_point values (3,3,ST_srid(point(3,3), 4326)), (4,4,ST_srid(point(5,5), 4326)); +insert into gis_point values (6,6,ST_srid(point(6,6), 4326)), (7,7,ST_srid(point(7,7), 4326)); +insert into gis_point values (1,1,ST_srid(point(1,1), 4326)), (2,2,ST_srid(point(2,2), 4326)); +insert into gis_point values (3,3,ST_srid(point(3,3), 4326)), (4,4,ST_srid(point(5,5), 4326)); +insert into gis_point values (6,6,ST_srid(point(6,6), 4326)), (7,7,ST_srid(point(7,7), 4326)); +insert into gis_point values (1,1,ST_srid(point(1,1), 4326)), (2,2,ST_srid(point(2,2), 4326)); +insert into gis_point values (3,3,ST_srid(point(3,3), 4326)), (4,4,ST_srid(point(5,5), 4326)); +insert into gis_point values (6,6,ST_srid(point(6,6), 4326)), (7,7,ST_srid(point(7,7), 4326)); +select x, y, st_astext(poi) from gis_point; +x y st_astext(poi) +1.0000000000000000 1.0000000000000000 POINT(1 1) +2.0000000000000000 2.0000000000000000 POINT(2 2) +3.0000000000000000 3.0000000000000000 POINT(3 3) +4.0000000000000000 4.0000000000000000 POINT(5 5) +6.0000000000000000 6.0000000000000000 POINT(6 6) +7.0000000000000000 7.0000000000000000 POINT(7 7) +1.0000000000000000 1.0000000000000000 POINT(1 1) +2.0000000000000000 2.0000000000000000 POINT(2 2) +3.0000000000000000 3.0000000000000000 POINT(3 3) +4.0000000000000000 4.0000000000000000 POINT(5 5) +6.0000000000000000 6.0000000000000000 POINT(6 6) +7.0000000000000000 7.0000000000000000 POINT(7 7) +1.0000000000000000 1.0000000000000000 POINT(1 1) +2.0000000000000000 2.0000000000000000 POINT(2 2) +3.0000000000000000 3.0000000000000000 POINT(3 3) +4.0000000000000000 4.0000000000000000 POINT(5 5) +6.0000000000000000 6.0000000000000000 POINT(6 6) +7.0000000000000000 7.0000000000000000 POINT(7 7) +1.0000000000000000 1.0000000000000000 POINT(1 1) +2.0000000000000000 2.0000000000000000 POINT(2 2) +3.0000000000000000 3.0000000000000000 POINT(3 3) +4.0000000000000000 4.0000000000000000 POINT(5 5) +6.0000000000000000 6.0000000000000000 POINT(6 6) +7.0000000000000000 7.0000000000000000 POINT(7 7) +drop table if exists gis_point; +create table if not exists gis_point ( +x decimal(19,16), +y decimal(19,16), +poi POINT not null srid 4326, +index `xy_index` (x, y) local, +index `poi_index` (poi) local +); +DROP PROCEDURE IF EXISTS geom_insert; +CREATE PROCEDURE geom_insert (IN n int) +BEGIN +DECLARE i INT DEFAULT 0; +declare x double; +declare y double; +WHILE i