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

MyISAM wrong server status flags




      created after CONJ-948

      Synchronous connectors can rely on OK_Packet/EOF_Packet server status's SERVER_STATUS_IN_TRANS flag that explicitly indicate if a transaction is currently active.

      Java connector use that information to avoid issuing a rollback/commit command, skipping the command if there is no transaction.

      Problem concerns only MyISAM that never set SERVER_STATUS_IN_TRANS flag. Still there is some case when there is some kind of lock : ( example from serg: )

      create table t1 (a int)  engine=myisam;
      insert t1 values (1);

      and in another

      drop table t1;

      this DROP TABLE will wait until the transaction ends.

      • either MyISAM should return SERVER_STATUS_IN_TRANS flag, so connector know there is really a commit to be issued.
      • either MyISAM doesn't set any lock. (It may be just an issue : for some metadata locks are taken on the object name, before the table is opened, before we know it's a MyISAM table.)

      Either way is ok.

      (Another solution would be to always issue a COMMIT/ROLLBACK statement when there is no need, but that would degrade performance dramatically for some application. For example when connections are given back to pools, pools generally issues a connection.rollback() to ensure connection state, and there is lots of application where that command would represent 25% of the commands)


        Issue Links



              serg Sergei Golubchik
              diego dupin Diego Dupin
              0 Vote for this issue
              6 Start watching this issue



                Git Integration

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