Skip to content

table and column alias can't handle alias like t12_r6  #19

@stonegao

Description

@stonegao

If you have more than 9 tables to join, a ActiveRecord::StatementInvalid error will occur, that's because the but in the regular expression that detect aliases.

in file sqlserver_adapter
line 485:
if sql =~ /#{Regexp.escape(order_by_column)} AS (t\d_r\d\d?)/

it should be :

if sql =~ /#{Regexp.escape(order_by_column)} AS (t\d\d?_r\d\d?)/

or :
if sql =~ /#{Regexp.escape(order_by_column)} AS (t\d+_r\d+)/

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