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

    • Bug
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.9(EOL), 10.10(EOL), 10.11
    • 10.5, 10.6, 10.11
    • 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

              bar Alexander Barkov
              diego dupin Diego Dupin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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