Commit f2f44cd5 authored by Julien Muchembled's avatar Julien Muchembled

mysql: add support for RocksDB

parent 069dd583
...@@ -49,7 +49,7 @@ class MySQLDatabaseManager(DatabaseManager): ...@@ -49,7 +49,7 @@ class MySQLDatabaseManager(DatabaseManager):
"""This class manages a database on MySQL.""" """This class manages a database on MySQL."""
VERSION = 1 VERSION = 1
ENGINES = "InnoDB", "TokuDB" ENGINES = "InnoDB", "RocksDB", "TokuDB"
_engine = ENGINES[0] # default engine _engine = ENGINES[0] # default engine
# Disabled even on MySQL 5.1-5.5 and MariaDB 5.2-5.3 because # Disabled even on MySQL 5.1-5.5 and MariaDB 5.2-5.3 because
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest import unittest
from MySQLdb import OperationalError from MySQLdb import NotSupportedError, OperationalError
from MySQLdb.constants.ER import UNKNOWN_STORAGE_ENGINE
from ..mock import Mock from ..mock import Mock
from neo.lib.exception import DatabaseFailure from neo.lib.exception import DatabaseFailure
from neo.lib.util import p64 from neo.lib.util import p64
...@@ -35,7 +36,13 @@ class StorageMySQLdbTests(StorageDBTests): ...@@ -35,7 +36,13 @@ class StorageMySQLdbTests(StorageDBTests):
db = MySQLDatabaseManager(database, self.engine) db = MySQLDatabaseManager(database, self.engine)
self.assertEqual(db.db, DB_PREFIX + '0') self.assertEqual(db.db, DB_PREFIX + '0')
self.assertEqual(db.user, DB_USER) self.assertEqual(db.user, DB_USER)
try:
db.setup(reset) db.setup(reset)
except NotSupportedError as m:
code, m = m.args
if code != UNKNOWN_STORAGE_ENGINE:
raise
raise unittest.SkipTest(m)
return db return db
def test_query1(self): def test_query1(self):
...@@ -119,6 +126,11 @@ class StorageMySQLdbTests(StorageDBTests): ...@@ -119,6 +126,11 @@ class StorageMySQLdbTests(StorageDBTests):
self.assertEqual(len(query_list), count) self.assertEqual(len(query_list), count)
class StorageMySQLdbRocksDBTests(StorageMySQLdbTests):
engine = "RocksDB"
class StorageMySQLdbTokuDBTests(StorageMySQLdbTests): class StorageMySQLdbTokuDBTests(StorageMySQLdbTests):
engine = "TokuDB" engine = "TokuDB"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment