my ($sql, $bind) = $self->next::method (@_);
if ($op eq 'insert') {
- my $quote_char = $self->sql_maker->quote_char || '"';
+ my @auto_inc_cols = grep {
+ my $inserting = $args->[0]{$_};
- my @auto_inc_cols =
- grep $ident->column_info($_)->{is_auto_increment}, $ident->columns;
+ $ident->column_info($_)->{is_auto_increment} && (
+ (not defined $inserting)
+ ||
+ (ref $inserting eq 'SCALAR' && $$inserting eq 'NULL')
+ )
+ } $ident->columns;
if (@auto_inc_cols) {
my $auto_inc_cols =
join ', ',
-# XXX quoting the columns breaks ODBC
-# map qq{${quote_char}${_}${quote_char}},
- @auto_inc_cols;
+ map $self->_quote_column_for_returning($_), @auto_inc_cols;
$sql .= " RETURNING ($auto_inc_cols)";
return ($sql, $bind);
}
+sub _quote_column_for_returning {
+ my ($self, $col) = @_;
+
+ return $self->sql_maker->_quote($col);
+}
+
sub _execute {
my $self = shift;
my ($op) = @_;
use base qw/DBIx::Class::Storage::DBI::InterBase/;
use mro 'c3';
-1;
-
=head1 NAME
DBIx::Class::Storage::DBI::ODBC::Firebird - Driver for using the Firebird RDBMS
All functionality is provided by L<DBIx::Class::Storage::DBI::Interbase>, see
that module for details.
+=cut
+
+# RETURNING ("foo") is broken in ODBC, but RETURNING (foo) works
+sub _quote_column_for_returning {
+ return $_[1];
+}
+
+1;
+
=head1 AUTHOR
See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.