X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDBUpgrade2%2FBase.pm;h=2c1e111140cc63d25d15294c3f5f05e92aedba74;hb=1264cff68a2e27855c34fc2e00e1f6724ab004f4;hp=09e4e5fff31c7d41d79872b97f3a8604c060c405;hpb=9466e9e0f60af5142b7afbdea1e17b3313881201;p=kivitendo-erp.git diff --git a/SL/DBUpgrade2/Base.pm b/SL/DBUpgrade2/Base.pm index 09e4e5fff..2c1e11114 100644 --- a/SL/DBUpgrade2/Base.pm +++ b/SL/DBUpgrade2/Base.pm @@ -41,11 +41,11 @@ sub db_error { } sub db_query { - my ($self, $query, $may_fail) = @_; + my ($self, $query, %params) = @_; - return if $self->dbh->do($query); + return if $self->dbh->do($query, undef, @{ $params{bind} || [] }); - $self->db_error($query) unless $may_fail; + $self->db_error($query) unless $params{may_fail}; $self->dbh->rollback; $self->dbh->begin_work; @@ -204,13 +204,24 @@ C<$coa_name>. Outputs an error message C<$message> to the user and aborts execution. -=item C +=item C -Executes an SQL query. What the method does if the query fails depends -on C<$may_fail>. If it is falsish then the method will simply die -outputting the error message via L. If C<$may_fail> is -trueish then the current transaction will be rolled back, a new one -will be started +Executes an SQL query. The following parameters are supported: + +=over 2 + +=item C + +What the method does if the query fails depends on this parameter. If +it is falsish (the default) then the method will simply die outputting +the error message via L. If C is trueish then the +current transaction will be rolled back, a new one will be started. + +=item C + +An optional array reference containing bind parameter for the query. + +=back =item C