X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FDBUpgrade2.pm;h=a39ef931b5f275dffd5ed6645facec9ce9d449f5;hb=81fed28305f28aff317639f9a190cdf83a678ed4;hp=be7c54f5bc4619ab8771fa4f471e58fa5fffcbce;hpb=469ca9fc3cac624073270fc3217766dbb7aba253;p=kivitendo-erp.git diff --git a/SL/DBUpgrade2.pm b/SL/DBUpgrade2.pm index be7c54f5b..a39ef931b 100644 --- a/SL/DBUpgrade2.pm +++ b/SL/DBUpgrade2.pm @@ -162,13 +162,25 @@ sub process_query { if (@quote_chars) { if ($char eq $quote_chars[-1]) { pop(@quote_chars); + } elsif (length $quote_chars[-1] > 1 + && substr($_, $i, length $quote_chars[-1]) eq $quote_chars[-1]) { + $i += length $quote_chars[-1] - 1; + $char = $quote_chars[-1]; + pop(@quote_chars); } $query .= $char; } else { + my ($tag, $tag_end); if (($char eq "'") || ($char eq "\"")) { push(@quote_chars, $char); + } elsif ($char eq '$' # start of dollar quoting + && ($tag_end = index($_, '$', $i + 1)) > -1 # ends on same line + && (do { $tag = substr($_, $i + 1, $tag_end - $i - 1); 1 }) # extract tag + && $tag =~ /^ (?= [A-Za-z_] [A-Za-z0-9_]* | ) $/x) { # tag is identifier + push @quote_chars, $char = '$' . $tag . '$'; + $i = $tag_end; } elsif ($char eq ";") { # Query is complete. Send it.