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

Reading last insert id from @@identity variable does not work with maxscale

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.0.2
    • 2.0.3, 2.1.0
    • QueryClassifier
    • None
    • CentOS 7 64bit

    Description

      When i try to read last insert id from @@identity maxscale always returns 0. (when i try to combine @@identity with last_insert_id in the same query, then @@identity works as expected).

      For example:

      MySQL [ANI3]> insert into test set data='xxx'; select last_insert_id(), @@identity; select @@identity; select last_insert_id();
      Query OK, 1 row affected (0.01 sec)
       
      +------------------+------------+
      | last_insert_id() | @@identity |
      +------------------+------------+
      |               79 |         79 |
      +------------------+------------+
      1 row in set (0.00 sec)
       
      +------------+
      | @@identity |
      +------------+
      |          0 |
      +------------+
      1 row in set (0.00 sec)
       
      +------------------+
      | last_insert_id() |
      +------------------+
      |               79 |
      +------------------+
      1 row in set (0.00 sec)
      

      Attachments

        Activity

          People

            johan.wikman Johan Wikman
            glux Stanislav Petr
            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.