Skip to content
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

NamedParameterUtils broken parsing related to square brackets #31596

Closed
jeffgbutler opened this issue Nov 13, 2023 · 0 comments
Closed

NamedParameterUtils broken parsing related to square brackets #31596

jeffgbutler opened this issue Nov 13, 2023 · 0 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: regression A bug that is also a regression
Milestone

Comments

@jeffgbutler
Copy link

jeffgbutler commented Nov 13, 2023

Using Spring JDBC 6.0.13, the following unit test will fail:

    @Test
    void testSquareBrackets() {
        String sql = "insert into GeneratedAlways (id, first_name, last_name) values " +
                "(:records[0].id, :records[0].firstName, :records[0].lastName), " +
                "(:records[1].id, :records[1].firstName, :records[1].lastName)";

        ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql);
        assertThat(parsedSql.getParameterNames()).containsOnly(
                "records[0].id", "records[0].firstName", "records[0].lastName",
                "records[1].id", "records[1].firstName", "records[1].lastName");
    }

This was not an issue in Spring JDBC 5.3.30.

This appears to be related to #17773 and #27925

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 13, 2023
@jhoeller jhoeller added in: data Issues in data modules (jdbc, orm, oxm, tx) type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 13, 2023
@jhoeller jhoeller self-assigned this Nov 13, 2023
@jhoeller jhoeller added this to the 6.0.14 milestone Nov 13, 2023
@sbrannen sbrannen changed the title NamedParameterUtils Broken Parsing Related to Square Brackets NamedParameterUtils broken parsing related to square brackets Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants