Skip to content

Commit

Permalink
MDEV-15245: Assertion `false' failed in myrocks::ha_rocksdb::position
Browse files Browse the repository at this point in the history
Don't call handler->position() if the last call to read a row did
not succeed.
  • Loading branch information
spetrunia committed Mar 11, 2018
1 parent 112df06 commit 2877704
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sql/sql_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18724,7 +18724,7 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
skip_over= FALSE;
}

if (join_tab->keep_current_rowid)
if (join_tab->keep_current_rowid && !error)
join_tab->table->file->position(join_tab->table->record[0]);

rc= evaluate_join_record(join, join_tab, error);
Expand Down
14 changes: 14 additions & 0 deletions storage/rocksdb/mysql-test/rocksdb/r/rocksdb_parts.result
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,17 @@ SELECT 1;
1
1
DROP TABLE t1;
#
# MDEV-15245: Assertion `false' failed in myrocks::ha_rocksdb::position
#
CREATE TABLE t1 (a INT) ENGINE=RocksDB;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT) ENGINE=RocksDB
PARTITION BY RANGE(b)
(PARTITION p0 VALUES LESS THAN (1),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t2 VALUES (NULL),(0);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.* FROM t1, t2;
UPDATE v1 SET b = 5;
drop view v1;
drop table t1,t2;
19 changes: 19 additions & 0 deletions storage/rocksdb/mysql-test/rocksdb/t/rocksdb_parts.test
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,22 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
SELECT 1;
DROP TABLE t1;

--echo #
--echo # MDEV-15245: Assertion `false' failed in myrocks::ha_rocksdb::position
--echo #
CREATE TABLE t1 (a INT) ENGINE=RocksDB;
INSERT INTO t1 VALUES (1),(2);
# partitioning
CREATE TABLE t2 (b INT) ENGINE=RocksDB
PARTITION BY RANGE(b)
(PARTITION p0 VALUES LESS THAN (1),
PARTITION p1 VALUES LESS THAN MAXVALUE);


INSERT INTO t2 VALUES (NULL),(0);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.* FROM t1, t2;
UPDATE v1 SET b = 5;

drop view v1;
drop table t1,t2;

0 comments on commit 2877704

Please sign in to comment.