diff --git a/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h b/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h index 101e03574f870fd9e802d8162a49279406a3dc40..2f9eca1aa1a87c13ce2f15db8b7e7ba3db2851c1 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h +++ b/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h @@ -348,6 +348,7 @@ template int ObLruConnectionAllocator::free_session_conn_array(uint32_t sessid, int64_t &fail_recycled_conn_count, int64_t &succ_recycled_conn_count) { int ret = OB_SUCCESS; + _OB_LOG(DEBUG, "free session conn array sessid=%u, ret=%d", sessid, ret); ObSpinLockGuard guard(ObIConnectionAllocator::lock_); ObArray *conn_array = NULL; fail_recycled_conn_count = 0; @@ -358,7 +359,7 @@ int ObLruConnectionAllocator::free_session_conn_array(uint32_t sessid, int64_ T *conn = NULL; int64_t array_size = conn_array->size(); int64_t succ_count = 0; - _OB_LOG(DEBUG, "try to free conn_array, sessid=%u, count=%ld", sessid, array_size); + _OB_LOG(DEBUG, "try to free conn_array, conn_array=%p, count=%ld", conn_array, array_size); while (OB_SUCC(ret) && OB_SUCCESS == conn_array->pop_back(conn)) { conn->close(); //close immedately if (OB_FAIL(free_conn_array_.push_back(conn))) { @@ -369,10 +370,12 @@ int ObLruConnectionAllocator::free_session_conn_array(uint32_t sessid, int64_ ++succ_count; } } + _OB_LOG(DEBUG, "free session conn array succ_count=%ld, ret=%d", succ_count, ret); succ_recycled_conn_count = succ_count; if (OB_FAIL(ret)) { fail_recycled_conn_count = array_size - succ_count; while (OB_SUCCESS == conn_array->pop_back(conn)) { + conn->close(); //close immedately ObLruConnectionAllocator::free(conn); } if (OB_SUCCESS != sessionid_to_conns_map_.erase_refactored(sessid)) { diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h b/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h index 9237f5d6a5a07a5fb2ce7b6d37115e49694b503a..7c6d7635c9bcc0e978f79e753424b6897e9281e0 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h @@ -77,6 +77,7 @@ public: is_init_remote_env_(false), dblink_id_(OB_INVALID_ID), dblink_driver_proto_(-1), + sessid_(-1), has_reverse_link_credentials_(false), usable_(true) {} @@ -117,6 +118,8 @@ public: virtual ObCommonServerConnectionPool *get_common_server_pool() = 0; void set_dblink_id(uint64_t dblink_id) { dblink_id_ = dblink_id; } uint64_t get_dblink_id() { return dblink_id_; } + void set_sessid(uint32_t sessid) { sessid_ = sessid; } + uint32_t get_sessid() { return sessid_; } void set_dblink_driver_proto(int64_t dblink_driver_proto) { dblink_driver_proto_ = dblink_driver_proto; } int64_t get_dblink_driver_proto() { return dblink_driver_proto_; } @@ -136,11 +139,13 @@ public: bool get_reverse_link_creadentials() { return has_reverse_link_credentials_; } void set_usable(bool flag) { usable_ = flag; } bool usable() { return usable_; } + virtual int ping() { return OB_SUCCESS; } protected: bool oracle_mode_; bool is_init_remote_env_; // for dblink, we have to init remote env with some sql uint64_t dblink_id_; // for dblink, record dblink_id of a connection used by dblink int64_t dblink_driver_proto_; //for dblink, record DblinkDriverProto of a connection used by dblink + uint32_t sessid_; bool has_reverse_link_credentials_; // for dblink, mark if this link has credentials set bool usable_; // usable_ = false: connection is unusable, should not execute query again. }; diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp index e09cd0e011e394ead05b6afe1eaaa2bf7eb1b4d6..94491f72d0a465769190c0732dd7218a625ce3d8 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp @@ -159,7 +159,7 @@ int ObMySQLConnection::connect(const char *user, const char *pass, const char *d MYSQL *mysql = mysql_real_connect(&mysql_, host, user, pass, db, port, NULL, 0); if (OB_ISNULL(mysql)) { ret = -mysql_errno(&mysql_); - LOG_WARN("fail to connect to mysql server", KCSTRING(host), KCSTRING(user), K(port), + LOG_WARN("fail to connect to mysql server", K(get_sessid()), KCSTRING(host), KCSTRING(user), K(port), "info", mysql_error(&mysql_), K(ret)); } else { /*Note: mysql_real_connect() incorrectly reset the MYSQL_OPT_RECONNECT option @@ -229,7 +229,7 @@ int ObMySQLConnection::connect(const char *user, const char *pass, const char *d MYSQL *mysql = mysql_real_connect(&mysql_, host, user, pass, db, port, NULL, 0); if (OB_ISNULL(mysql)) { ret = -mysql_errno(&mysql_); - LOG_WARN("fail to connect to mysql server", KCSTRING(host), KCSTRING(user), K(port), + LOG_WARN("fail to connect to mysql server", K(get_sessid()), KCSTRING(host), KCSTRING(user), K(port), "info", mysql_error(&mysql_), K(ret)); } else { /*Note: mysql_real_connect() incorrectly reset the MYSQL_OPT_RECONNECT option @@ -256,6 +256,7 @@ void ObMySQLConnection::close() if (!closed_) { mysql_close(&mysql_); closed_ = true; + sessid_ = 0; memset(&mysql_, 0, sizeof(MYSQL)); set_init_remote_env(false); } diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h index 36275da015904bb1df6ff8f7b302702b02ec9e56..9b7d859ab4da810304d3a615127de11f5bb35347 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h @@ -92,7 +92,7 @@ public: virtual int set_session_variable(const ObString &name, int64_t val) override; int set_session_variable(const ObString &name, const ObString &val); - int ping(); + virtual int ping() override; int set_trace_id(); void set_timeout(const int64_t timeout); virtual int set_timeout_variable(const int64_t query_timeout, const int64_t trx_timeout); diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp index b4d9bdc94c9f08a276284f0cd889fab2750edaf3..2b9443ab15099e62751da9e4942217897c7f3a1e 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp @@ -880,6 +880,10 @@ int ObMySQLConnectionPool::try_connect_dblink(ObISQLConnection *dblink_conn, int DEFAULT_TRANSACTION_TIMEOUT_US))) { LOG_WARN("fail to set mysql timeout variablse", K(ret)); } + } else if (OB_SUCCESS != dblink_conn1->ping()) { + ret = OB_ERR_UNEXPECTED; + dblink_conn1->close(); + LOG_WARN("connection status is invalid", K(sql_request_level), KP(dblink_conn1), K(ret)); } return ret; } diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.cpp index df2ce786ca1c52bbbf1a73e133b7ffa0bd228bb2..f9cdca787d48590b4a66c21b92c525a2f44c43a2 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.cpp @@ -103,7 +103,7 @@ int ObMySQLStatement::execute_update(int64_t &affected_rows) if (is_need_disconnect_error(ret)) { conn_->set_usable(false); } - LOG_WARN("fail to query server","server", stmt_->host, "port", stmt_->port, + LOG_WARN("fail to query server", "sessid", conn_->get_sessid(), "server", stmt_->host, "port", stmt_->port, "err_msg", mysql_error(stmt_), K(tmp_ret), K(ret), K(sql_str_)); if (OB_NOT_MASTER == tmp_ret) { // conn -> server pool -> connection pool @@ -140,10 +140,10 @@ ObMySQLResult *ObMySQLStatement::execute_query() } const int ER_LOCK_WAIT_TIMEOUT = -1205; if (ER_LOCK_WAIT_TIMEOUT == ret) { - LOG_INFO("fail to query server", "host", stmt_->host, "port", stmt_->port, + LOG_INFO("fail to query server", "sessid", conn_->get_sessid(), "host", stmt_->host, "port", stmt_->port, "err_msg", mysql_error(stmt_), K(ret), K(sql_str_)); } else { - LOG_WARN("fail to query server", "host", stmt_->host, "port", stmt_->port, + LOG_WARN("fail to query server", "host", stmt_->host, "port", stmt_->port, K(conn_->get_sessid()), "err_msg", mysql_error(stmt_), K(ret), K(STRLEN(sql_str_)), K(sql_str_)); } if (OB_SUCCESS == ret) { diff --git a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp index f0bce153dc23955a7d2e8e8e2c025bbdd2d757f4..f5ec0874856b7bbce242f050a0a30b520a8edfd5 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp @@ -85,6 +85,7 @@ int ObServerConnectionPool::acquire(ObMySQLConnection *&conn, uint32_t sessid) } if (OB_SUCC(ret)) { conn = connection; + conn->set_sessid(sessid); if (conn->connection_version() != connection_version_) { conn->set_connection_version(connection_version_); conn->close(); diff --git a/src/share/ob_errno.cpp b/src/share/ob_errno.cpp index 2c05640e9c8e6c7c0f5c3ce7c2e2fba583474ffe..7b0645f27f237156bce9fc110b9b6e7de7629866 100644 --- a/src/share/ob_errno.cpp +++ b/src/share/ob_errno.cpp @@ -7833,6 +7833,18 @@ static const _error _error_OB_ERR_ZLIB_DATA = { .oracle_str_error = "ORA-00600: internal error code, arguments: -5124, ZLIB: Input data corrupted", .oracle_str_user_error = "ORA-00600: internal error code, arguments: -5124, ZLIB: Input data corrupted" }; +static const _error _error_OB_ERR_DBLINK_SESSION_KILLED = { + .error_name = "OB_ERR_DBLINK_SESSION_KILLED", + .error_cause = "Internal Error", + .error_solution = "Contact OceanBase Support", + .mysql_errno = -1, + .sqlstate = "HY000", + .str_error = "your session has been killed", + .str_user_error = "your session has been killed", + .oracle_errno = 28, + .oracle_str_error = "ORA-00028: your session has been killed", + .oracle_str_user_error = "ORA-00028: your session has been killed" +}; static const _error _error_OB_SQL_RESOLVER_NO_MEMORY = { .error_name = "OB_SQL_RESOLVER_NO_MEMORY", .error_cause = "Internal Error", @@ -25015,6 +25027,7 @@ struct ObStrErrorInit _errors[-OB_SQL_OPT_ERROR] = &_error_OB_SQL_OPT_ERROR; _errors[-OB_ERR_OCI_INIT_TIMEZONE] = &_error_OB_ERR_OCI_INIT_TIMEZONE; _errors[-OB_ERR_ZLIB_DATA] = &_error_OB_ERR_ZLIB_DATA; + _errors[-OB_ERR_DBLINK_SESSION_KILLED] = &_error_OB_ERR_DBLINK_SESSION_KILLED; _errors[-OB_SQL_RESOLVER_NO_MEMORY] = &_error_OB_SQL_RESOLVER_NO_MEMORY; _errors[-OB_SQL_DML_ONLY] = &_error_OB_SQL_DML_ONLY; _errors[-OB_ERR_NO_GRANT] = &_error_OB_ERR_NO_GRANT; @@ -26406,7 +26419,7 @@ namespace oceanbase { namespace common { -int g_all_ob_errnos[2027] = {0, -4000, -4001, -4002, -4003, -4004, -4005, -4006, -4007, -4008, -4009, -4010, -4011, -4012, -4013, -4014, -4015, -4016, -4017, -4018, -4019, -4020, -4021, -4022, -4023, -4024, -4025, -4026, -4027, -4028, -4029, -4030, -4031, -4032, -4033, -4034, -4035, -4036, -4037, -4038, -4039, -4041, -4042, -4043, -4044, -4045, -4046, -4047, -4048, -4049, -4050, -4051, -4052, -4053, -4054, -4055, -4057, -4058, -4060, -4061, -4062, -4063, -4064, -4065, -4066, -4067, -4068, -4070, -4071, -4072, -4073, -4074, -4075, -4076, -4077, -4078, -4080, -4081, -4084, -4085, -4090, -4097, -4098, -4099, -4100, -4101, -4102, -4103, -4104, -4105, -4106, -4107, -4108, -4109, -4110, -4111, -4112, -4113, -4114, -4115, -4116, -4117, -4118, -4119, -4120, -4121, -4122, -4123, -4124, -4125, -4126, -4127, -4128, -4133, -4138, -4139, -4142, -4143, -4144, -4146, -4147, -4149, -4150, -4151, -4152, -4153, -4154, -4155, -4156, -4157, -4158, -4159, -4160, -4161, -4162, -4163, -4164, -4165, -4166, -4167, -4168, -4169, -4170, -4171, -4172, -4173, -4174, -4175, -4176, -4177, -4178, -4179, -4180, -4181, -4182, -4183, -4184, -4185, -4186, -4187, -4188, -4189, -4190, -4191, -4192, -4200, -4201, -4204, -4205, -4206, -4207, -4208, -4209, -4210, -4211, -4212, -4213, -4214, -4215, -4216, -4217, -4218, -4219, -4220, -4221, -4222, -4223, -4224, -4225, -4226, -4227, -4228, -4229, -4230, -4231, -4232, -4233, -4234, -4235, -4236, -4237, -4238, -4239, -4240, -4241, -4242, -4243, -4244, -4245, -4246, -4247, -4248, -4249, -4250, -4251, -4252, -4253, -4254, -4255, -4256, -4257, -4258, -4260, -4261, -4262, -4263, -4264, -4265, -4266, -4267, -4268, -4269, -4270, -4271, -4273, -4274, -4275, -4276, -4277, -4278, -4279, -4280, -4281, -4282, -4283, -4284, -4285, -4286, -4287, -4288, -4289, -4290, -4291, -4292, -4293, -4294, -4295, -4296, -4297, -4298, -4299, -4300, -4301, -4302, -4303, -4304, -4305, -4306, -4307, -4308, -4309, -4310, -4311, -4312, -4313, -4314, -4315, -4316, -4317, -4318, -4319, -4320, -4321, -4322, -4323, -4324, -4325, -4326, -4327, -4328, -4329, -4330, -4331, -4332, -4333, -4334, -4335, -4336, -4337, -4338, -4339, -4340, -4341, -4342, -4343, -4344, -4345, -4346, -4347, -4348, -4349, -4350, -4351, -4352, -4353, -4354, -4355, -4356, -4357, -4358, -4359, -4360, -4361, -4362, -4363, -4364, -4365, -4366, -4367, -4368, -4369, -4370, -4371, -4372, -4373, -4374, -4375, -4376, -4377, -4378, -4379, -4380, -4381, -4382, -4383, -4385, -4386, -4387, -4388, -4389, -4390, -4391, -4392, -4393, -4394, -4395, -4396, -4505, -4507, -4510, -4512, -4515, -4517, -4518, -4519, -4523, -4524, -4525, -4526, -4527, -4528, -4529, -4530, -4531, -4532, -4533, -4537, -4538, -4539, -4540, -4541, -4542, -4543, -4544, -4545, -4546, -4547, -4548, -4549, -4550, -4551, -4552, -4553, -4554, -4600, -4601, -4602, -4603, -4604, -4605, -4606, -4607, -4608, -4609, -4610, -4611, -4613, -4614, -4615, -4620, -4621, -4622, -4623, -4624, -4625, -4626, -4628, -4629, -4630, -4631, -4632, -4633, -4634, -4636, -4637, -4638, -4639, -4640, -4641, -4642, -4643, -4644, -4645, -4646, -4647, -4648, -4649, -4650, -4651, -4652, -4653, -4654, -4655, -4656, -4657, -4658, -4659, -4660, -4661, -4662, -4663, -4664, -4665, -4666, -4667, -4668, -4669, -4670, -4671, -4672, -4673, -4674, -4675, -4676, -4677, -4678, -4679, -4680, -4681, -4682, -4683, -4684, -4685, -4686, -4687, -4688, -4689, -4690, -4691, -4692, -4693, -4694, -4695, -4696, -4697, -4698, -4699, -4700, -4701, -4702, -4703, -4704, -4705, -4706, -4707, -4708, -4709, -4710, -4711, -4712, -4713, -4714, -4715, -4716, -4717, -4718, -4719, -4720, -4721, -4722, -4723, -4724, -4725, -4726, -4727, -4728, -4729, -4730, -4731, -4732, -4733, -4734, -4735, -4736, -4737, -4738, -4739, -4740, -4741, -4742, -4743, -4744, -4745, -4746, -4747, -4748, -4751, -4752, -4753, -4754, -4755, -4756, -5000, -5001, -5002, -5003, -5006, -5007, -5008, -5010, -5011, -5012, -5014, -5015, -5016, -5017, -5018, -5019, -5020, -5022, -5023, -5024, -5025, -5026, -5027, -5028, -5029, -5030, -5031, -5032, -5034, -5035, -5036, -5037, -5038, -5039, -5040, -5041, -5042, -5043, -5044, -5046, -5047, -5050, -5051, -5052, -5053, -5054, -5055, -5056, -5057, -5058, -5059, -5061, -5063, -5064, -5065, -5066, -5067, -5068, -5069, -5070, -5071, -5072, -5073, -5074, -5080, -5081, -5083, -5084, -5085, -5086, -5087, -5088, -5089, -5090, -5091, -5092, -5093, -5094, -5095, -5096, -5097, -5098, -5099, -5100, -5101, -5102, -5103, -5104, -5105, -5106, -5107, -5108, -5109, -5110, -5111, -5112, -5113, -5114, -5115, -5116, -5117, -5118, -5119, -5120, -5121, -5122, -5123, -5124, -5130, -5131, -5133, -5134, -5135, -5136, -5137, -5138, -5139, -5140, -5142, -5143, -5144, -5145, -5146, -5147, -5148, -5149, -5150, -5151, -5153, -5154, -5155, -5156, -5157, -5158, -5159, -5160, -5161, -5162, -5163, -5164, -5165, -5166, -5167, -5168, -5169, -5170, -5171, -5172, -5173, -5174, -5175, -5176, -5177, -5178, -5179, -5180, -5181, -5182, -5183, -5184, -5185, -5187, -5188, -5189, -5190, -5191, -5192, -5193, -5194, -5195, -5196, -5197, -5198, -5199, -5200, -5201, -5202, -5203, -5204, -5205, -5206, -5207, -5208, -5209, -5210, -5211, -5212, -5213, -5214, -5215, -5216, -5217, -5218, -5219, -5220, -5221, -5222, -5223, -5224, -5225, -5226, -5227, -5228, -5229, -5230, -5231, -5233, -5234, -5235, -5236, -5237, -5238, -5239, -5240, -5241, -5242, -5243, -5244, -5245, -5246, -5247, -5248, -5249, -5250, -5251, -5252, -5253, -5254, -5255, -5256, -5257, -5258, -5259, -5260, -5261, -5262, -5263, -5264, -5265, -5266, -5267, -5268, -5269, -5270, -5271, -5272, -5273, -5274, -5275, -5276, -5277, -5278, -5279, -5280, -5281, -5282, -5283, -5284, -5285, -5286, -5287, -5288, -5289, -5290, -5291, -5292, -5293, -5294, -5295, -5296, -5297, -5298, -5299, -5300, -5301, -5302, -5303, -5304, -5305, -5306, -5307, -5308, -5309, -5310, -5311, -5312, -5313, -5314, -5315, -5316, -5317, -5318, -5319, -5320, -5321, -5322, -5323, -5324, -5325, -5326, -5327, -5328, -5329, -5330, -5331, -5332, -5333, -5334, -5335, -5336, -5337, -5338, -5339, -5340, -5341, -5342, -5343, -5344, -5345, -5346, -5347, -5348, -5349, -5350, -5351, -5352, -5353, -5354, -5355, -5356, -5357, -5358, -5359, -5360, -5361, -5362, -5363, -5364, -5365, -5366, -5367, -5368, -5369, -5370, -5371, -5372, -5373, -5374, -5375, -5376, -5377, -5378, -5379, -5380, -5381, -5382, -5383, -5384, -5385, -5400, -5401, -5402, -5403, -5404, -5405, -5406, -5407, -5408, -5409, -5410, -5411, -5412, -5413, -5414, -5415, -5416, -5417, -5418, -5419, -5420, -5421, -5422, -5423, -5424, -5425, -5426, -5427, -5428, -5429, -5430, -5431, -5432, -5433, -5434, -5435, -5436, -5437, -5438, -5439, -5440, -5441, -5442, -5443, -5444, -5445, -5446, -5447, -5448, -5449, -5450, -5451, -5452, -5453, -5454, -5455, -5456, -5457, -5458, -5459, -5460, -5461, -5462, -5463, -5464, -5465, -5466, -5467, -5468, -5469, -5470, -5471, -5472, -5473, -5474, -5475, -5476, -5477, -5478, -5479, -5480, -5481, -5482, -5483, -5484, -5485, -5486, -5487, -5488, -5489, -5490, -5491, -5541, -5542, -5543, -5544, -5545, -5546, -5547, -5548, -5549, -5550, -5551, -5552, -5553, -5554, -5555, -5556, -5557, -5558, -5559, -5560, -5561, -5562, -5563, -5564, -5565, -5566, -5567, -5568, -5569, -5570, -5571, -5572, -5573, -5574, -5575, -5576, -5577, -5578, -5579, -5580, -5581, -5582, -5583, -5584, -5585, -5586, -5587, -5588, -5589, -5590, -5591, -5592, -5593, -5594, -5595, -5596, -5597, -5598, -5599, -5600, -5601, -5602, -5603, -5604, -5605, -5607, -5608, -5609, -5610, -5611, -5612, -5613, -5614, -5615, -5616, -5617, -5618, -5619, -5620, -5621, -5622, -5623, -5624, -5625, -5626, -5627, -5628, -5629, -5630, -5631, -5632, -5633, -5634, -5635, -5636, -5637, -5638, -5639, -5640, -5641, -5642, -5643, -5644, -5645, -5646, -5647, -5648, -5649, -5650, -5651, -5652, -5653, -5654, -5655, -5656, -5657, -5658, -5659, -5660, -5661, -5662, -5663, -5664, -5665, -5666, -5667, -5668, -5671, -5672, -5673, -5674, -5675, -5676, -5677, -5678, -5679, -5680, -5681, -5682, -5683, -5684, -5685, -5686, -5687, -5688, -5689, -5690, -5691, -5692, -5693, -5694, -5695, -5696, -5697, -5698, -5699, -5700, -5701, -5702, -5703, -5704, -5705, -5706, -5707, -5708, -5709, -5710, -5711, -5712, -5713, -5714, -5715, -5716, -5717, -5718, -5719, -5720, -5721, -5722, -5723, -5724, -5725, -5726, -5727, -5728, -5729, -5730, -5731, -5732, -5733, -5734, -5735, -5736, -5737, -5738, -5739, -5740, -5741, -5742, -5743, -5744, -5745, -5746, -5747, -5748, -5749, -5750, -5751, -5752, -5753, -5754, -5755, -5756, -5757, -5758, -5759, -5760, -5761, -5762, -5763, -5764, -5765, -5766, -5768, -5769, -5770, -5771, -5772, -5773, -5774, -5777, -5778, -5779, -5780, -5781, -5785, -5786, -5787, -5788, -5789, -5790, -5791, -5792, -5793, -5794, -5795, -5796, -5797, -5798, -5799, -5800, -5801, -5802, -5803, -5804, -5805, -5806, -5807, -5808, -5809, -5810, -5811, -5812, -5813, -5814, -5815, -5816, -5817, -5818, -5819, -5820, -5821, -5822, -5823, -5824, -5825, -5826, -5827, -5828, -5829, -5830, -5831, -5832, -5833, -5834, -5835, -5836, -5837, -5838, -5839, -5840, -5841, -5842, -5843, -5844, -5845, -5846, -5847, -5848, -5849, -5850, -5851, -5852, -5853, -5854, -5855, -5856, -5857, -5858, -5859, -5860, -5861, -5862, -5863, -5864, -5865, -5866, -5867, -5868, -5869, -5870, -5871, -5872, -5873, -5874, -5875, -5876, -5877, -5878, -5879, -5880, -5881, -5882, -5883, -5884, -5885, -5886, -5887, -5888, -5889, -5890, -5891, -5892, -5893, -5894, -5895, -5896, -5897, -5898, -5899, -5900, -5901, -5902, -5903, -5904, -5905, -5906, -5907, -5908, -5909, -5910, -5911, -5912, -5913, -5914, -5915, -5916, -5917, -5918, -5919, -5920, -5921, -5922, -5923, -5924, -5925, -5926, -5927, -5928, -5929, -5930, -5931, -5932, -5933, -5934, -5935, -5936, -5937, -5938, -5939, -5940, -5941, -5942, -5943, -5944, -5945, -5946, -5947, -5948, -5949, -5950, -5951, -5952, -5953, -5954, -5955, -5956, -5957, -5958, -5959, -5960, -5961, -5962, -5963, -5964, -5965, -5966, -5967, -5968, -5969, -5970, -5971, -5972, -5973, -5974, -5975, -5976, -5977, -5978, -5979, -5980, -5981, -5982, -5983, -5984, -5985, -5986, -5987, -5988, -5989, -5990, -5991, -5992, -5993, -5994, -5995, -5996, -5997, -5998, -5999, -6000, -6001, -6002, -6003, -6004, -6005, -6006, -6201, -6202, -6203, -6204, -6205, -6206, -6207, -6208, -6209, -6210, -6211, -6212, -6213, -6214, -6215, -6219, -6220, -6221, -6222, -6223, -6224, -6225, -6226, -6227, -6228, -6229, -6230, -6231, -6232, -6233, -6234, -6235, -6236, -6237, -6238, -6239, -6240, -6241, -6242, -6243, -6244, -6245, -6246, -6247, -6248, -6249, -6250, -6251, -6252, -6253, -6254, -6255, -6256, -6257, -6258, -6259, -6260, -6261, -6262, -6263, -6264, -6265, -6266, -6267, -6268, -6269, -6270, -6271, -6272, -6273, -6274, -6275, -6276, -6277, -6278, -6279, -6280, -6281, -6301, -6302, -6303, -6304, -6305, -6306, -6307, -6308, -6309, -6310, -6311, -6312, -6313, -6314, -6315, -6316, -6317, -6318, -6319, -6320, -6321, -6322, -6323, -7000, -7001, -7002, -7003, -7004, -7005, -7006, -7007, -7010, -7011, -7012, -7013, -7014, -7015, -7021, -7022, -7024, -7025, -7026, -7027, -7029, -7030, -7031, -7032, -7033, -7034, -7035, -7036, -7037, -7038, -7039, -7040, -7041, -7100, -7101, -7102, -7103, -7104, -7105, -7106, -7107, -7108, -7201, -7202, -7203, -7204, -7205, -7206, -7207, -7208, -7209, -7210, -7211, -7212, -7213, -7214, -7215, -7216, -7217, -7218, -7219, -7220, -7221, -7222, -7223, -7224, -7225, -7226, -7227, -7228, -7229, -7230, -7231, -7232, -7233, -7234, -7235, -7236, -7237, -7238, -7239, -7240, -7241, -7242, -7243, -7244, -7246, -7247, -7248, -7249, -7250, -7251, -7252, -7253, -7254, -7255, -7256, -7257, -7258, -7259, -7260, -7261, -7262, -7263, -7264, -7265, -7266, -7267, -7268, -7269, -7270, -7271, -7272, -7273, -7274, -7275, -7276, -7277, -7278, -7279, -7280, -7281, -7282, -7283, -7284, -7285, -7286, -7287, -7288, -8001, -8002, -8003, -8004, -8005, -9001, -9002, -9003, -9004, -9005, -9006, -9007, -9008, -9009, -9010, -9011, -9012, -9013, -9014, -9015, -9016, -9017, -9018, -9019, -9020, -9022, -9023, -9024, -9025, -9026, -9027, -9028, -9029, -9030, -9031, -9032, -9033, -9034, -9035, -9036, -9037, -9038, -9039, -9040, -9041, -9042, -9043, -9044, -9045, -9046, -9047, -9048, -9049, -9050, -9051, -9052, -9053, -9054, -9057, -9058, -9059, -9060, -9061, -9062, -9063, -9064, -9065, -9069, -9070, -9071, -9072, -9073, -9074, -9075, -9076, -9077, -9078, -9079, -9080, -9081, -9082, -9083, -9084, -9085, -9086, -9087, -9090, -9091, -9092, -9093, -9100, -9101, -9102, -9103, -9200, -9201, -9202, -9501, -9502, -9503, -9504, -9505, -9506, -9507, -9508, -9509, -9510, -9512, -9513, -9514, -9515, -9516, -9518, -9519, -9520, -9521, -9522, -9523, -9524, -9525, -9526, -9527, -9528, -9529, -9530, -9531, -9532, -9533, -9534, -9535, -9536, -9537, -9538, -9539, -9540, -9541, -9542, -9543, -9544, -9545, -9546, -9547, -9548, -9549, -9550, -9551, -9552, -9553, -9554, -9555, -9556, -9557, -9558, -9559, -9560, -9561, -9562, -9563, -9564, -9565, -9566, -9567, -9568, -9569, -9570, -9571, -9572, -9573, -9574, -9575, -9576, -9577, -9578, -9579, -9580, -9581, -9582, -9583, -9584, -9585, -9586, -9587, -9588, -9589, -9590, -9591, -9592, -9593, -9594, -9595, -9596, -9597, -9598, -9599, -9600, -9601, -9602, -9603, -9604, -9605, -9606, -9607, -9608, -9609, -9610, -9611, -9612, -9613, -9614, -9615, -9616, -9617, -9618, -9619, -9620, -9621, -9622, -9623, -9624, -9625, -9626, -9627, -9628, -9629, -9630, -9631, -9632, -9633, -9634, -9635, -9636, -9637, -9638, -9639, -9640, -9641, -9642, -9643, -9644, -9645, -9646, -9647, -9648, -9649, -9650, -9651, -9652, -9653, -9654, -9655, -9656, -9657, -9658, -9659, -9660, -9661, -9662, -9663, -9664, -9665, -9666, -9667, -9668, -9669, -9670, -9671, -9672, -9673, -9674, -9675, -9676, -9677, -9678, -9679, -9680, -9681, -9682, -9683, -9684, -9685, -9686, -9687, -9688, -9689, -9690, -9691, -9692, -9693, -9694, -9695, -9696, -9697, -9698, -9699, -9700, -9701, -9702, -9703, -9704, -9705, -9706, -9707, -9708, -9709, -9710, -9711, -9712, -9713, -9714, -9715, -9716, -9717, -9718, -9719, -9720, -9721, -9722, -9723, -9724, -9725, -9726, -9727, -9728, -9729, -9730, -9731, -9732, -9733, -9734, -9735, -9736, -9737, -9738, -9739, -9740, -9741, -9742, -9743, -9744, -9745, -20000, -21000, -22998, -30926, -32491, -38104, -38105}; +int g_all_ob_errnos[2028] = {0, -4000, -4001, -4002, -4003, -4004, -4005, -4006, -4007, -4008, -4009, -4010, -4011, -4012, -4013, -4014, -4015, -4016, -4017, -4018, -4019, -4020, -4021, -4022, -4023, -4024, -4025, -4026, -4027, -4028, -4029, -4030, -4031, -4032, -4033, -4034, -4035, -4036, -4037, -4038, -4039, -4041, -4042, -4043, -4044, -4045, -4046, -4047, -4048, -4049, -4050, -4051, -4052, -4053, -4054, -4055, -4057, -4058, -4060, -4061, -4062, -4063, -4064, -4065, -4066, -4067, -4068, -4070, -4071, -4072, -4073, -4074, -4075, -4076, -4077, -4078, -4080, -4081, -4084, -4085, -4090, -4097, -4098, -4099, -4100, -4101, -4102, -4103, -4104, -4105, -4106, -4107, -4108, -4109, -4110, -4111, -4112, -4113, -4114, -4115, -4116, -4117, -4118, -4119, -4120, -4121, -4122, -4123, -4124, -4125, -4126, -4127, -4128, -4133, -4138, -4139, -4142, -4143, -4144, -4146, -4147, -4149, -4150, -4151, -4152, -4153, -4154, -4155, -4156, -4157, -4158, -4159, -4160, -4161, -4162, -4163, -4164, -4165, -4166, -4167, -4168, -4169, -4170, -4171, -4172, -4173, -4174, -4175, -4176, -4177, -4178, -4179, -4180, -4181, -4182, -4183, -4184, -4185, -4186, -4187, -4188, -4189, -4190, -4191, -4192, -4200, -4201, -4204, -4205, -4206, -4207, -4208, -4209, -4210, -4211, -4212, -4213, -4214, -4215, -4216, -4217, -4218, -4219, -4220, -4221, -4222, -4223, -4224, -4225, -4226, -4227, -4228, -4229, -4230, -4231, -4232, -4233, -4234, -4235, -4236, -4237, -4238, -4239, -4240, -4241, -4242, -4243, -4244, -4245, -4246, -4247, -4248, -4249, -4250, -4251, -4252, -4253, -4254, -4255, -4256, -4257, -4258, -4260, -4261, -4262, -4263, -4264, -4265, -4266, -4267, -4268, -4269, -4270, -4271, -4273, -4274, -4275, -4276, -4277, -4278, -4279, -4280, -4281, -4282, -4283, -4284, -4285, -4286, -4287, -4288, -4289, -4290, -4291, -4292, -4293, -4294, -4295, -4296, -4297, -4298, -4299, -4300, -4301, -4302, -4303, -4304, -4305, -4306, -4307, -4308, -4309, -4310, -4311, -4312, -4313, -4314, -4315, -4316, -4317, -4318, -4319, -4320, -4321, -4322, -4323, -4324, -4325, -4326, -4327, -4328, -4329, -4330, -4331, -4332, -4333, -4334, -4335, -4336, -4337, -4338, -4339, -4340, -4341, -4342, -4343, -4344, -4345, -4346, -4347, -4348, -4349, -4350, -4351, -4352, -4353, -4354, -4355, -4356, -4357, -4358, -4359, -4360, -4361, -4362, -4363, -4364, -4365, -4366, -4367, -4368, -4369, -4370, -4371, -4372, -4373, -4374, -4375, -4376, -4377, -4378, -4379, -4380, -4381, -4382, -4383, -4385, -4386, -4387, -4388, -4389, -4390, -4391, -4392, -4393, -4394, -4395, -4396, -4505, -4507, -4510, -4512, -4515, -4517, -4518, -4519, -4523, -4524, -4525, -4526, -4527, -4528, -4529, -4530, -4531, -4532, -4533, -4537, -4538, -4539, -4540, -4541, -4542, -4543, -4544, -4545, -4546, -4547, -4548, -4549, -4550, -4551, -4552, -4553, -4554, -4600, -4601, -4602, -4603, -4604, -4605, -4606, -4607, -4608, -4609, -4610, -4611, -4613, -4614, -4615, -4620, -4621, -4622, -4623, -4624, -4625, -4626, -4628, -4629, -4630, -4631, -4632, -4633, -4634, -4636, -4637, -4638, -4639, -4640, -4641, -4642, -4643, -4644, -4645, -4646, -4647, -4648, -4649, -4650, -4651, -4652, -4653, -4654, -4655, -4656, -4657, -4658, -4659, -4660, -4661, -4662, -4663, -4664, -4665, -4666, -4667, -4668, -4669, -4670, -4671, -4672, -4673, -4674, -4675, -4676, -4677, -4678, -4679, -4680, -4681, -4682, -4683, -4684, -4685, -4686, -4687, -4688, -4689, -4690, -4691, -4692, -4693, -4694, -4695, -4696, -4697, -4698, -4699, -4700, -4701, -4702, -4703, -4704, -4705, -4706, -4707, -4708, -4709, -4710, -4711, -4712, -4713, -4714, -4715, -4716, -4717, -4718, -4719, -4720, -4721, -4722, -4723, -4724, -4725, -4726, -4727, -4728, -4729, -4730, -4731, -4732, -4733, -4734, -4735, -4736, -4737, -4738, -4739, -4740, -4741, -4742, -4743, -4744, -4745, -4746, -4747, -4748, -4751, -4752, -4753, -4754, -4755, -4756, -5000, -5001, -5002, -5003, -5006, -5007, -5008, -5010, -5011, -5012, -5014, -5015, -5016, -5017, -5018, -5019, -5020, -5022, -5023, -5024, -5025, -5026, -5027, -5028, -5029, -5030, -5031, -5032, -5034, -5035, -5036, -5037, -5038, -5039, -5040, -5041, -5042, -5043, -5044, -5046, -5047, -5050, -5051, -5052, -5053, -5054, -5055, -5056, -5057, -5058, -5059, -5061, -5063, -5064, -5065, -5066, -5067, -5068, -5069, -5070, -5071, -5072, -5073, -5074, -5080, -5081, -5083, -5084, -5085, -5086, -5087, -5088, -5089, -5090, -5091, -5092, -5093, -5094, -5095, -5096, -5097, -5098, -5099, -5100, -5101, -5102, -5103, -5104, -5105, -5106, -5107, -5108, -5109, -5110, -5111, -5112, -5113, -5114, -5115, -5116, -5117, -5118, -5119, -5120, -5121, -5122, -5123, -5124, -5125, -5130, -5131, -5133, -5134, -5135, -5136, -5137, -5138, -5139, -5140, -5142, -5143, -5144, -5145, -5146, -5147, -5148, -5149, -5150, -5151, -5153, -5154, -5155, -5156, -5157, -5158, -5159, -5160, -5161, -5162, -5163, -5164, -5165, -5166, -5167, -5168, -5169, -5170, -5171, -5172, -5173, -5174, -5175, -5176, -5177, -5178, -5179, -5180, -5181, -5182, -5183, -5184, -5185, -5187, -5188, -5189, -5190, -5191, -5192, -5193, -5194, -5195, -5196, -5197, -5198, -5199, -5200, -5201, -5202, -5203, -5204, -5205, -5206, -5207, -5208, -5209, -5210, -5211, -5212, -5213, -5214, -5215, -5216, -5217, -5218, -5219, -5220, -5221, -5222, -5223, -5224, -5225, -5226, -5227, -5228, -5229, -5230, -5231, -5233, -5234, -5235, -5236, -5237, -5238, -5239, -5240, -5241, -5242, -5243, -5244, -5245, -5246, -5247, -5248, -5249, -5250, -5251, -5252, -5253, -5254, -5255, -5256, -5257, -5258, -5259, -5260, -5261, -5262, -5263, -5264, -5265, -5266, -5267, -5268, -5269, -5270, -5271, -5272, -5273, -5274, -5275, -5276, -5277, -5278, -5279, -5280, -5281, -5282, -5283, -5284, -5285, -5286, -5287, -5288, -5289, -5290, -5291, -5292, -5293, -5294, -5295, -5296, -5297, -5298, -5299, -5300, -5301, -5302, -5303, -5304, -5305, -5306, -5307, -5308, -5309, -5310, -5311, -5312, -5313, -5314, -5315, -5316, -5317, -5318, -5319, -5320, -5321, -5322, -5323, -5324, -5325, -5326, -5327, -5328, -5329, -5330, -5331, -5332, -5333, -5334, -5335, -5336, -5337, -5338, -5339, -5340, -5341, -5342, -5343, -5344, -5345, -5346, -5347, -5348, -5349, -5350, -5351, -5352, -5353, -5354, -5355, -5356, -5357, -5358, -5359, -5360, -5361, -5362, -5363, -5364, -5365, -5366, -5367, -5368, -5369, -5370, -5371, -5372, -5373, -5374, -5375, -5376, -5377, -5378, -5379, -5380, -5381, -5382, -5383, -5384, -5385, -5400, -5401, -5402, -5403, -5404, -5405, -5406, -5407, -5408, -5409, -5410, -5411, -5412, -5413, -5414, -5415, -5416, -5417, -5418, -5419, -5420, -5421, -5422, -5423, -5424, -5425, -5426, -5427, -5428, -5429, -5430, -5431, -5432, -5433, -5434, -5435, -5436, -5437, -5438, -5439, -5440, -5441, -5442, -5443, -5444, -5445, -5446, -5447, -5448, -5449, -5450, -5451, -5452, -5453, -5454, -5455, -5456, -5457, -5458, -5459, -5460, -5461, -5462, -5463, -5464, -5465, -5466, -5467, -5468, -5469, -5470, -5471, -5472, -5473, -5474, -5475, -5476, -5477, -5478, -5479, -5480, -5481, -5482, -5483, -5484, -5485, -5486, -5487, -5488, -5489, -5490, -5491, -5541, -5542, -5543, -5544, -5545, -5546, -5547, -5548, -5549, -5550, -5551, -5552, -5553, -5554, -5555, -5556, -5557, -5558, -5559, -5560, -5561, -5562, -5563, -5564, -5565, -5566, -5567, -5568, -5569, -5570, -5571, -5572, -5573, -5574, -5575, -5576, -5577, -5578, -5579, -5580, -5581, -5582, -5583, -5584, -5585, -5586, -5587, -5588, -5589, -5590, -5591, -5592, -5593, -5594, -5595, -5596, -5597, -5598, -5599, -5600, -5601, -5602, -5603, -5604, -5605, -5607, -5608, -5609, -5610, -5611, -5612, -5613, -5614, -5615, -5616, -5617, -5618, -5619, -5620, -5621, -5622, -5623, -5624, -5625, -5626, -5627, -5628, -5629, -5630, -5631, -5632, -5633, -5634, -5635, -5636, -5637, -5638, -5639, -5640, -5641, -5642, -5643, -5644, -5645, -5646, -5647, -5648, -5649, -5650, -5651, -5652, -5653, -5654, -5655, -5656, -5657, -5658, -5659, -5660, -5661, -5662, -5663, -5664, -5665, -5666, -5667, -5668, -5671, -5672, -5673, -5674, -5675, -5676, -5677, -5678, -5679, -5680, -5681, -5682, -5683, -5684, -5685, -5686, -5687, -5688, -5689, -5690, -5691, -5692, -5693, -5694, -5695, -5696, -5697, -5698, -5699, -5700, -5701, -5702, -5703, -5704, -5705, -5706, -5707, -5708, -5709, -5710, -5711, -5712, -5713, -5714, -5715, -5716, -5717, -5718, -5719, -5720, -5721, -5722, -5723, -5724, -5725, -5726, -5727, -5728, -5729, -5730, -5731, -5732, -5733, -5734, -5735, -5736, -5737, -5738, -5739, -5740, -5741, -5742, -5743, -5744, -5745, -5746, -5747, -5748, -5749, -5750, -5751, -5752, -5753, -5754, -5755, -5756, -5757, -5758, -5759, -5760, -5761, -5762, -5763, -5764, -5765, -5766, -5768, -5769, -5770, -5771, -5772, -5773, -5774, -5777, -5778, -5779, -5780, -5781, -5785, -5786, -5787, -5788, -5789, -5790, -5791, -5792, -5793, -5794, -5795, -5796, -5797, -5798, -5799, -5800, -5801, -5802, -5803, -5804, -5805, -5806, -5807, -5808, -5809, -5810, -5811, -5812, -5813, -5814, -5815, -5816, -5817, -5818, -5819, -5820, -5821, -5822, -5823, -5824, -5825, -5826, -5827, -5828, -5829, -5830, -5831, -5832, -5833, -5834, -5835, -5836, -5837, -5838, -5839, -5840, -5841, -5842, -5843, -5844, -5845, -5846, -5847, -5848, -5849, -5850, -5851, -5852, -5853, -5854, -5855, -5856, -5857, -5858, -5859, -5860, -5861, -5862, -5863, -5864, -5865, -5866, -5867, -5868, -5869, -5870, -5871, -5872, -5873, -5874, -5875, -5876, -5877, -5878, -5879, -5880, -5881, -5882, -5883, -5884, -5885, -5886, -5887, -5888, -5889, -5890, -5891, -5892, -5893, -5894, -5895, -5896, -5897, -5898, -5899, -5900, -5901, -5902, -5903, -5904, -5905, -5906, -5907, -5908, -5909, -5910, -5911, -5912, -5913, -5914, -5915, -5916, -5917, -5918, -5919, -5920, -5921, -5922, -5923, -5924, -5925, -5926, -5927, -5928, -5929, -5930, -5931, -5932, -5933, -5934, -5935, -5936, -5937, -5938, -5939, -5940, -5941, -5942, -5943, -5944, -5945, -5946, -5947, -5948, -5949, -5950, -5951, -5952, -5953, -5954, -5955, -5956, -5957, -5958, -5959, -5960, -5961, -5962, -5963, -5964, -5965, -5966, -5967, -5968, -5969, -5970, -5971, -5972, -5973, -5974, -5975, -5976, -5977, -5978, -5979, -5980, -5981, -5982, -5983, -5984, -5985, -5986, -5987, -5988, -5989, -5990, -5991, -5992, -5993, -5994, -5995, -5996, -5997, -5998, -5999, -6000, -6001, -6002, -6003, -6004, -6005, -6006, -6201, -6202, -6203, -6204, -6205, -6206, -6207, -6208, -6209, -6210, -6211, -6212, -6213, -6214, -6215, -6219, -6220, -6221, -6222, -6223, -6224, -6225, -6226, -6227, -6228, -6229, -6230, -6231, -6232, -6233, -6234, -6235, -6236, -6237, -6238, -6239, -6240, -6241, -6242, -6243, -6244, -6245, -6246, -6247, -6248, -6249, -6250, -6251, -6252, -6253, -6254, -6255, -6256, -6257, -6258, -6259, -6260, -6261, -6262, -6263, -6264, -6265, -6266, -6267, -6268, -6269, -6270, -6271, -6272, -6273, -6274, -6275, -6276, -6277, -6278, -6279, -6280, -6281, -6301, -6302, -6303, -6304, -6305, -6306, -6307, -6308, -6309, -6310, -6311, -6312, -6313, -6314, -6315, -6316, -6317, -6318, -6319, -6320, -6321, -6322, -6323, -7000, -7001, -7002, -7003, -7004, -7005, -7006, -7007, -7010, -7011, -7012, -7013, -7014, -7015, -7021, -7022, -7024, -7025, -7026, -7027, -7029, -7030, -7031, -7032, -7033, -7034, -7035, -7036, -7037, -7038, -7039, -7040, -7041, -7100, -7101, -7102, -7103, -7104, -7105, -7106, -7107, -7108, -7201, -7202, -7203, -7204, -7205, -7206, -7207, -7208, -7209, -7210, -7211, -7212, -7213, -7214, -7215, -7216, -7217, -7218, -7219, -7220, -7221, -7222, -7223, -7224, -7225, -7226, -7227, -7228, -7229, -7230, -7231, -7232, -7233, -7234, -7235, -7236, -7237, -7238, -7239, -7240, -7241, -7242, -7243, -7244, -7246, -7247, -7248, -7249, -7250, -7251, -7252, -7253, -7254, -7255, -7256, -7257, -7258, -7259, -7260, -7261, -7262, -7263, -7264, -7265, -7266, -7267, -7268, -7269, -7270, -7271, -7272, -7273, -7274, -7275, -7276, -7277, -7278, -7279, -7280, -7281, -7282, -7283, -7284, -7285, -7286, -7287, -7288, -8001, -8002, -8003, -8004, -8005, -9001, -9002, -9003, -9004, -9005, -9006, -9007, -9008, -9009, -9010, -9011, -9012, -9013, -9014, -9015, -9016, -9017, -9018, -9019, -9020, -9022, -9023, -9024, -9025, -9026, -9027, -9028, -9029, -9030, -9031, -9032, -9033, -9034, -9035, -9036, -9037, -9038, -9039, -9040, -9041, -9042, -9043, -9044, -9045, -9046, -9047, -9048, -9049, -9050, -9051, -9052, -9053, -9054, -9057, -9058, -9059, -9060, -9061, -9062, -9063, -9064, -9065, -9069, -9070, -9071, -9072, -9073, -9074, -9075, -9076, -9077, -9078, -9079, -9080, -9081, -9082, -9083, -9084, -9085, -9086, -9087, -9090, -9091, -9092, -9093, -9100, -9101, -9102, -9103, -9200, -9201, -9202, -9501, -9502, -9503, -9504, -9505, -9506, -9507, -9508, -9509, -9510, -9512, -9513, -9514, -9515, -9516, -9518, -9519, -9520, -9521, -9522, -9523, -9524, -9525, -9526, -9527, -9528, -9529, -9530, -9531, -9532, -9533, -9534, -9535, -9536, -9537, -9538, -9539, -9540, -9541, -9542, -9543, -9544, -9545, -9546, -9547, -9548, -9549, -9550, -9551, -9552, -9553, -9554, -9555, -9556, -9557, -9558, -9559, -9560, -9561, -9562, -9563, -9564, -9565, -9566, -9567, -9568, -9569, -9570, -9571, -9572, -9573, -9574, -9575, -9576, -9577, -9578, -9579, -9580, -9581, -9582, -9583, -9584, -9585, -9586, -9587, -9588, -9589, -9590, -9591, -9592, -9593, -9594, -9595, -9596, -9597, -9598, -9599, -9600, -9601, -9602, -9603, -9604, -9605, -9606, -9607, -9608, -9609, -9610, -9611, -9612, -9613, -9614, -9615, -9616, -9617, -9618, -9619, -9620, -9621, -9622, -9623, -9624, -9625, -9626, -9627, -9628, -9629, -9630, -9631, -9632, -9633, -9634, -9635, -9636, -9637, -9638, -9639, -9640, -9641, -9642, -9643, -9644, -9645, -9646, -9647, -9648, -9649, -9650, -9651, -9652, -9653, -9654, -9655, -9656, -9657, -9658, -9659, -9660, -9661, -9662, -9663, -9664, -9665, -9666, -9667, -9668, -9669, -9670, -9671, -9672, -9673, -9674, -9675, -9676, -9677, -9678, -9679, -9680, -9681, -9682, -9683, -9684, -9685, -9686, -9687, -9688, -9689, -9690, -9691, -9692, -9693, -9694, -9695, -9696, -9697, -9698, -9699, -9700, -9701, -9702, -9703, -9704, -9705, -9706, -9707, -9708, -9709, -9710, -9711, -9712, -9713, -9714, -9715, -9716, -9717, -9718, -9719, -9720, -9721, -9722, -9723, -9724, -9725, -9726, -9727, -9728, -9729, -9730, -9731, -9732, -9733, -9734, -9735, -9736, -9737, -9738, -9739, -9740, -9741, -9742, -9743, -9744, -9745, -20000, -21000, -22998, -30926, -32491, -38104, -38105}; const char *ob_error_name(const int err) { const char *ret = "Unknown error"; diff --git a/src/share/ob_errno.def b/src/share/ob_errno.def index 01aee486559a75e782ed85b7d86d1ecc63a4e57c..e98319d9547b79e091e62c23de1bd4d6f01e78b0 100644 --- a/src/share/ob_errno.def +++ b/src/share/ob_errno.def @@ -753,6 +753,7 @@ DEFINE_ERROR(OB_SQL_OPT_JOIN_ORDER_FAILED, -5121, -1, "HY000", "fail to generat DEFINE_ERROR(OB_SQL_OPT_ERROR, -5122, -1, "HY000", "optimizer general error"); DEFINE_ORACLE_ERROR(OB_ERR_OCI_INIT_TIMEZONE, -5123, -1, "HY000", "failure to initialize timezone information", 1804, "failure to initialize timezone information"); DEFINE_ERROR(OB_ERR_ZLIB_DATA, -5124, ER_ZLIB_Z_DATA_ERROR, "HY000", "ZLIB: Input data corrupted"); +DEFINE_ORACLE_ERROR(OB_ERR_DBLINK_SESSION_KILLED, -5125, -1, "HY000", "your session has been killed", 28, "your session has been killed"); DEFINE_ERROR(OB_SQL_RESOLVER_NO_MEMORY, -5130, -1, "HY000", "sql resolver no memory"); DEFINE_ERROR(OB_SQL_DML_ONLY, -5131, -1, "HY000", "plan cache support dml only"); DEFINE_ERROR(OB_ERR_NO_GRANT, -5133, -1, "42000", "No such grant defined"); diff --git a/src/share/ob_errno.h b/src/share/ob_errno.h index bb16e68d03fe1697e11cfd900e2642a298c3f5e4..6148c4f01dfe5b38307b2fef8edb85b1d3e556a7 100644 --- a/src/share/ob_errno.h +++ b/src/share/ob_errno.h @@ -536,6 +536,7 @@ constexpr int OB_SQL_OPT_JOIN_ORDER_FAILED = -5121; constexpr int OB_SQL_OPT_ERROR = -5122; constexpr int OB_ERR_OCI_INIT_TIMEZONE = -5123; constexpr int OB_ERR_ZLIB_DATA = -5124; +constexpr int OB_ERR_DBLINK_SESSION_KILLED = -5125; constexpr int OB_SQL_RESOLVER_NO_MEMORY = -5130; constexpr int OB_SQL_DML_ONLY = -5131; constexpr int OB_ERR_NO_GRANT = -5133; @@ -2349,6 +2350,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_SQL_OPT_ERROR__USER_ERROR_MSG "optimizer general error" #define OB_ERR_OCI_INIT_TIMEZONE__USER_ERROR_MSG "failure to initialize timezone information" #define OB_ERR_ZLIB_DATA__USER_ERROR_MSG "ZLIB: Input data corrupted" +#define OB_ERR_DBLINK_SESSION_KILLED__USER_ERROR_MSG "your session has been killed" #define OB_SQL_RESOLVER_NO_MEMORY__USER_ERROR_MSG "sql resolver no memory" #define OB_SQL_DML_ONLY__USER_ERROR_MSG "plan cache support dml only" #define OB_ERR_NO_GRANT__USER_ERROR_MSG "No such grant defined" @@ -4380,6 +4382,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_SQL_OPT_ERROR__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5122, optimizer general error" #define OB_ERR_OCI_INIT_TIMEZONE__ORA_USER_ERROR_MSG "ORA-01804: failure to initialize timezone information" #define OB_ERR_ZLIB_DATA__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5124, ZLIB: Input data corrupted" +#define OB_ERR_DBLINK_SESSION_KILLED__ORA_USER_ERROR_MSG "ORA-00028: your session has been killed" #define OB_SQL_RESOLVER_NO_MEMORY__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5130, sql resolver no memory" #define OB_SQL_DML_ONLY__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5131, plan cache support dml only" #define OB_ERR_NO_GRANT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -5133, No such grant defined" @@ -5760,7 +5763,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219; #define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-12899: value too large for column %.*s (actual: %ld, maximum: %ld)" #define OB_ERR_INVALID_DATE_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-01861: Incorrect datetime value for column '%.*s' at row %ld" -extern int g_all_ob_errnos[2027]; +extern int g_all_ob_errnos[2028]; const char *ob_error_name(const int oberr); const char* ob_error_cause(const int oberr); diff --git a/src/share/schema/ob_schema_service_sql_impl.cpp b/src/share/schema/ob_schema_service_sql_impl.cpp index 1c4340778842c4267522da5500ef6141bbef4547..ec7ed1cbee9885c95d0a095c12e8009fc416fe69 100644 --- a/src/share/schema/ob_schema_service_sql_impl.cpp +++ b/src/share/schema/ob_schema_service_sql_impl.cpp @@ -8502,73 +8502,111 @@ int ObSchemaServiceSQLImpl::fetch_link_table_info(uint64_t tenant_id, // dblink will convert the result to AL32UTF8 when pulling schema meta LOG_WARN("failed to set expected charset id", K(ret)); } else { - T tmp_table_schema; - table_schema = NULL; - ObObjMeta type; - int64_t column_count = result->get_column_count(); - tmp_table_schema.set_tenant_id(tenant_id); - tmp_table_schema.set_table_id(1); //no use - tmp_table_schema.set_dblink_id(dblink_id); - tmp_table_schema.set_collation_type(CS_TYPE_UTF8MB4_BIN); - tmp_table_schema.set_charset_type(ObCharset::charset_type_by_coll(tmp_table_schema.get_collation_type())); - if (OB_FAIL(tmp_table_schema.set_table_name(table_name))) { - LOG_WARN("set table name failed", K(ret), K(table_name)); - } else if (OB_FAIL(tmp_table_schema.set_link_database_name(database_name))) { - LOG_WARN("set database name failed", K(ret), K(database_name)); - } - for (int64_t i = 0; OB_SUCC(ret) && i < column_count; ++i) { - ObColumnSchemaV2 column_schema; - int16_t precision = 0; - int16_t scale = 0; - int32_t length = 0; - ObString column_name; - bool old_max_length = false; - if (OB_FAIL(result->get_col_meta(i, old_max_length, column_name, type, precision, scale, length))) { - LOG_WARN("failed to get column meta", K(i), K(old_max_length), K(ret)); - } else if (OB_FAIL(column_schema.set_column_name(column_name))) { - LOG_WARN("failed to set column name", K(i), K(column_name), K(ret)); - } else { - column_schema.set_table_id(tmp_table_schema.get_table_id()); - column_schema.set_tenant_id(tenant_id); - column_schema.set_column_id(i + OB_END_RESERVED_COLUMN_ID_NUM); - column_schema.set_meta_type(type); - column_schema.set_charset_type(ObCharset::charset_type_by_coll(column_schema.get_collation_type())); - column_schema.set_data_precision(precision); - column_schema.set_data_scale(scale); - column_schema.set_data_length(length); - if (OB_SUCC(ret) && - next_sql_req_level == 1 && - (ObNCharType == column_schema.get_data_type() || ObNVarchar2Type == column_schema.get_data_type())) { - if (DBLINK_DRV_OB == link_type && - sql::DblinkGetConnType::TEMP_CONN != conn_type && - OB_FAIL(fetch_desc_table(dblink_id, - link_type, - database_name, - table_name, - param_ctx, - session_info, - alloctor, - i, - length))) { - LOG_WARN("failed to fetch desc table", K(ret)); - } else { - column_schema.set_data_length(length); + const char * desc_sql_str_fmt = "/*$BEFPARSEdblink_req_level=1*/ desc \"%.*s\".\"%.*s\""; + ObSqlString desc_sql; + ObMySQLResult *desc_result = NULL; + bool need_desc = (next_sql_req_level == 1) && DBLINK_DRV_OB == link_type && sql::DblinkGetConnType::TEMP_CONN != conn_type; + int64_t desc_res_row_idx = -1; + SMART_VAR(ObMySQLProxy::MySQLResult, desc_res) { + T tmp_table_schema; + table_schema = NULL; + ObObjMeta type; + int64_t column_count = result->get_column_count(); + tmp_table_schema.set_tenant_id(tenant_id); + tmp_table_schema.set_table_id(1); //no use + tmp_table_schema.set_dblink_id(dblink_id); + tmp_table_schema.set_collation_type(CS_TYPE_UTF8MB4_BIN); + tmp_table_schema.set_charset_type(ObCharset::charset_type_by_coll(tmp_table_schema.get_collation_type())); + if (OB_FAIL(ret)) { + // do nothing + } else if (OB_FAIL(tmp_table_schema.set_table_name(table_name))) { + LOG_WARN("set table name failed", K(ret), K(table_name)); + } else if (OB_FAIL(tmp_table_schema.set_link_database_name(database_name))) { + LOG_WARN("set database name failed", K(ret), K(database_name)); + } + for (int64_t i = 0; OB_SUCC(ret) && i < column_count; ++i) { + ObColumnSchemaV2 column_schema; + int16_t precision = 0; + int16_t scale = 0; + int32_t length = 0; + ObString column_name; + bool old_max_length = false; + if (OB_FAIL(result->get_col_meta(i, old_max_length, column_name, type, precision, scale, length))) { + LOG_WARN("failed to get column meta", K(i), K(old_max_length), K(ret)); + } else if (OB_FAIL(column_schema.set_column_name(column_name))) { + LOG_WARN("failed to set column name", K(i), K(column_name), K(ret)); + } else { + column_schema.set_table_id(tmp_table_schema.get_table_id()); + column_schema.set_tenant_id(tenant_id); + column_schema.set_column_id(i + OB_END_RESERVED_COLUMN_ID_NUM); + column_schema.set_meta_type(type); + column_schema.set_charset_type(ObCharset::charset_type_by_coll(column_schema.get_collation_type())); + column_schema.set_data_precision(precision); + column_schema.set_data_scale(scale); + if (need_desc && OB_ISNULL(desc_result) && + (ObNCharType == column_schema.get_data_type() || ObNVarchar2Type == column_schema.get_data_type())) { + if (OB_FAIL(desc_sql.append_fmt(desc_sql_str_fmt, database_name.length(), database_name.ptr(), + table_name.length(), table_name.ptr()))) { + LOG_WARN("append desc sql failed", K(ret)); + } else if (OB_FAIL(dblink_proxy_->dblink_read(dblink_conn, desc_res, desc_sql.ptr()))) { + ObDblinkUtils::process_dblink_errno(link_type, dblink_conn, ret); + LOG_WARN("read link failed", K(ret), K(dblink_id), K(desc_sql.ptr())); + } else if (OB_ISNULL(desc_result = desc_res.get_result())) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("fail to get result", K(ret)); + } else if (OB_FAIL(desc_result->set_expected_charset_id(static_cast(common::ObNlsCharsetId::CHARSET_AL32UTF8_ID), + static_cast(common::ObNlsCharsetId::CHARSET_AL32UTF8_ID)))) { + // dblink will convert the result to AL32UTF8 when pulling schema meta + LOG_WARN("failed to set expected charset id", K(ret)); + } + } + if (OB_SUCC(ret) && OB_NOT_NULL(desc_result) && (ObNCharType == column_schema.get_data_type() || ObNVarchar2Type == column_schema.get_data_type())) { + while (OB_SUCC(ret) && desc_res_row_idx < i) { + if (OB_FAIL(desc_result->next())) { + LOG_WARN("failed to get next row", K(ret)); + } + ++desc_res_row_idx; + } + if (desc_res_row_idx == i && OB_SUCC(ret)) { + const ObTimeZoneInfo *tz_info = TZ_INFO(session_info); + ObObj value; + ObString string_value; + if (OB_ISNULL(tz_info)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("tz info is NULL", K(ret)); + } else if (OB_FAIL(desc_result->get_obj(1, value, tz_info, &alloctor))) { + LOG_WARN("failed to get obj", K(ret)); + } else if (ObVarcharType != value.get_type()) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("type is invalid", K(value.get_type()), K(ret)); + } else if (OB_FAIL(value.get_varchar(string_value))) { + LOG_WARN("failed to get varchar value", K(ret)); + } else if (OB_FAIL(ObDblinkService::get_length_from_type_text(string_value, length))) { + LOG_WARN("failed to get length", K(ret)); + } else { + LOG_DEBUG("desc table type string", K(string_value), K(length)); + } + } } + column_schema.set_data_length(length); + } + LOG_DEBUG("dblink column schema", K(i), K(column_schema.get_data_precision()), + K(column_schema.get_data_scale()), + K(column_schema.get_data_length()), + K(column_schema.get_data_type())); + if (OB_SUCC(ret) && OB_FAIL(tmp_table_schema.add_column(column_schema))) { + LOG_WARN("fail to add link column schema. ", K(i), K(column_schema), K(ret)); } } - LOG_DEBUG("dblink column schema", K(i), K(column_schema.get_data_precision()), - K(column_schema.get_data_scale()), - K(column_schema.get_data_length()), - K(column_schema.get_data_type())); - if (OB_FAIL(ret)) { - } else if (OB_FAIL(tmp_table_schema.add_column(column_schema))) { - LOG_WARN("fail to add link column schema. ", K(i), K(column_schema), K(ret)); - } - } - if (OB_SUCC(ret)) { - if (OB_FAIL(ObSchemaUtils::alloc_schema(alloctor, tmp_table_schema, table_schema))) { + if (OB_SUCC(ret) && OB_FAIL(ObSchemaUtils::alloc_schema(alloctor, tmp_table_schema, table_schema))) { LOG_WARN("failed to alloc table_schema", K(ret)); } + int tmp_ret = OB_SUCCESS; + if (OB_NOT_NULL(desc_result) && OB_SUCCESS != (tmp_ret = desc_result->close())) { + LOG_WARN("failed to close desc result", K(tmp_ret)); + } else { + desc_result = NULL; + } } } if (OB_FAIL(ret)) { diff --git a/src/sql/dblink/ob_dblink_utils.cpp b/src/sql/dblink/ob_dblink_utils.cpp index 0da2fed74b8960c058acc37943ad32f100e7e50a..21d3c5b5820a8be28009ef419c10789f5d1c987f 100644 --- a/src/sql/dblink/ob_dblink_utils.cpp +++ b/src/sql/dblink/ob_dblink_utils.cpp @@ -84,9 +84,8 @@ int ObDblinkService::get_length_from_type_text(ObString &type_text, int32_t &len return ret; } -ObReverseLink::ObReverseLink(common::ObIAllocator &alloc) - : allocator_(alloc), - user_(), +ObReverseLink::ObReverseLink() + : user_(), tenant_(), cluster_(), passwd_(), @@ -100,6 +99,7 @@ ObReverseLink::ObReverseLink(common::ObIAllocator &alloc) ObReverseLink::~ObReverseLink() { + allocator_.reset(); } OB_DEF_SERIALIZE(ObReverseLink) @@ -381,7 +381,7 @@ int ObDblinkCtxInSession::register_dblink_conn_pool(common::sqlclient::ObCommonS return ret; } -// When the session is about to be destroyed, the session will release all connections +// When the session is about to be reset, the session will release all connections // from ObServerConnectionPool through this interface int ObDblinkCtxInSession::free_dblink_conn_pool() { @@ -400,9 +400,7 @@ int ObDblinkCtxInSession::free_dblink_conn_pool() LOG_TRACE("free and close dblink connection in session", KP(this), K(session_info_->get_sessid()), K(i), K(dblink_conn_pool_array_.count()), K(dblink_conn_pool_array_), KP(dblink_conn_pool), K(lbt())); } } - if (OB_SUCC(ret)) { - dblink_conn_pool_array_.reset(); - } + dblink_conn_pool_array_.reset(); return ret; } @@ -425,6 +423,11 @@ int ObDblinkCtxInSession::get_dblink_conn(uint64_t dblink_id, common::sqlclient: break; } } + if (OB_SUCC(ret) && OB_NOT_NULL(dblink_conn) && + (OB_SUCCESS != dblink_conn->ping())) { + ret = OB_ERR_DBLINK_SESSION_KILLED; + LOG_WARN("connection is invalid", K(ret), K(dblink_conn->usable()), KP(dblink_conn)); + } return ret; } @@ -473,9 +476,12 @@ int ObDblinkCtxInSession::clean_dblink_conn(const bool force_disconnect) } } } - if (OB_SUCC(ret)) { - dblink_conn_holder_array_.reset(); - } + dblink_conn_holder_array_.reset(); + arena_alloc_.reset(); + reverse_dblink_ = NULL; + reverse_dblink_buf_ = NULL; + sys_var_reverse_info_buf_ = NULL; + sys_var_reverse_info_buf_size_ = 0; return ret; } @@ -491,19 +497,23 @@ int ObDblinkCtxInSession::get_reverse_link(ObReverseLink *&reverse_dblink) LOG_WARN("failed to get SYS_VAR_SET_REVERSE_DBLINK_INFOS", K(value), K(ret)); } else if (NULL == reverse_dblink_ || 0 != last_reverse_info_values_.compare(value)) { if (!value.empty()){ // get a new valid REVERSE_DBLINK_INFOS, need create or update ObReverseLink - void *ptr = NULL; - void *last_new_value_ptr = NULL; - int64_t last_new_value_length = value.length(); - if (OB_ISNULL(ptr = arena_alloc_.alloc(sizeof(ObReverseLink)))) { + int64_t sys_var_length = value.length(); + if (OB_ISNULL(reverse_dblink_buf_) && + OB_ISNULL(reverse_dblink_buf_ = arena_alloc_.alloc(sizeof(ObReverseLink)))) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("failed to alloc memory", K(ret), K(sizeof(ObReverseLink))); - } else if (OB_ISNULL(last_new_value_ptr = arena_alloc_.alloc(last_new_value_length))) { + } else if (sys_var_length > sys_var_reverse_info_buf_size_ && + OB_ISNULL(sys_var_reverse_info_buf_ = arena_alloc_.alloc(2 * sys_var_length))) { ret = OB_ALLOCATE_MEMORY_FAILED; - LOG_WARN("failed to alloc memory", K(ret), K(last_new_value_length)); + LOG_WARN("failed to alloc memory", K(ret), K(2 * sys_var_length)); } else { - MEMCPY(last_new_value_ptr, value.ptr(), last_new_value_length); - last_reverse_info_values_.assign((char *)last_new_value_ptr, last_new_value_length); - reverse_dblink_ = new(ptr) ObReverseLink(arena_alloc_); + sys_var_reverse_info_buf_size_ = 2 * sys_var_length; + MEMCPY(sys_var_reverse_info_buf_, value.ptr(), sys_var_length); + last_reverse_info_values_.assign((char *)sys_var_reverse_info_buf_, sys_var_length); + if (OB_NOT_NULL(reverse_dblink_)) { + reverse_dblink_->~ObReverseLink(); + } + reverse_dblink_ = new(reverse_dblink_buf_) ObReverseLink(); char *new_buff = NULL; int64_t new_size = 0; int64_t pos = 0; diff --git a/src/sql/dblink/ob_dblink_utils.h b/src/sql/dblink/ob_dblink_utils.h index 135f25718bd80f4dfa6ef7c956d6f6045eeda4ba..ef8029e80fca2ce820f1fa53dcedf994973906bf 100644 --- a/src/sql/dblink/ob_dblink_utils.h +++ b/src/sql/dblink/ob_dblink_utils.h @@ -44,8 +44,8 @@ class ObReverseLink { OB_UNIS_VERSION_V(1); public: - explicit ObReverseLink(common::ObIAllocator &alloc); - ~ObReverseLink(); + explicit ObReverseLink(); + virtual ~ObReverseLink(); inline void set_user(ObString name) { user_ = name; } inline void set_tenant(ObString name) { tenant_ = name; } inline void set_cluster(ObString name) { cluster_ = name; } @@ -81,7 +81,7 @@ public: static const ObString SESSION_VARIABLE_STRING; static const int64_t LONG_QUERY_TIMEOUT; private: - common::ObIAllocator &allocator_; + common::ObArenaAllocator allocator_; ObString user_; ObString tenant_; ObString cluster_; @@ -112,7 +112,10 @@ public: explicit ObDblinkCtxInSession(ObSQLSessionInfo *session_info) : session_info_(session_info), - reverse_dblink_(NULL) + reverse_dblink_(NULL), + reverse_dblink_buf_(NULL), + sys_var_reverse_info_buf_(NULL), + sys_var_reverse_info_buf_size_(0) {} ~ObDblinkCtxInSession() { @@ -124,6 +127,7 @@ public: const bool force_disconnect = true; clean_dblink_conn(force_disconnect); free_dblink_conn_pool(); + // session_info_ = NULL; // do not need reset session_info_ reverse_dblink_ = NULL; } int register_dblink_conn_pool(common::sqlclient::ObCommonServerConnectionPool *dblink_conn_pool); @@ -136,6 +140,9 @@ public: private: ObSQLSessionInfo *session_info_; ObReverseLink *reverse_dblink_; + void * reverse_dblink_buf_; + void * sys_var_reverse_info_buf_; + int64_t sys_var_reverse_info_buf_size_; common::ObArenaAllocator arena_alloc_; ObArray dblink_conn_pool_array_; //for dblink read to free connection when session drop. ObArray dblink_conn_holder_array_; //for dblink write to hold connection during trasaction. diff --git a/src/sql/engine/dml/ob_link_dml_op.cpp b/src/sql/engine/dml/ob_link_dml_op.cpp index cca5b95053bfebe56ffaceafa66e1cfb9cbac52c..595844cb1cc5d6afdad5227133613e4adbca2869 100644 --- a/src/sql/engine/dml/ob_link_dml_op.cpp +++ b/src/sql/engine/dml/ob_link_dml_op.cpp @@ -68,7 +68,7 @@ int ObLinkDmlOp::send_reverse_link_info(transaction::ObTransID &tx_id) LOG_WARN("reverse link has invalid credentials", K(ret), K(user_name), K(tenant_name), K(passwd.empty()), K(addr)); LOG_USER_ERROR(OB_ERR_UNEXPECTED, "check if the database link was created with local credentials"); } else { - ObReverseLink reverse_link_info(MY_SPEC.allocator_); + ObReverseLink reverse_link_info; reverse_link_info.set_user(user_name); reverse_link_info.set_tenant(tenant_name); reverse_link_info.set_cluster(cluster_name);