cppcms-skeleton icon indicating copy to clipboard operation
cppcms-skeleton copied to clipboard

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

Open allan-simon opened this issue 12 years ago • 0 comments

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 

allan-simon avatar Jan 10 '13 19:01 allan-simon