sub _select_fields {
my ($self, $fields) = @_;
- return ref $fields eq 'ARRAY' ? join ', ', map { $self->_quote($_) } @$fields
- : $fields;
+
+ $self->_SWITCH_refkind($fields, {
+ ARRAYREF => sub { join ', ', map { $self->_quote($_) } @$fields },
+
+ ARRAYREFREF => sub {
+ my ($s, @b) = @$$fields;
+ $self->_assert_bindval_matches_bindtype(@b);
+ ($s, @b);
+ },
+
+ SCALARREF => sub { $$fields },
+
+ # For back-compat
+ SCALAR => sub { $fields },
+ });
}
#======================================================================
stmt_q => 'DELETE FROM `test` WHERE ( `requestor` IS NULL ) RETURNING `id`, `created_at`',
bind => []
},
-);
+ {
+ func => 'select',
+ args => ['wibble', \['func(?)', 42]],
+ stmt => 'select func(?) from wibble',
+ stmt_q => 'select func(?) from `wibble`',
+ bind => [42],
+ },
+ {
+ func => 'select',
+ args => ['wibble', \'"wobble"'],
+ stmt => 'select "wobble" from wibble',
+ stmt_q => 'select "wobble" from `wibble`',
+ bind => [],
+ },
+ );
# check is( not) => undef
for my $op (qw(not is is_not), 'is not') {