From 4faa9da81c00725dfe8c36e01cf15414918eb1f3 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 27 Dec 2016 01:55:05 +0300 Subject: [PATCH] MariaRocks port: Make SQL layer allow errors in start_consistent_snapshot(). rocksdb.cons_snapshot_read_committed test used to crash. This happened, because - MyRocks produces an error when one attempts to do a START TRANSACTION WITH CONSISTENT SNAPSHOT with @@tx_isolation=REPEATABLE_READ - MariaDB's SQL layer didn't assume that errors are possible inside hton->start_constistent_snapshot() call. --- sql/sql_parse.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ac00b21c837..e415b275fff 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5428,7 +5428,9 @@ end_with_restore_list: (longlong) thd->thread_id); goto error; } - my_ok(thd); + /* MyRocks: hton->start_consistent_snapshot call may fail with an error */ + if (!thd->is_error()) + my_ok(thd); break; case SQLCOM_COMMIT: {