From cc8bb44163f2ebe7ea5e6b858bbeaf83ac88bda1 Mon Sep 17 00:00:00 2001 From: Aliaksei Sandryhaila Date: Thu, 2 Aug 2018 11:47:00 -0700 Subject: [PATCH] Check MySQL version when printing rocksdb_bulk_load session variables in mysqldump Summary: As we prepare to migrate to MySQL 8.0, update the check for RockDB support to ensure that dumps from 5.6 can be loaded into 8.0. Adding this patch to 8.0 will also make sure that dumps from 8.0 will enable rocksdb_bulk_load in MyRocks. update-submodule: rocksdb Reviewed By: lth Differential Revision: D9136323 fbshipit-source-id: 3a1cdd0c1c3 --- mysql-test/suite/rocksdb/r/mysqldump.result | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rocksdb/r/mysqldump.result b/mysql-test/suite/rocksdb/r/mysqldump.result index 1cc90c61c018..4e3401ced44f 100644 --- a/mysql-test/suite/rocksdb/r/mysqldump.result +++ b/mysql-test/suite/rocksdb/r/mysqldump.result @@ -34,7 +34,10 @@ update r1 set value1=value1+100 where id1=1 and id2=1 and id3='1'; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -/*!50601 SELECT count(*) INTO @is_rocksdb_supported FROM information_schema.SESSION_VARIABLES WHERE variable_name='rocksdb_bulk_load' */; +/*!50601 SELECT count(*) INTO @is_mysql8 FROM information_schema.TABLES WHERE table_schema='performance_schema' AND table_name='session_variables' */; +/*!50601 SET @check_rocksdb = CONCAT( 'SELECT count(*) INTO @is_rocksdb_supported FROM ', IF (@is_mysql8, 'performance', 'information'), '_schema.session_variables WHERE variable_name=\'rocksdb_bulk_load\'') */; +/*!50601 PREPARE s FROM @check_rocksdb */; +/*!50601 EXECUTE s */; /*!50601 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load=1', 'SET @dummy = 0') */; /*!50601 PREPARE s FROM @enable_bulk_load */; /*!50601 EXECUTE s */;