Uploaded image for project: 'MyRocks'
  1. MyRocks
  2. MYR-152

the json binary value contains invalid data

    Details

      Description

      Getting some error when trying to select already inserted data into table with json data type:
      INNODB:

      mysql> drop table if exists t2_innodb;
      Query OK, 0 rows affected, 1 warning (0.00 sec)
      
      mysql> create table t2_innodb (a date, b json, primary key(a)) engine=innodb;
      Query OK, 0 rows affected (0.04 sec)
      
      mysql> INSERT INTO t2_innodb values ('1999-04-10', '{"name": "Barbara Clements", "company": "Wilson-Jones"}');
      Query OK, 1 row affected (0.00 sec)
      
      mysql> INSERT INTO t2_innodb values ('2013-03-17', '{"name": "David Alvarez", "company": "Livingston, Cooper and Morse"}');
      Query OK, 1 row affected (0.00 sec)
      
      mysql> select * from t2_innodb;
      +------------+----------------------------------------------------------------------+
      | a          | b                                                                    |
      +------------+----------------------------------------------------------------------+
      | 1999-04-10 | {"name": "Barbara Clements", "company": "Wilson-Jones"}              |
      | 2013-03-17 | {"name": "David Alvarez", "company": "Livingston, Cooper and Morse"} |
      +------------+----------------------------------------------------------------------+
      2 rows in set (0.00 sec)
      

      ROCKSDB:

      mysql> drop table if exists t2_rocksdb;
      Query OK, 0 rows affected (0.01 sec)
      
      mysql> create table t2_rocksdb (a date, b json, primary key(a)) engine=rocksdb;
      Query OK, 0 rows affected (0.01 sec)
      
      mysql> INSERT INTO t2_rocksdb values ('1999-04-10', '{"name": "Barbara Clements", "company": "Wilson-Jones"}');
      Query OK, 1 row affected (0.00 sec)
      
      mysql> INSERT INTO t2_rocksdb values ('2013-03-17', '{"name": "David Alvarez", "company": "Livingston, Cooper and Morse"}');
      Query OK, 1 row affected (0.00 sec)
      
      mysql> select * from t2_rocksdb;
      ERROR 3142 (HY000): The JSON binary value contains invalid data.
      
      mysql> select a from t2_rocksdb;
      +------------+
      | a          |
      +------------+
      | 1999-04-10 |
      | 2013-03-17 |
      +------------+
      2 rows in set (0.00 sec)
      
      mysql> select b from t2_rocksdb;
      ERROR 3142 (HY000): The JSON binary value contains invalid data.
      

      DISCLAIMER: I did not play too much with mysql json data type, I see there are different ways of inserting data in the manual but didn't have time now to check more so I'll investigate a bit more later, but since there's a difference between how innodb handles this I guess it can be a bug.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                george.lorch George Lorch
                Reporter:
                tomislav.plavcic@percona.com Tomislav Plavcic
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: