additional codepath (missed in 0.08260)
- Fix inability to handle multiple consecutive transactions with
savepoints on DBD::SQLite < 1.39
+ - Fix prefetching tables with columns with regex metacharacters
+ in the name
* Misc
- Ensure source metadata calls always take place on the result source
# alias (should work even if they are in scalarrefs)
for my $alias (keys %$alias_list) {
my $al_re = qr/
- $lquote $alias $rquote $sep (?: $lquote ([^$rquote]+) $rquote )?
+ $lquote \Q$alias\E $rquote $sep (?: $lquote ([^$rquote]+) $rquote )?
|
- \b $alias \. ([^\s\)\($rquote]+)?
+ \b \Q$alias\E \. ([^\s\)\($rquote]+)?
/x;
for my $type (keys %$to_scan) {
for my $col (keys %$colinfo) {
next if $col =~ / \. /x; # if column is qualified it was caught by the above
- my $col_re = qr/ $lquote ($col) $rquote /x;
+ my $col_re = qr/ $lquote (\Q$col\E) $rquote /x;
for my $type (keys %$to_scan) {
for my $piece (@{$to_scan->{$type}}) {
},
);
+__PACKAGE__->has_many(quotes => 'DBICTest::Schema::Quotes', 'artistid');
+
sub sqlt_deploy_hook {
my ($self, $sqlt_table) = @_;
is_auto_increment => 1,
accessor => 'has_more_quotes',
},
+ 'has # comment' => {
+ data_type => 'integer',
+ accessor => 'has_comment',
+ },
+ artistid => {
+ data_type => 'integer',
+ },
);
+__PACKAGE__->belongs_to(artist => 'DBICTest::Schema::Artist', 'artistid');
+
1;
is_same_sql_bind(
$schema->resultset('Quotes')->search({})->as_query,
- '(SELECT [me].[`has` [more]] "quotes"] FROM [`with` [some]] "quotes"] [me])',
+ '(SELECT [me].[`has` [more]] "quotes"], [me].[has # comment], [me].[artistid] FROM [`with` [some]] "quotes"] [me])',
[],
'got correct escaped quotes with bracket quoting'
);
is_same_sql_bind(
$schema->resultset('Quotes')->search({})->as_query,
- '(SELECT `me`.```has`` [more] "quotes"` FROM ```with`` [some] "quotes"` `me`)',
+ '(SELECT `me`.```has`` [more] "quotes"`, `me`.`has # comment`, `me`.`artistid` FROM ```with`` [some] "quotes"` `me`)',
[],
'got correct escaped quotes with mysql quoting'
);
+is_same_sql_bind(
+ $schema->resultset('Artist')->search({}, { prefetch => 'quotes' })->as_query,
+ '(SELECT `me`.`artistid`, `me`.`name`, `me`.`rank`, `me`.`charfield`, `quotes`.```has`` [more] "quotes"`, `quotes`.`has # comment`, `quotes`.`artistid` FROM `artist` `me` LEFT JOIN ```with`` [some] "quotes"` `quotes` ON `quotes`.`artistid` = `me`.`artistid`)',
+ [],
+ 'got correct escaped comment with prefetch and mysql quoting'
+);
+
# !!! talk to ribasushi *explicitly* before modfying these tests !!!
{
is_same_sql_bind(