-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
If a DBIx::Lite object is created with abstract => { quote_char => q{"} }
a resultset ->count call results in incorrect SQL, e.g. from Postgres:
DBD::Pg::st execute failed: ERROR: column "COUNT(*)" does not exist
LINE 1: SELECT "COUNT(*)" FROM "temp0002" AS "me"
^ [for Statement "SELECT "COUNT(*)" FROM "temp0002" AS "me""]
The code in DBIx::ResultSet::count
my $count_rs = $self->select(\ "COUNT(*)")->order_by(undef);
results in SQL::Abstract::More treating COUNT(*) as a column name, which it then quotes.
Changing the code to
my $count_rs = $self->select( [ \'COUNT(*)', 'count' ] )->order_by( undef );
fixes the issue by providing a real column name for SQL::Abstract::More
Metadata
Metadata
Assignees
Labels
No labels