Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2.3, 10.2.4
-
10.2.4-1, 10.2.4-2, 10.2.6-1
Description
MDEV-8931 implement a new capacity CLIENT_DEPRECATE_EOF that deprecate EOF packet.
Store procedure output parameter identification
When calling a store procedure with output parameters - using prepare statement - server send output parameter in a resultset if client has CLIENT_PS_MULTI_RESULTS capacity. Client must identify this resultset as an "output parameter resultset". This was actually done by a flag on the deleted EOF packet.
Example :
DELIMITER //
|
create procedure prepareStmtWithOutParameter (x int, INOUT y int) |
BEGIN
|
SELECT 1; |
end; |
//
|
DELIMITER ;
|
|
prepare test from "call prepareStmtWithOutParameter(?,?)"; |
set @param1=1; |
set @param2=2; |
execute test using @param1, @param2; |
For this example, if client has CLIENT_PS_MULTI_RESULTS capacity, server will send 2 differents resultset :
- first one corresponding to "SELECT 1; "
- second result-set contain the INOUT integer parameter "y"
Before CLIENT_DEPRECATE_EOF capability, client can identify that resultset is an "output parameter resulset" with the EOF packet server status value.
Flag SERVER_PS_OUT_PARAM indicate that resultset is an "output param" resultset.
A resultset has 2 EOF packet. SERVER_PS_OUT_PARAM flag is set only on first EOF.
If CLIENT_DEPRECATE_EOF is set, first EOF is deleted, second has to have the SERVER_PS_OUT_PARAM flag.
Attachments
Issue Links
Activity
Comment | [ A comment with security level 'Developers' was removed. ] |
Attachment | MDEV_8931.patch [ 43227 ] |
Attachment | MDEV_8931.patch [ 43228 ] |
Description |
There is 2 issues : *EOF must not be replaced for binary resultset.* EOF packet cannot be replace by a OK_Packet for a binary resultset. In binary format, a row first byte can have any value. The only possibility to identify that resultset has ended is an EOF packet = first byte is 0xFE and packet length < 9. (0xFE can be a valid first byte, but then that indicate that next value is a 8 byte long). *Store procedure output parameter identification* More complexe case : when calling a store procedure with output parameters - using prepare statement - server send output parameter in a resultset if client has CLIENT_PS_MULTI_RESULTS capacity. Client must identify this resultset as an "output parameter resultset". This was actually done by a flag on the deleted EOF packet. Example : {code:sql} DELIMITER // create procedure prepareStmtWithOutParameter (x int, INOUT y int) BEGIN SELECT 1; end; // DELIMITER ; prepare test from "call prepareStmtWithOutParameter(?,?)"; set @param1=1; set @param2=2; execute test using @param1, @param2; {code} For this example, if client has CLIENT_PS_MULTI_RESULTS capacity, server will send 2 differents [resultset|https://mariadb.com/kb/en/mariadb/resultset/] : - first one corresponding to "SELECT 1; " - second result-set contain the INOUT integer parameter "y" Before CLIENT_DEPRECATE_EOF capability, client can identify that resultset is an "output parameter resulset" with the [EOF packet|https://mariadb.com/kb/en/mariadb/eof_packet/] [server status|https://mariadb.com/kb/en/mariadb/ok_packet/#server-status-flag] value. Flag SERVER_PS_OUT_PARAM indicate that resultset is an "output param" resultset. A resultset has 2 EOF packet. SERVER_PS_OUT_PARAM flag is set only on first EOF. If CLIENT_DEPRECATE_EOF is set, first EOF is deleted, second has to have the SERVER_PS_OUT_PARAM flag. |
*Store procedure output parameter identification* When calling a store procedure with output parameters - using prepare statement - server send output parameter in a resultset if client has CLIENT_PS_MULTI_RESULTS capacity. Client must identify this resultset as an "output parameter resultset". This was actually done by a flag on the deleted EOF packet. Example : {code:sql} DELIMITER // create procedure prepareStmtWithOutParameter (x int, INOUT y int) BEGIN SELECT 1; end; // DELIMITER ; prepare test from "call prepareStmtWithOutParameter(?,?)"; set @param1=1; set @param2=2; execute test using @param1, @param2; {code} For this example, if client has CLIENT_PS_MULTI_RESULTS capacity, server will send 2 differents [resultset|https://mariadb.com/kb/en/mariadb/resultset/] : - first one corresponding to "SELECT 1; " - second result-set contain the INOUT integer parameter "y" Before CLIENT_DEPRECATE_EOF capability, client can identify that resultset is an "output parameter resulset" with the [EOF packet|https://mariadb.com/kb/en/mariadb/eof_packet/] [server status|https://mariadb.com/kb/en/mariadb/ok_packet/#server-status-flag] value. Flag SERVER_PS_OUT_PARAM indicate that resultset is an "output param" resultset. A resultset has 2 EOF packet. SERVER_PS_OUT_PARAM flag is set only on first EOF. If CLIENT_DEPRECATE_EOF is set, first EOF is deleted, second has to have the SERVER_PS_OUT_PARAM flag. |
Fix Version/s | 10.2 [ 14601 ] | |
Assignee | Oleksandr Byelkin [ sanja ] |
Sprint | 10.2.4-1 [ 132 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Labels | 10.2-ga |
Sprint | 10.2.4-1 [ 132 ] | 10.2.4-1, 10.2.4-2 [ 132, 134 ] |
Sprint | 10.2.4-1, 10.2.4-2 [ 132, 134 ] | 10.2.4-1, 10.2.4-2, 10.2.6-1 [ 132, 134, 146 ] |
Rank | Ranked lower |
Component/s | Scripts & Clients [ 11002 ] | |
Fix Version/s | 10.2.5 [ 22117 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 79148 ] | MariaDB v4 [ 151513 ] |