Skip to content

Support # in addition to -- as a default comment prefix for Quartz DataSource initialization #17435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
abccbaandy opened this issue Jul 5, 2019 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@abccbaandy
Copy link

spring boot version : 2.1.6.RELEASE
spring-boot-starter-quartz

quartz-scheduler/quartz#262 (comment)

maybe spring.quartz.jdbc.comment-prefix=# should be default?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 5, 2019
@wilkinsona
Copy link
Member

The comment prefix is set to -- by default. We can’t change it to # as that will be a breaking change for those relying on it being --. If you require a different comment prefix you will have to configure it. Please see #13160 and #13041 for details.

That said, I wonder if we can do better here. Perhaps we could automatically use a different comment prefix based on the database that is being used.

@wilkinsona wilkinsona changed the title init sql script running error if have not specify the comment-prefix Quartz init sql script that uses #-prefixed comments fails without additional configuration Jul 5, 2019
@philwebb
Copy link
Member

I think we also have the same problem with DataSourceInitializer, although it looks like we don't offer a property for setCommentPrefix there.

@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Jul 10, 2019
@wilkinsona
Copy link
Member

A small difference between the two is that the scripts used by DataSourceInitializer are typically written by the user and are only intended to be consumed by Boot rather than also by the database itself. That means they can use -- (the SQL standard) and it should always work.

In the Quartz case, the scripts are out of the users control and were, I imagine, primarily written to be read by the database itself rather than a tool like Boot's DataSource initialization. This is not to say that there's no problem with DataSourceInitializer, but I do think it's less likely to be problematic.

@philwebb philwebb self-assigned this Jul 12, 2019
@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Jul 12, 2019
@philwebb
Copy link
Member

I've submitted a PR to framework that will allow us to support both prefixes spring-projects/spring-framework#23289

@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 14, 2019
@philwebb philwebb added this to the 2.2.x milestone Jul 14, 2019
@philwebb philwebb added status: blocked An issue that's blocked on an external project change and removed status: blocked An issue that's blocked on an external project change labels Jul 14, 2019
@philwebb philwebb removed their assignment Sep 18, 2019
@wilkinsona wilkinsona changed the title Quartz init sql script that uses #-prefixed comments fails without additional configuration Support # and -- as default comment prefixes for Quartz DataSource initialization Sep 18, 2019
@wilkinsona wilkinsona self-assigned this Sep 18, 2019
@wilkinsona wilkinsona changed the title Support # and -- as default comment prefixes for Quartz DataSource initialization Support # in addition toand -- as default comment prefixes for Quartz DataSource initialization Sep 18, 2019
@wilkinsona wilkinsona changed the title Support # in addition toand -- as default comment prefixes for Quartz DataSource initialization Support # in addition to -- as a default comment prefix for Quartz DataSource initialization Sep 18, 2019
@wilkinsona wilkinsona modified the milestones: 2.2.x, 2.2.0.RC1 Sep 18, 2019
pull bot pushed a commit to scope-demo/spring-boot that referenced this issue Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants