Skip to content

Commit

Permalink
Do not use a binary encoded regexp to avoid warnings
Browse files Browse the repository at this point in the history
Ref: #43829

```ruby
>> /foo/n.match?("SELECT '€'")
warning: historical binary regexp match /.../n against UTF-8 string
```

The `/n` modifed isn't that necessary anyway, it was just extra caution.
  • Loading branch information
byroot committed Dec 10, 2021
1 parent 09304e4 commit 050425f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -68,7 +68,7 @@ def self.type_cast_config_to_boolean(config)
def self.build_read_query_regexp(*parts) # :nodoc:
parts += DEFAULT_READ_QUERY
parts = parts.map { |part| /#{part}/i }
/\A(?:[(\s]|#{COMMENT_REGEX})*#{Regexp.union(*parts)}/n
/\A(?:[(\s]|#{COMMENT_REGEX})*#{Regexp.union(*parts)}/
end

def self.quoted_column_names # :nodoc:
Expand Down

0 comments on commit 050425f

Please sign in to comment.