- Fix count of grouped resultsets using HAVING with aliases
- Setting belongs_to columns/relationships no longer leaves the
FK value and related object out of sync
+ - Stop stripping newlines from SQL statements in the limit emulators
+ as it is possible that custom sql with comments was provided
* Misc
- Switch all serialization to use Storable::nfreeze for portable
EOS
- $sql =~ s/\s*\n\s*/ /g; # easier to read in the debugger
return $sql;
}
EOS
}
- $sql =~ s/\s*\n\s*/ /g; # easier to read in the debugger
return $sql;
}
$order_by_requested,
) if ( ($offset && $order_by_requested) || ($mid_sel ne $out_sel) );
- $sql =~ s/\s*\n\s*/ /g; # easier to read in the debugger
return $sql;
}
,
);
- $sql =~ s/\s*\n\s*/ /g; # easier to read in the debugger
return $sql;
}
'Correct columns selected with rows',
);
+{
+ $rs = $schema->resultset('Artist')->search({}, {
+ columns => 'name',
+ offset => 1,
+ order_by => 'name',
+ });
+ local $rs->result_source->{name} = "weird \n newline/multi \t \t space containing \n table";
+
+ like (
+ ${$rs->as_query}->[0],
+ qr| weird \s \n \s newline/multi \s \t \s \t \s space \s containing \s \n \s table|x,
+ 'Newlines/spaces preserved in final sql',
+ );
+}
+
done_testing;
[ [ 'source', 'Library' ] ],
);
+{
+ my $rs = $schema->resultset('Artist')->search({}, {
+ columns => 'name',
+ offset => 1,
+ order_by => 'name',
+ });
+ local $rs->result_source->{name} = "weird \n newline/multi \t \t space containing \n table";
+
+ like (
+ ${$rs->as_query}->[0],
+ qr| weird \s \n \s newline/multi \s \t \s \t \s space \s containing \s \n \s table|x,
+ 'Newlines/spaces preserved in final sql',
+ );
+}
+
+
done_testing;
'Rownum subsel aliasing works correctly'
);
+{
+ $rs = $s->resultset('Artist')->search({}, {
+ columns => 'name',
+ offset => 1,
+ order_by => 'name',
+ });
+ local $rs->result_source->{name} = "weird \n newline/multi \t \t space containing \n table";
+
+ like (
+ ${$rs->as_query}->[0],
+ qr| weird \s \n \s newline/multi \s \t \s \t \s space \s containing \s \n \s table|x,
+ 'Newlines/spaces preserved in final sql',
+ );
+}
+
+
done_testing;
[ [ 'source', 'Library' ] ],
);
+{
+ my $rs = $schema->resultset('Artist')->search({}, {
+ columns => 'name',
+ offset => 1,
+ order_by => 'name',
+ });
+ local $rs->result_source->{name} = "weird \n newline/multi \t \t space containing \n table";
+
+ like (
+ ${$rs->as_query}->[0],
+ qr| weird \s \n \s newline/multi \s \t \s \t \s space \s containing \s \n \s table|x,
+ 'Newlines/spaces preserved in final sql',
+ );
+}
+
done_testing;