Given a string, returns all the individual SQL statements in that String
as an Array.
-
=cut
sub _split_line_into_statements {
|
'[^']+'
|
- .+?(?=$deliminator)
+ .+?(?=$deliminator|.)
/x;
return ($line=~m/$maybe_quoted*?$deliminator/g);
}
-
=head2 _normalize_statements_from_lines
my @statements = $storage->_normalize_statements_from_lines(@lines)
"Correctly split";
is_deeply [$storage->_split_line_into_statements("insert into artist(artistid,name) values(888888,'xxx;yyy;zzz');")],
- ["insert into artist(artistid,name) values(888888,'xxx;yyy;zzz');"],
+ ["insert into artist(artistid,name) values(888888,'xxx;yyy;zzz');",""],
"Correctly split";
ok my @lines = $storage->_normalize_lines(<$fh>), 'Got some lines';
ok $storage->run_file_against_storage(qw/t share simple.sql/), 'executed the simple';
ok $storage->run_file_against_storage(qw/t share killer.sql/), 'executed the killer';
-use Data::Dump qw/dump/;
-warn dump $storage->_split_line_into_statements("insert into artist(artistid,name) values(888888,'xxx;yyy;zzz');");