Skip to content

Adapter doesn't extract default values containing newlines fully #14

@bfabry

Description

@bfabry

Line 1084 of sqlserver_adapter.rb attempts to extract the default value for a column from a string returned from the database:

match_data = ci[:default_value].match(/\A(+N?'?(.*?)'?)+\Z/)

It appears that this regex won't correctly match a default value that contains a newline, which for an older version of the adapter would cause it to crash, and for the current version to return nil. Adding m to the end of the regex so that . matches newlines fixed the crash for me

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions