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

Wrong stored procedure output BIT result format when using binary protocol

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Progress (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.5, 10.1, 10.2, 10.3, 10.4, 10.0
    • Fix Version/s: 10.2, 10.3, 10.4
    • Component/s: None

      Description

      Store procedure output BIT format data are TEXT length encoded, not byte length encoded.

      Example :

      CREATE TABLE tt2(i BIT(7));
      INSERT INTO tt2 VALUE (127);
      create procedure other128 (OUT o_duplicate BIT(7))
      begin
        SELECT * FROM tt2;
        SELECT i INTO o_duplicate FROM tt2;
      end
       
      CALL other128(?)
      
      

      Exchanges will be :

       
      23 00 00 02 03 64 65 66  05 74 65 73 74 6A 03 74     #....def.testj.t
      74 32 03 74 74 32 01 69  01 69 0C 3F 00 07 00 00     t2.tt2.i.i.?....
      00 10 20 00 00 00 00                                 .. ....             ==> data type = 10 = BIT
       
      04 00 00 03 00 00 01 7F                              ........            => 01 7F = 127, byte length encoded
       
      ...
       
      41 00 00 06 03 64 65 66  05 74 65 73 74 6A 08 6F    A....def.testj.o
      74 68 65 72 31 32 38 08  6F 74 68 65 72 31 32 38    ther128.other128
      0B 6F 5F 64 75 70 6C 69  63 61 74 65 0B 6F 5F 64    .o_duplicate.o_d
      75 70 6C 69 63 61 74 65  0C 3F 00 07 00 00 00 10    uplicate.?......
      20 00 00 00 00                                      ....                 ==> same data type = 10 = BIT
       
      06 00 00 07 00 00 03 31  32 37                      .......127           => 03 31  32 37 = 127, string encoded 
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: