Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-4593

MyRocks 8.0 inserts/returns incorrect data for tables with no explicit primary key

    Details

    • Type: Bug
    • Status: Done
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 5.7.22-22, 8.0.x
    • Fix Version/s: 5.7.23-23
    • Component/s: MyRocks
    • Labels:
      None

      Description

      Consider the following table and sequence:

      mysql> CREATE TABLE t1 (a INT, b CHAR(8), KEY(a, b)) ENGINE=rocksdb;
      Query OK, 0 rows affected, 1 warning (0.06 sec)
      
      mysql> SHOW CREATE TABLE t1;
      +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table |
      +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | t1 | CREATE TABLE `t1` (
      `a` int(11) DEFAULT NULL,
      `b` char(8) DEFAULT NULL,
      KEY `a` (`a`,`b`)
      ) ENGINE=ROCKSDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
      +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.00 sec)
      
      mysql> INSERT INTO t1 (a,b) VALUES (76,'bar');
      Query OK, 1 row affected (0.01 sec)
      
      mysql> INSERT INTO t1 (a,b) VALUES (35,'foo');
      Query OK, 1 row affected (0.01 sec)
      
      mysql> INSERT INTO t1 (a,b) VALUES (77,'baz');
      Query OK, 1 row affected (0.01 sec)
      
      mysql> SELECT * FROM t1 WHERE a = 35;
      +------+------+
      | a | b |
      +------+------+
      | 35 | baz |    <<<<< WHAT!?!?! Should be 'foo'
      +------+------+
      1 row in set (0.01 sec)
      
      mysql> select * from t1;
      +------+------+
      | a | b |
      +------+------+
      | 35 | baz |  <<<<<<<< WHAT!?!?!
      | 76 | baz |  <<<<<<<< WHAT!?!?!
      | 77 | baz |
      +------+------+
      3 rows in set (0.00 sec)
      
      

      Notice the bad result data for column 'b'

      This causes the test allow_no_primary_key_with_sk to fail.

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                george.lorch George Lorch
                Reporter:
                george.lorch George Lorch
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 2 hours, 30 minutes
                  2d 2h 30m