Skip to content

The import_sql_file function will ignore everything after the last ; or everything if no ; #8

@allan-simon

Description

@allan-simon

Due to a workaround for the method create_statement of cppdb that will launch an exception if you're trying to execute a statement containing nothing executable (i.e comments or EOF or set of spaces ) we're splitting the file on the ";" separator and we will not execute what's after the last one

In most of case that should not be a problem but it may be problematics in these two cases

CREATE table foo ( bar integer ) -- no final semicolon so it will not be executed
   INSERT INTO foo VALUES (2);
   TRESNI INTO foo VALUES(3) -- no final semicolon so it's not executed, and we're not seeing we've made a typo 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions