From 55ca2bc8958aa9cc59a8bef0aa1c744e6678b318 Mon Sep 17 00:00:00 2001 From: Michael Minella Date: Fri, 15 May 2015 16:13:00 -0500 Subject: [PATCH] Changed MySql engines to all be InnoDB InnoDB is the only option for transactional tables in MySql. This change makes all the table definitions consistent (there previously were a few that were MyISAM). BATCH-2373 --- .../org/springframework/batch/core/schema-mysql.sql | 6 +++--- spring-batch-core/src/main/sql/mysql.vpp | 2 +- src/site/docbook/reference/schema-appendix.xml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-mysql.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-mysql.sql index 0d7cea879..5bd10960e 100644 --- a/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-mysql.sql +++ b/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-mysql.sql @@ -80,7 +80,7 @@ CREATE TABLE BATCH_STEP_EXECUTION_SEQ ( ID BIGINT NOT NULL, UNIQUE_KEY CHAR(1) NOT NULL, constraint UNIQUE_KEY_UN unique (UNIQUE_KEY) -) ENGINE=MYISAM; +) ENGINE=InnoDB; INSERT INTO BATCH_STEP_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_STEP_EXECUTION_SEQ); @@ -88,7 +88,7 @@ CREATE TABLE BATCH_JOB_EXECUTION_SEQ ( ID BIGINT NOT NULL, UNIQUE_KEY CHAR(1) NOT NULL, constraint UNIQUE_KEY_UN unique (UNIQUE_KEY) -) ENGINE=MYISAM; +) ENGINE=InnoDB; INSERT INTO BATCH_JOB_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_EXECUTION_SEQ); @@ -96,6 +96,6 @@ CREATE TABLE BATCH_JOB_SEQ ( ID BIGINT NOT NULL, UNIQUE_KEY CHAR(1) NOT NULL, constraint UNIQUE_KEY_UN unique (UNIQUE_KEY) -) ENGINE=MYISAM; +) ENGINE=InnoDB; INSERT INTO BATCH_JOB_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_SEQ); diff --git a/spring-batch-core/src/main/sql/mysql.vpp b/spring-batch-core/src/main/sql/mysql.vpp index 084565f76..aca424394 100644 --- a/spring-batch-core/src/main/sql/mysql.vpp +++ b/spring-batch-core/src/main/sql/mysql.vpp @@ -1,6 +1,6 @@ #macro (sequence $name $value)CREATE TABLE ${name} (ID BIGINT NOT NULL, UNIQUE_KEY CHAR(1) NOT NULL, - constraint ${name}_UN unique (UNIQUE_KEY)) ENGINE=MYISAM; + constraint ${name}_UN unique (UNIQUE_KEY)) ENGINE=InnoDB; INSERT INTO ${name} (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from ${name}); #end #macro (notnull $name $type)MODIFY COLUMN ${name} ${type} NOT NULL#end diff --git a/src/site/docbook/reference/schema-appendix.xml b/src/site/docbook/reference/schema-appendix.xml index d9f0f8f10..786084519 100644 --- a/src/site/docbook/reference/schema-appendix.xml +++ b/src/site/docbook/reference/schema-appendix.xml @@ -86,11 +86,11 @@ CREATE SEQUENCE BATCH_JOB_SEQ; Many database vendors don't support sequences. In these cases, work-arounds are used, such as the following for MySQL: - CREATE TABLE BATCH_STEP_EXECUTION_SEQ (ID BIGINT NOT NULL) type=MYISAM; + CREATE TABLE BATCH_STEP_EXECUTION_SEQ (ID BIGINT NOT NULL) type=InnoDB; INSERT INTO BATCH_STEP_EXECUTION_SEQ values(0); -CREATE TABLE BATCH_JOB_EXECUTION_SEQ (ID BIGINT NOT NULL) type=MYISAM; +CREATE TABLE BATCH_JOB_EXECUTION_SEQ (ID BIGINT NOT NULL) type=InnoDB; INSERT INTO BATCH_JOB_EXECUTION_SEQ values(0); -CREATE TABLE BATCH_JOB_SEQ (ID BIGINT NOT NULL) type=MYISAM; +CREATE TABLE BATCH_JOB_SEQ (ID BIGINT NOT NULL) type=InnoDB; INSERT INTO BATCH_JOB_SEQ values(0); In the above case, a table is used in place of each sequence. The