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

[Bug]: script splitting fails when script contains semicolons in backquote-enquoted strings #8592

Closed
peterhalicky opened this issue May 3, 2024 · 1 comment
Labels

Comments

@peterhalicky
Copy link
Contributor

Module

Core

Testcontainers version

1.17.2

Using the latest Testcontainers version?

Yes

Host OS

MacOS

Host Arch

ARM

Docker version

Not relevant.

What happened?

I have a SQL script with the following statement:

create table `form;3`
(
    id           varchar(100),
    `first;name` varchar(100),
    `last;name`  varchar(100),
    primary key (id)
);

ScriptSplitter breaks this into multiple statements. Version 1.17.1 was not splitting it up, i.e. it remained a single statement.

Relevant log output

No response

Additional Information

Failing unit test:

    @Test
    public void testBacktickEnquotedSemicolon() {
        String script =
            "CREATE TABLE `bar;bar` (\n" +
            "  end_time VARCHAR(255)\n" +
            ");";

        List<String> expected = Arrays.asList(
            "CREATE TABLE `bar;bar` ( end_time VARCHAR(255) )"
        );

        splitAndCompare(script, expected);
    }
@eddumelendez
Copy link
Member

Fixed by #8593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants