On 11/22/2018 07:39 AM, Daniel Böhmer wrote:<br>
&gt; *@dboehmer* commented on this pull request.<br>
&gt; <br>
&gt; ------------------------------------------------------------------------<br>
&gt; <br>
&gt; In lib/DBIx/Class/ResultSource.pm <br>
&gt; &lt;https://github.com/Perl5/DBIx-Class/pull/129#discussion_r235614578&gt;:<br>
&gt; <br>
&gt;&gt; @@ -1531,7 +1531,7 @@ sub reverse_relationship_info {<br>
&gt;   sub __strip_relcond {<br>
&gt;     +{<br>
&gt;       map<br>
&gt; -      { map { /^ (?:foreign|self) \. (\w+) $/x } ($_, $_[1]{$_}) }<br>
&gt; +      { map { /^ (?:foreign|self) \. (.+) $/x } ($_, $_[1]{$_}) }<br>
&gt; <br>
&gt; While this regex is not DBMS-specific all new allowed characters (all of <br>
&gt; |\W|) seem to be relevant for MS-SQL only. So I suggest to still limit <br>
&gt; the allowed characters to those allowed in MS-SQL.<br>
&gt; <br>
&gt; I took a quick look at <br>
&gt; https://docs.microsoft.com/en-us/sql/odbc/microsoft/column-name-limitations?view=sql-server-2017<br>
&gt; <br>
&gt;   * |`| is not allowed<br>
&gt;   * ||| is not allowed<br>
&gt; <br>
&gt; So I suggest |[^`|]+|.<br>
<br>
Apologies for nto replying earlier to this. Generally there should be <br>
*no* limitations in this specific portion of the codebase, the presence <br>
of \w+ is an oversight, and the original PR is correct.<br>
<br>
However - there are a few other places that need a similar update, and <br>
as the PR came with no tests of any sort - the spots got missed :(<br>
<br>
I will circle back to this before the end of the year, I promise.<br>
<br>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/Perl5/DBIx-Class/pull/129#issuecomment-440952318">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AASeAmgfoA0whFQuV2_FHG9i_D0SqWMuks5uxmG5gaJpZM4XZ4rx">mute the thread</a>.<img src="https://github.com/notifications/beacon/AASeAoLrVjxHLhpw50MBSQvwYYDcQtWyks5uxmG5gaJpZM4XZ4rx.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/Perl5/DBIx-Class","title":"Perl5/DBIx-Class","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/Perl5/DBIx-Class"}},"updates":{"snippets":[{"icon":"PERSON","message":"@ribasushi in #129: On 11/22/2018 07:39 AM, Daniel Böhmer wrote:\n\u003e *@dboehmer* commented on this pull request.\n\u003e \n\u003e ------------------------------------------------------------------------\n\u003e \n\u003e In lib/DBIx/Class/ResultSource.pm \n\u003e \u003chttps://github.com/Perl5/DBIx-Class/pull/129#discussion_r235614578\u003e:\n\u003e \n\u003e\u003e @@ -1531,7 +1531,7 @@ sub reverse_relationship_info {\n\u003e   sub __strip_relcond {\n\u003e     +{\n\u003e       map\n\u003e -      { map { /^ (?:foreign|self) \\. (\\w+) $/x } ($_, $_[1]{$_}) }\n\u003e +      { map { /^ (?:foreign|self) \\. (.+) $/x } ($_, $_[1]{$_}) }\n\u003e \n\u003e While this regex is not DBMS-specific all new allowed characters (all of \n\u003e |\\W|) seem to be relevant for MS-SQL only. So I suggest to still limit \n\u003e the allowed characters to those allowed in MS-SQL.\n\u003e \n\u003e I took a quick look at \n\u003e https://docs.microsoft.com/en-us/sql/odbc/microsoft/column-name-limitations?view=sql-server-2017\n\u003e \n\u003e   * |`| is not allowed\n\u003e   * ||| is not allowed\n\u003e \n\u003e So I suggest |[^`|]+|.\n\nApologies for nto replying earlier to this. Generally there should be \n*no* limitations in this specific portion of the codebase, the presence \nof \\w+ is an oversight, and the original PR is correct.\n\nHowever - there are a few other places that need a similar update, and \nas the PR came with no tests of any sort - the spots got missed :(\n\nI will circle back to this before the end of the year, I promise.\n\n"}],"action":{"name":"View Pull Request","url":"https://github.com/Perl5/DBIx-Class/pull/129#issuecomment-440952318"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/Perl5/DBIx-Class/pull/129#issuecomment-440952318",
"url": "https://github.com/Perl5/DBIx-Class/pull/129#issuecomment-440952318",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [Perl5/DBIx-Class] Column names can include spaces and other non 'w' characters (#129)",
"sections": [
{
"text": "",
"activityTitle": "**Peter Rabbitson**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@ribasushi",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"Perl5/DBIx-Class\",\n\"issueId\": 129,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close pull request",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"PullRequestClose\",\n\"repositoryFullName\": \"Perl5/DBIx-Class\",\n\"pullRequestId\": 129\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/Perl5/DBIx-Class/pull/129#issuecomment-440952318"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 392661745\n}"
}
],
"themeColor": "26292E"
}
]</script>