nonstring : /[^;\'"]+/
-statement_body : (string | nonstring)(s?)
+statement_body : string | nonstring
-insert : /insert/i statement_body "$delimiter"
+insert : /insert/i statement_body(s?) "$delimiter"
delimiter : /delimiter/i /[\S]+/
{ $delimiter = $item[2] }
{
@table_comments = ();
my $view_name = $item[5];
- my $sql = join(q{ }, grep { length } $item[1], $item[2]->[0], $item[3]->[0])
+ my $sql = join(q{ }, grep { defined and length } $item[1], $item[2]->[0], $item[3]->[0])
. " $item[4] $item[5] $item[6]";
# Hack to strip database from function calls in SQL
nonstring : /[^;\'"]+/
-statement_body : (string | nonstring)(s?)
+statement_body : string | nonstring
-insert : /insert/i statement_body ';'
+insert : /insert/i statement_body(s?) ';'
-update : /update/i statement_body ';'
+update : /update/i statement_body(s?) ';'
#
# Create table.
nonstring : /[^;\'"]+/
-statement_body : (string | nonstring)(s?)
+statement_body : string | nonstring
-trigger_step : /(select|delete|insert|update)/i statement_body SEMICOLON
+trigger_step : /(select|delete|insert|update)/i statement_body(s?) SEMICOLON
{
$return = join( ' ', $item[1], join ' ', @{ $item[2] || [] } )
}