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

RocksDB ROW_COUNT() after UPDATE always 1, even if the data has not changed.

Details

    Description

      In MariaDB 10.3.16 on ROCKSDB engine ROW_COUNT() return always 1 (not 0), after UPDETE, when data not changed.
      In InnoDB always returns 0 if the data has not changed.

      DROP TABLE IF EXISTS `test`;
       
      CREATE TABLE `test`
      (
      	`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
      	`status` TINYINT UNSIGNED NOT NULL,
      	KEY(`status`)
      )
      ENGINE=ROCKSDB CHARACTER SET utf8 COLLATE utf8_general_ci;
       
      INSERT INTO `test`(`id`,`status`) VALUES (1,1),(2,2),(3,3);
       
      UPDATE `test` SET `status`=2 WHERE `id`=2;
       
      SELECT ROW_COUNT();

      Attachments

        Activity

          alice Alice Sherepa added a comment -

          Thanks for the report! Repeatable on 10.2-10.4:

          --source include/have_rocksdb.inc
          create table t1 ( id int , status int) engine=rocksdb;
          insert into t1(id,status) values (1,1),(2,2),(2,2),(2,2);
          update t1 set status=2 where id=2;
          select row_count();
           
          alter table t1 engine=myisam;
          update t1 set status=2 where id=2;
          select row_count();
          drop table t1;
          

          update t1 set status=2 where id=2;
          select row_count();
          row_count()
          3
          alter table t1 engine=myisam;
          update t1 set status=2 where id=2;
          select row_count();
          row_count()
          0
          

          alice Alice Sherepa added a comment - Thanks for the report! Repeatable on 10.2-10.4: --source include/have_rocksdb.inc create table t1 ( id int , status int ) engine=rocksdb; insert into t1(id,status) values (1,1),(2,2),(2,2),(2,2); update t1 set status=2 where id=2; select row_count();   alter table t1 engine=myisam; update t1 set status=2 where id=2; select row_count(); drop table t1; update t1 set status=2 where id=2; select row_count(); row_count() 3 alter table t1 engine=myisam; update t1 set status=2 where id=2; select row_count(); row_count() 0

          Hello!
          If there is any progress in this bug?
          Can we expect its elimination in 10.5?
          Is this the original problem of the MyRocks engine itself, or is it a flaw in MariaDB?

          ilya Илья Индиго added a comment - Hello! If there is any progress in this bug? Can we expect its elimination in 10.5? Is this the original problem of the MyRocks engine itself, or is it a flaw in MariaDB?

          People

            psergei Sergei Petrunia
            ilya Илья Индиго
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.