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

Does Maxscale 6.1.3 prevent the reassembly of user variables?

    XMLWordPrintable

Details

    Description

      Hello

      We see a slight difference between version 10.3.27-MariaDB-0 + deb10u1-log and version 10.5.12-MariaDB-1: 10.5.12 + maria ~ buster-log.
      Unless it is from the maxscale layer.

      – Reproduce with

      CREATE DEFINER=`cluster`@`%` PROCEDURE `test_proc`(IN myinparam INT, OUT myoutparam INT)
          SQL SECURITY INVOKER
      BEGIN
       
        SELECT myinparam;
        Set myoutparam = myinparam * 2;
        -- SELECT myinparam * 2 INTO myoutparam; -- same behavior
        SELECT myinparam, myoutparam;
       
      END
      

      – Test script

      SET @myvar = 10;
      SELECT 'before', @myvar;
      CALL melolo_test.test_proc(123, @myvar);
      SELECT 'after', @myvar;
      

      – case tested
      >>> MariaDB 10.3 solo
      1.1- host local(user 'cluster') with PROC DEFINER (cluster@%) <=> mariadb (10.3.27) => OK
      > before 10
      > after 256

      1.2- host local(user 'cluster') with PROC DEFINER (admin@%) <=> mariadb (10.3.27) => OK
      > before 10
      > after 256

      >>>> MariaDB 10.5 by Mascale 6.1.3
      2.1- host local(user 'cluster') with PROC DEFINER (cluster@%) <=> maxscale 6.1.3 <=> cluster (10.5.12) => KO
      > before 10
      > after 10

      2.2- host local(user 'cluster') with PROC DEFINER (admin@%) <=> maxscale 6.1.3 <=> cluster (10.5.12) => KO
      > before 10
      > after 10

      2.3- host local(user 'admin') with PROC DEFINER (cluster@%) <=> maxscale 6.1.3 <=> cluster (10.5.12) => KO
      > before 10
      > after 10

      2.4- host local(user 'admin') with PROC DEFINER (admin@%) <=> maxscale 6.1.3 <=> cluster (10.5.12) => KO
      > before 10
      > after 10

      >>>> MariaDB 10.5 directement node master
      3.1- host local(user 'cluster') with PROC DEFINER (cluster@%) <=> node master (10.5.12) => OK
      > before 10
      > after 256

      3.2- host local(user 'cluster') with PROC DEFINER (admin@%) <=> node master (10.5.12) => OK
      > before 10
      > after 256

      3.3- host local(user 'admin') with PROC DEFINER (cluster@%) <=> node master (10.5.12) => OK
      > before 10
      > after 256

      3.4- host local(user 'admin') with PROC DEFINER (admin@%) <=> node master (10.5.12) => OK
      > before 10
      > after 256

      Regardless of the user <=> definer couple:

      • the script does not return the correct result by Maxscale
      • the script returns the correct result without passing Maxscale

      Would Maxscale block user variables?
      To do this, I completed the tests by repeating the script below on directly on the master node and via maxscale

      1) First pass
      >>>> MariaDB 10.5 directement sur le node master avec le user admin

      SELECT '@myvar_from_nodeMaster', @myvar_from_node7, '@myvar_from_maxscale', @myvar_from_maxscale;
      

      > '@myvar_from_nodeMaster', null, '@myvar_from_maxscale', null;

      SET @myvar_from_nodeMaster = 654321;
      SELECT '@myvar_from_nodeMaster', @myvar_from_nodeMaster, '@myvar_from_maxscale', 
      @myvar_from_maxscale;
      

      >'@myvar_from_nodeMaster', 654321, '@myvar_from_maxscale', null;

      >>>> MariaDB 10.5 by Mascale 6.1.3 avec le user admin

      SELECT '@myvar_from_node7', @myvar_from_node7, '@myvar_from_maxscale', @myvar_from_maxscale;
      

      > @myvar_from_node7, null, @myvar_from_maxscale, null

      set @myvar_from_maxscale = 123456;
      SELECT '@myvar_from_node7', @myvar_from_node7, '@myvar_from_maxscale', @myvar_from_maxscale;
      

      > @myvar_from_node7, null, @myvar_from_maxscale, 123456

      2) Second pass
      >>>> MariaDB 10.5 directement node master avec le user admin

      SELECT '@myvar_from_nodeMaster', @myvar_from_nodeMaster, '@myvar_from_maxscale', @myvar_from_maxscale;
      

      >'@myvar_from_nodeMaster', 654321, '@myvar_from_maxscale', null;
      >>>> MariaDB 10.5 by Mascale 6.1.3 avec le user admin

      SELECT '@myvar_from_nodeMaster', @myvar_from_nodeMaster, '@myvar_from_maxscale', @myvar_from_maxscale;
      

      > @myvar_from_node7, null, @myvar_from_maxscale, 123456

      Although we always connect with the same user, the variables remain watertight between the 2 connection spaces ...

      Is there a way around this?

      Thank you in advance for your return

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              c.devel Christophe DEVEL
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.