Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column names can include spaces and other non 'w' characters #129

Open
wants to merge 2 commits into
base: maint/0.0828xx
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/DBIx/Class/ResultSource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ sub reverse_relationship_info {
sub __strip_relcond {
+{
map
{ map { /^ (?:foreign|self) \. (\w+) $/x } ($_, $_[1]{$_}) }
{ map { /^ (?:foreign|self) \. (.+) $/x } ($_, $_[1]{$_}) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this regex is not DBMS-specific all new allowed characters (all of \W) seem to be relevant for MS-SQL only. So I suggest to still limit the allowed characters to those allowed in MS-SQL.

I took a quick look at https://docs.microsoft.com/en-us/sql/odbc/microsoft/column-name-limitations?view=sql-server-2017

  • ` is not allowed
  • | is not allowed

So I suggest [^`|]+.

keys %{$_[1]}
}
}
Expand Down