Commit 09344f72 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

*: use ROCKSDB instead of InnoDB.

parent 2b72878e
......@@ -21,4 +21,4 @@ CREATE TABLE `accounting_transaction` (
PRIMARY KEY (`uid`, `order_id`),
KEY (`section_uid`, `mirror_section_uid`)
-- TODO: keys
) ENGINE=InnoDB
) ENGINE=ROCKSDB
......@@ -1354,7 +1354,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
`uid` BIGINT UNSIGNED NOT NULL,
`dummy_title` varchar(32) NOT NULL default '',
PRIMARY KEY (`uid`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
"""
drop_summy_table_sql = """
DROP TABLE IF EXISTS `dummy`
......@@ -2272,7 +2272,7 @@ CREATE TABLE `%s` (
`owner_reference` varchar(32) NOT NULL default '',
PRIMARY KEY (`uid`),
KEY `version` (`owner_reference`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
""" % local_roles_table
sql_catalog.newContent(
portal_type='SQL Method',
......@@ -2458,7 +2458,7 @@ CREATE TABLE `%s` (
PRIMARY KEY (`uid`),
KEY `assignee_reference` (`assignee_reference`),
KEY `viewable_assignee_reference` (`viewable_assignee_reference`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
""" % local_roles_table
sql_catalog.newContent(
portal_type='SQL Method',
......@@ -2629,7 +2629,7 @@ CREATE TABLE `%s` (
PRIMARY KEY (`uid`),
KEY `assignee_reference` (`assignee_reference`),
KEY `viewable_assignee_reference` (`viewable_assignee_reference`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
""" % local_roles_table
sql_catalog.newContent(
portal_type='SQL Method',
......@@ -2893,7 +2893,7 @@ CREATE TABLE `%s` (
`viewable_assignee_reference` varchar(32) NOT NULL default '',
PRIMARY KEY (`uid`),
KEY `viewable_assignee_reference` (`viewable_assignee_reference`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
""" % local_roles_table
sql_catalog.newContent(
portal_type='SQL Method',
......@@ -3127,7 +3127,7 @@ CREATE TABLE `%s` (
`viewable_assignee_reference` varchar(32) NOT NULL default '',
PRIMARY KEY (`uid`),
KEY `viewable_assignee_reference` (`viewable_assignee_reference`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
""" % local_roles_table
sql_catalog.newContent(
portal_type='SQL Method',
......
......@@ -4,4 +4,4 @@ CREATE TABLE `crawler` (
`creation_date_index` INT,
PRIMARY KEY (`uid`),
KEY `creation_date_index` (`creation_date_index`, `frequency_index`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -13,4 +13,4 @@ CREATE TABLE `email_thread` (
KEY `bcc_recipient` (`bcc_recipient`),
KEY `validation_state` (`validation_state`),
KEY `start_date` (`start_date`, `validation_state`)
) ENGINE=InnoDB;
\ No newline at end of file
) ENGINE=ROCKSDB;
\ No newline at end of file
......@@ -6,4 +6,4 @@ CREATE TABLE `full_text` (
`uid` BIGINT UNSIGNED NOT NULL,
`SearchableText` MEDIUMTEXT,
PRIMARY KEY (`uid`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -3,4 +3,4 @@ CREATE TABLE `email` (
`url_string` varchar(255),
PRIMARY KEY `uid` (`uid`),
KEY `url_string` (`url_string`)
) ENGINE=InnoDB;
\ No newline at end of file
) ENGINE=ROCKSDB;
\ No newline at end of file
......@@ -22,4 +22,4 @@ CREATE TABLE `movement` (
KEY `resource_uid` (`resource_uid`),
KEY `is_accountable` (`is_accountable`),
KEY `variation_text` (`variation_text`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -2,4 +2,4 @@ CREATE TABLE reporting_outcome (
uid BIGINT UNSIGNED NOT NULL,
outcome_description VARCHAR(255),
PRIMARY KEY `uid` (`uid`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -5,4 +5,4 @@ CREATE TABLE roles_and_users (
KEY `uid` (`uid`),
KEY `allowedRolesAndUsers` (`allowedRolesAndUsers`),
KEY `local_roles_group_id` (`local_roles_group_id`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -4,4 +4,4 @@ Create table `inventory_cache` (
`result` LONGBLOB NOT NULL,
PRIMARY KEY (`query`, `date`),
KEY (`date`)
) Engine=InnoDB
\ No newline at end of file
) Engine=ROCKSDB
\ No newline at end of file
......@@ -4,4 +4,4 @@ CREATE TABLE `syncml` (
`data` LONGBLOB NULL,
PRIMARY KEY (`path`),
KEY `gid` (`gid`,`path`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -30,4 +30,4 @@ CREATE TABLE `worklist_cache` (
KEY `portal_simulation_owner` (`portal_type`, `simulation_state`, `viewable_owner`),
KEY `portal_validation_security` (`portal_type`, `validation_state`, `security_uid`),
KEY `portal_validation_owner` (`portal_type`, `validation_state`, `viewable_owner`)
) ENGINE=InnoDB
\ No newline at end of file
) ENGINE=ROCKSDB
\ No newline at end of file
......@@ -2,4 +2,4 @@ CREATE TABLE `portal_ids` (
`id_group` VARBINARY(255),
`last_id` BIGINT UNSIGNED,
PRIMARY KEY (`id_group`)
) ENGINE=InnoDB;
\ No newline at end of file
) ENGINE=ROCKSDB;
\ No newline at end of file
......@@ -2,7 +2,7 @@ CREATE TABLE `portal_ids` (
`id_group` VARBINARY(255),
`last_id` BIGINT UNSIGNED,
PRIMARY KEY (`id_group`)
) ENGINE=InnoDB
) ENGINE=ROCKSDB
<dtml-var sql_delimiter>
<dtml-in expr="getPortalObject().portal_ids.getDictLengthIdsItems()">
INSERT INTO `portal_ids` (`id_group`, `last_id`) VALUES (<dtml-sqlvar sequence-key type="string">, <dtml-sqlvar sequence-item type="int">)
......
......@@ -6,4 +6,4 @@ CREATE TABLE `alarm` (
`uid` BIGINT UNSIGNED NOT NULL,
`alarm_date` DATETIME,
PRIMARY KEY (`uid`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -54,4 +54,4 @@ CREATE TABLE `catalog` (
KEY `invoice_state` (`invoice_state`),
KEY `payment_state` (`payment_state`),
KEY `event_state` (`event_state`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -9,4 +9,4 @@ CREATE TABLE `category` (
`category_strict_membership` tinyint(1) default '0',
PRIMARY KEY (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),
KEY `Membership` (`category_uid`,`base_category_uid`)
) ENGINE=InnoDB;
\ No newline at end of file
) ENGINE=ROCKSDB;
\ No newline at end of file
......@@ -18,4 +18,4 @@ CREATE TABLE `delivery` (
KEY `destination_section_uid` (`destination_section_uid`),
KEY `resource_uid` (`resource_uid`),
KEY `start_date` (`start_date`)
) ENGINE=InnoDB
) ENGINE=ROCKSDB
......@@ -18,4 +18,4 @@ CREATE TABLE `item` (
KEY `variation_text` (`variation_text`),
KEY `aggregate_simulation_state_date` (`aggregate_uid`,`simulation_state`,`date`),
KEY `node_simulation_state_date` (`node_uid`,`simulation_state`,`date`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -6,4 +6,4 @@ CREATE TABLE `measure` (
`quantity` REAL NOT NULL,
PRIMARY KEY (`uid`, `variation`),
KEY (`metric_type_uid`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -7,4 +7,4 @@ CREATE TABLE predicate (
`start_date_range_min` datetime ,
`start_date_range_max` datetime ,
PRIMARY KEY `uid` (`uid`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -10,4 +10,4 @@ CREATE TABLE `predicate_category` (
PRIMARY KEY (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),
KEY `category_strict_membership` (`category_strict_membership`),
KEY `Membership` (`category_uid`,`base_category_uid`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -5,4 +5,4 @@ CREATE TABLE `quantity_unit_conversion` (
`quantity` REAL NOT NULL,
PRIMARY KEY (`resource_uid`, `quantity_unit_uid`),
KEY (`uid`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -11,4 +11,4 @@ CREATE TABLE `record` (
PRIMARY KEY (`uid`),
KEY `played` (`played`),
KEY `date` (`date`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -3,4 +3,4 @@ CREATE TABLE roles_and_users (
allowedRolesAndUsers VARCHAR(255),
KEY `uid` (`uid`),
KEY `allowedRolesAndUsers` (`allowedRolesAndUsers`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -44,4 +44,4 @@ CREATE TABLE `stock` (
KEY `resource_node_uid` (`resource_uid`, `node_uid`),
KEY `resource_section_node_uid` (`resource_uid`, `section_uid`, `node_uid`, `simulation_state`),
KEY `date` (`date`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -3,4 +3,4 @@ CREATE TABLE subject (
subject VARCHAR(255),
KEY `subject_set_uid` (`subject_set_uid`),
KEY `subject` (`subject`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -6,4 +6,4 @@ CREATE TABLE `transformation` (
`quantity` double,
KEY `resource` (`uid`, `variation_text`),
KEY `transformed_resource` (`transformed_uid`, `transformed_variation_text`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -7,4 +7,4 @@ CREATE TABLE translation (
KEY `message` (`translated_message`),
KEY `original_message` (`original_message`),
KEY `type_translated_message` (`portal_type`,`translated_message`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -3,4 +3,4 @@ CREATE TABLE `user` (
`user_id` varchar(255) binary default '',
PRIMARY KEY (`uid`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -16,4 +16,4 @@ CREATE TABLE `versioning` (
KEY `effective_date` (`effective_date`),
KEY `expiration_date` (`expiration_date`),
KEY `frequency_index` (`creation_date_index`, `frequency_index`)
) ENGINE=InnoDB;
) ENGINE=ROCKSDB;
......@@ -66,13 +66,13 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent(
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
self.query("SELECT a, b FROM X")
def test_remove_column(self):
......@@ -82,12 +82,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent(
"""\
CREATE TABLE `X` (
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
self.query("SELECT b FROM X")
with self.assertRaisesRegex(OperationalError,
"Unknown column 'a' in 'field list'"):
......@@ -99,12 +99,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent(
"""\
CREATE TABLE `X` (
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
self.query("SELECT b FROM X")
with self.assertRaisesRegex(OperationalError,
"Unknown column 'a' in 'field list'"):
......@@ -116,12 +116,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\
CREATE TABLE `X` (
`a` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent(
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
# insterting '1' will be casted as int
self.query("INSERT INTO X VALUES ('1')")
self.assertEqual((1,), self.query("SELECT a FROM X")[1][0])
......@@ -132,12 +132,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent(
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT 123
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
self.query("INSERT INTO X VALUES ()")
self.assertEqual((123,), self.query("SELECT a FROM X")[1][0])
......@@ -147,12 +147,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\
CREATE TABLE `X` (
`a` int(11) NOT NULL COMMENT 'old comment'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent(
"""\
CREATE TABLE `X` (
`a` int(11) NOT NULL COMMENT 'new comment'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
self.assertEqual(
('a', 'new comment'),
self.query(
......@@ -170,13 +170,13 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent(
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL,
KEY `idx_a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
self.query("SELECT * FROM X USE INDEX (`idx_a`)")
def test_remove_index(self):
......@@ -186,12 +186,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL,
KEY `idx_a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent(
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
with self.assertRaisesRegex(OperationalError,
"Key 'idx_a' doesn't exist in table 'X'"):
self.query("SELECT * FROM X USE INDEX (`idx_a`)")
......@@ -204,14 +204,14 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
`drop` int(11) DEFAULT NULL,
`alter` int(11) DEFAULT NULL,
KEY `CASE` (`drop`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent(
"""\
CREATE TABLE `table` (
`and` int(11) DEFAULT NULL,
`alter` varchar(255) CHARACTER SET cp1250 COLLATE cp1250_croatian_ci DEFAULT 'BETWEEN',
KEY `use` (`alter`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
table_name='table')
self.query(
"SELECT `alter`, `and` FROM `table` USE INDEX (`use`)")
......@@ -227,9 +227,9 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
self.assertEqual(
('X', 'InnoDB'),
('X', 'ROCKSDB'),
self.query(
dedent(
"""\
......@@ -245,12 +245,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='old comment'"""),
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='old comment'"""),
dedent(
"""\
CREATE TABLE `X` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='new comment'"""))
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='new comment'"""))
self.assertEqual(
('X', 'new comment'),
self.query(
......
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