Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11761

CLIENT_DEPRECATE_EOF : Client must identify a "stored procedure output resultset"

Details

    • 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

            diego dupin Diego Dupin created issue -
            diego dupin Diego Dupin made changes -
            Field Original Value New Value
            diego dupin Diego Dupin made changes -
            Comment [ A comment with security level 'Developers' was removed. ]
            diego dupin Diego Dupin made changes -
            Attachment MDEV_8931.patch [ 43227 ]
            diego dupin Diego Dupin made changes -
            Attachment MDEV_8931.patch [ 43228 ]
            diego dupin Diego Dupin made changes -
            Description MDEV-8931 implement a new capacity CLIENT_DEPRECATE_EOF that deprecate EOF packet.

            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.

            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 :
            {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.

            diego dupin Diego Dupin made changes -
            elenst Elena Stepanova made changes -
            Fix Version/s 10.2 [ 14601 ]
            Assignee Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Sprint 10.2.4-1 [ 132 ]
            sanja Oleksandr Byelkin made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            elenst Elena Stepanova made changes -
            Labels 10.2-ga
            ratzpo Rasmus Johansson (Inactive) made changes -
            Sprint 10.2.4-1 [ 132 ] 10.2.4-1, 10.2.4-2 [ 132, 134 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            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 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Rank Ranked lower
            sanja Oleksandr Byelkin made changes -
            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 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 79148 ] MariaDB v4 [ 151513 ]

            People

              sanja Oleksandr Byelkin
              diego dupin Diego Dupin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.