From 7b06c367015e6a7e0b5a00894f18dd3d80fc6892 Mon Sep 17 00:00:00 2001 From: aohana Date: Thu, 19 Sep 2019 16:21:49 +0300 Subject: [PATCH 1/3] Updated QuartzDataSourceInitializerTests.commentPrefixCanBeCustomized to actually use a custom prefix which is not covered by the default: Fixes gh-18275 --- .../quartz/QuartzDataSourceInitializerTests.java | 4 ++-- .../boot/autoconfigure/quartz/tables_**_comments.sql | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzDataSourceInitializerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzDataSourceInitializerTests.java index cd8a7a341161..7afb3c004c27 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzDataSourceInitializerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzDataSourceInitializerTests.java @@ -65,8 +65,8 @@ void doubleDashIsUsedAsACommentPrefixByDefault() { @Test void commentPrefixCanBeCustomized() { this.contextRunner.withUserConfiguration(TestConfiguration.class).withPropertyValues( - "spring.quartz.jdbc.comment-prefix=##", - "spring.quartz.jdbc.schema=classpath:org/springframework/boot/autoconfigure/quartz/tables_@@platform@@.sql") + "spring.quartz.jdbc.comment-prefix=**", + "spring.quartz.jdbc.schema=classpath:org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql") .run(this::assertThatDataSourceHasBeenInitialized); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql new file mode 100644 index 000000000000..d5e17957e633 --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql @@ -0,0 +1,10 @@ +** This is a test script to check ## is treated as a comment prefix when prefix is customized + +CREATE TABLE QRTZ_TEST_TABLE ( + SCHED_NAME VARCHAR(120) NOT NULL, + CALENDAR_NAME VARCHAR (200) NOT NULL +); + +** Another comment + +COMMIT; From 20895052984997e44ee118dd455533ca5ac0f6ef Mon Sep 17 00:00:00 2001 From: aohana Date: Thu, 19 Sep 2019 16:23:27 +0300 Subject: [PATCH 2/3] modified comment message --- .../boot/autoconfigure/quartz/tables_**_comments.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql index d5e17957e633..b9f5428cf2a4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql @@ -1,4 +1,4 @@ -** This is a test script to check ## is treated as a comment prefix when prefix is customized +** This is a test script to check ** is treated as a comment prefix when prefix is customized CREATE TABLE QRTZ_TEST_TABLE ( SCHED_NAME VARCHAR(120) NOT NULL, From 64d8ea58e954d64ddb54e46c3938209713346b4b Mon Sep 17 00:00:00 2001 From: aohana Date: Thu, 19 Sep 2019 17:49:54 +0300 Subject: [PATCH 3/3] deleted tables_h2.sql --- .../boot/autoconfigure/quartz/tables_h2.sql | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_h2.sql diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_h2.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_h2.sql deleted file mode 100644 index 7df6a7840bcf..000000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/quartz/tables_h2.sql +++ /dev/null @@ -1,10 +0,0 @@ -## This is a test script to check custom comment prefix is taken into account - -CREATE TABLE QRTZ_TEST_TABLE ( - SCHED_NAME VARCHAR(120) NOT NULL, - CALENDAR_NAME VARCHAR (200) NOT NULL -); - -## Another comment - -COMMIT;