From c6605d02bc188cf919a29ad01a6eb3a0c9abcb76 Mon Sep 17 00:00:00 2001 From: John Eckhart Date: Sun, 29 Mar 2015 12:28:51 -0400 Subject: [PATCH] Add tests for CREATE TABLE with KEY statement --- .../mysql2h2converter/converter/ConverterTest.java | 5 +++++ .../test/resources/scripts/create-table-with-key.sql | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 converter/src/test/resources/scripts/create-table-with-key.sql diff --git a/converter/src/test/java/com/granveaud/mysql2h2converter/converter/ConverterTest.java b/converter/src/test/java/com/granveaud/mysql2h2converter/converter/ConverterTest.java index cebfb46..fbcec3f 100644 --- a/converter/src/test/java/com/granveaud/mysql2h2converter/converter/ConverterTest.java +++ b/converter/src/test/java/com/granveaud/mysql2h2converter/converter/ConverterTest.java @@ -136,6 +136,11 @@ public void testScript5() throws Exception { loadScript("xwiki-sqlyog.sql"); } + @Test + public void testScriptCreateTableWithKey() throws Exception { + loadScript("create-table-with-key.sql"); + } + private void loadScript(String s) throws Exception { long time0 = System.currentTimeMillis(); diff --git a/converter/src/test/resources/scripts/create-table-with-key.sql b/converter/src/test/resources/scripts/create-table-with-key.sql new file mode 100644 index 0000000..521728c --- /dev/null +++ b/converter/src/test/resources/scripts/create-table-with-key.sql @@ -0,0 +1,10 @@ + +CREATE TABLE `sample` ( + `ID` bigint(20) NOT NULL AUTO_INCREMENT, + `VALUE` text, + `TIME` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `version` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`), + UNIQUE KEY `PK_SAMPLE` (`ID`), + KEY `TIME` (`TIME`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='A sample table.';