[to #52107651]mysql proc only return ok in c driver

This commit is contained in:
LiuYoung00 2023-09-20 16:46:11 +00:00 committed by ob-robot
parent bcd7e5b279
commit 98d6d32ccc
7 changed files with 11 additions and 72 deletions

View File

@ -154,6 +154,8 @@ int ObSyncCmdDriver::response_result(ObMySQLResultSet &result)
if (!result.is_pl_stmt(result.get_stmt_type())) {
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("Not SELECT, should not have any row!!!", K(ret));
} else if (!result.is_ps_protocol() && is_mysql_mode() && session_.client_non_standard()) {
// do nothing
} else if (OB_FAIL(response_query_result(result))) {
LOG_WARN("response query result fail", K(ret));
free_output_row(result);
@ -184,7 +186,8 @@ int ObSyncCmdDriver::response_result(ObMySQLResultSet &result)
LOG_WARN("close result set fail", K(ret));
} else if (!result.is_with_rows()
|| (sender_.need_send_extra_ok_packet() && !result.has_more_result())
|| is_prexecute_) {
|| is_prexecute_
|| (!result.is_ps_protocol() && is_mysql_mode() && session_.client_non_standard())) {
process_ok = true;
ObOKPParam ok_param;
ok_param.message_ = const_cast<char*>(result.get_message());

View File

@ -1940,6 +1940,7 @@ int ObMPConnect::verify_identify(ObSMConnection &conn, ObSQLSessionInfo &session
session.set_tenant(tenant_name_, tenant_id);
session.set_proxy_cap_flags(conn.proxy_cap_flags_);
session.set_login_tenant_id(tenant_id);
session.set_client_non_standard(common::OB_CLIENT_NON_STANDARD == conn.client_type_ ? true : false);
// Check tenant after set tenant session is necessary!
// Because if another client is deleting this tenant while the
// session doesn't has been contructed completely, omt

View File

@ -199,7 +199,8 @@ ObSQLSessionInfo::ObSQLSessionInfo(const uint64_t tenant_id) :
vport_(0),
in_bytes_(0),
out_bytes_(0),
current_dblink_sequence_id_(0)
current_dblink_sequence_id_(0),
client_non_standard_(false)
{
MEMSET(tenant_buff_, 0, sizeof(share::ObTenantSpaceFetcher));
MEMSET(vip_buf_, 0, sizeof(vip_buf_));
@ -369,6 +370,7 @@ void ObSQLSessionInfo::reset(bool skip_sys_var)
dblink_context_.reset(); // need reset before ObBasicSessionInfo::reset(skip_sys_var);
ObBasicSessionInfo::reset(skip_sys_var);
txn_free_route_ctx_.reset();
client_non_standard_ = false;
}
gtt_session_scope_unique_id_ = 0;
gtt_trans_scope_unique_id_ = 0;

View File

@ -1125,6 +1125,8 @@ public:
ObDBlinkSequenceIdMap &get_dblink_sequence_id_map() { return dblink_sequence_id_map_; }
void set_current_dblink_sequence_id(int64_t id) { current_dblink_sequence_id_ = id; }
int64_t get_current_dblink_sequence_id() const { return current_dblink_sequence_id_; }
void set_client_non_standard(bool client_non_standard) { client_non_standard_ = client_non_standard; }
bool client_non_standard() { return client_non_standard_; }
int get_mem_ctx_alloc(common::ObIAllocator *&alloc);
int update_sess_sync_info(const SessionSyncInfoType sess_sync_info_type,
const char *buf, const int64_t length, int64_t &pos);
@ -1507,6 +1509,7 @@ private:
int64_t out_bytes_;
int64_t current_dblink_sequence_id_;
common::ObSEArray<ObSequenceSchema*, 2> dblink_sequence_schemas_;
bool client_non_standard_;
};
inline bool ObSQLSessionInfo::is_terminate(int &ret) const

View File

@ -619,18 +619,8 @@ insert into b values(x);
end//
set @px = 1;
call p(@px);
+------+
| x |
+------+
| 1 |
+------+
set @py = 1;
call pp(@py);
+------+
| x |
+------+
| 1 |
+------+
select * from a;
+------+
| a1 |
@ -1873,11 +1863,6 @@ begin
set x=1;
end//
call p(@a);
+------+
| x |
+------+
| 1 |
+------+
select @a;
+------+
| @a |

View File

@ -1369,11 +1369,6 @@ insert into warehouse values(1, "4W+?M?/aG", "?VJ;t+P??m5v2?.=?T", "%N#RO?|??;[_
## RUN TEST
call order_status(0, 1, 5, 'ESEBARABLE');
call stock_level(1, 5, 11, @low_stock);
+-----------+
| low_stock |
+-----------+
| 0 |
+-----------+
call payment(1, 1, 0, 1, 1, 'BAROUGHTEING', 1495.970000);
call payment(1, 4, 0, 1, 1, 'CALLYBARPRI', 3258.880000);
call payment(1, 8, 1892, 1, 8, '', 3254.660000);
@ -1383,61 +1378,21 @@ call payment(1, 9, 0, 1, 6, 'PRIOUGHTOUGHT', 1772.030000);
call payment(1, 8, 0, 1, 8, 'ABLEESEPRES', 1394.860000);
##all items can be found
call new_order(1, 4, 1, 1, 6, 36158, 1, 10, 4071, 1, 6, 49919, 1, 9, 56284, 1, 3, 73312, 1, 5, 81280, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @rc);
+------+
| rc |
+------+
| 0 |
+------+
##all items can be found
call new_order(1, 2, 1, 1, 14, 8063, 1, 5, 65014, 1, 3, 32766, 1, 6, 76767, 1, 7, 16347, 1, 9, 63436, 1, 7, 48061, 1, 1, 98170, 1, 4, 78779, 1, 1, 42720, 1, 2, 77791, 1, 3, 61436, 1, 3, 39336, 1, 9, 39807, 1, 5, 0, 0, 0, @rc);
+------+
| rc |
+------+
| 0 |
+------+
##all items can be found
call new_order(1, 9, 1, 1, 15, 8115, 1, 2, 24448, 1, 10, 98302, 1, 8, 73728, 1, 4, 23965, 1, 5, 81852, 1, 5, 67928, 1, 3, 63995, 1, 5, 3936, 1, 10, 94624, 1, 6, 45056, 1, 7, 24309, 1, 4, 40936, 1, 9, 69055, 1, 10, 96504, 1, 5, @rc);
+------+
| rc |
+------+
| 0 |
+------+
##some items can not be found
call new_order(1, 1, 1, 1, 6, 55288, 1, 3, 7998, 1, 6, 2048, 1, 2, 90108, 1, 6, 68540, 1, 9, 32767, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @rc);
+------+
| rc |
+------+
| 1 |
+------+
##some items can not be found
call new_order(1, 3, 1, 1, 6, 88308, 1, 6, 88975, 1, 1, 12032, 1, 3, 23391, 1, 3, 49136, 1, 4, 7101, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @rc);
+------+
| rc |
+------+
| 1 |
+------+
call payment(1, 3, 8, 1, 3, '', 1120.650000);
##some items can not be found
call new_order(1, 4, 1, 1, 6, 12158, 1, 9, 16246, 1, 8, 24574, 1, 5, 86016, 1, 2, 44479, 1, 8, 73727, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @rc);
+------+
| rc |
+------+
| 1 |
+------+
call payment(1, 1, 1856, 1, 1, '', 2768.240000);
##some items can not be found
call new_order(1, 7, 1, 1, 6, 96926, 1, 3, 49151, 1, 4, 15357, 1, 7, 32512, 1, 7, 16128, 1, 3, 38144, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @rc);
+------+
| rc |
+------+
| 1 |
+------+
call stock_level(1, 2, 16, @low_stock);
+-----------+
| low_stock |
+-----------+
| 0 |
+-----------+
call payment(1, 5, 337, 1, 5, '', 2597.460000);
call delivery(1, 1);

View File

@ -993,11 +993,6 @@ call proc_12976_a();
| 2 | 2 |
+-------------------------+--------------------+
call proc_12976_b('A', @ep, @msg);
+------+------+
| ep | msg |
+------+------+
|  | True |
+------+------+
select HEX(@ep), @msg;
+----------+------+
| HEX(@ep) | @msg |
@ -1006,11 +1001,6 @@ select HEX(@ep), @msg;
+----------+------+
call proc_12976_b('B', @ep, @msg);
+------+-------+
| ep | msg |
+------+-------+
| | False |
+------+-------+
select HEX(@ep), @msg;
+----------+-------+
| HEX(@ep) | @msg |