[DBIx-Class-Devel] [Perl5/DBIx-Class] Column names can include spaces and other non 'w' characters (#129)

Peter Rabbitson notifications at github.com
Thu Nov 22 08:35:05 GMT 2018


On 11/22/2018 07:39 AM, Daniel Böhmer wrote:
> *@dboehmer* commented on this pull request.
> 
> ------------------------------------------------------------------------
> 
> In lib/DBIx/Class/ResultSource.pm 
> <https://github.com/Perl5/DBIx-Class/pull/129#discussion_r235614578>:
> 
>> @@ -1531,7 +1531,7 @@ sub reverse_relationship_info {
>   sub __strip_relcond {
>     +{
>       map
> -      { map { /^ (?:foreign|self) \. (\w+) $/x } ($_, $_[1]{$_}) }
> +      { map { /^ (?:foreign|self) \. (.+) $/x } ($_, $_[1]{$_}) }
> 
> 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 |[^`|]+|.

Apologies for nto replying earlier to this. Generally there should be 
*no* limitations in this specific portion of the codebase, the presence 
of \w+ is an oversight, and the original PR is correct.

However - there are a few other places that need a similar update, and 
as the PR came with no tests of any sort - the spots got missed :(

I will circle back to this before the end of the year, I promise.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/Perl5/DBIx-Class/pull/129#issuecomment-440952318
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20181122/70b12bf4/attachment.htm>


More information about the DBIx-Class-Devel mailing list