Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-1295

MaxScale's readwritesplit router does not take into account the fact that stored procedure call may change the value of a user variable

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.1.3
    • 2.1.9
    • readwritesplit
    • None
    • 2017-42

    Description

      MaxScale's ReadWriteSplit router is not smart enough to assume that stored procedure call may modify a user variable. If we have a procedure, p1, defined like this:

      delimiter //
      create procedure p1(OUT p_id int(11) unsigned) 
      MODIFIES SQL DATA 
      BEGIN 
        ...
        SET p_id = some_value; -- last_insert_id(), for example 
      END//
      

      then for the following sequence of statements:

      SET @id = NULL;
      CALL p1(@id);
      SELECT @id;
      

      we may still get NULL from the last statement, even if the value is changed inside the procedure and this is clear when we connect to master directly.

      MaxScale should be smarter and either assume that any procedure call may change data, including user variables, or parse the definition of the procedure called to check if this is the case, before decide what node to route queries to.

      Attachments

        Issue Links

          Activity

            People

              markus makela markus makela
              valerii Valerii Kravchuk
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.