Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rlm_sql_unixodbc issues with SQL Server #2822

Open
domlat opened this issue Jul 30, 2019 · 0 comments

Comments

@domlat
Copy link

commented Jul 30, 2019

Freeradius 3.0.19 compiled from source and running on Ubuntu.

I installed Microsoft's own "ODBC Driver 17 for SQL Server" and
tested against both SQL Server running on the same Linux machine as
Freeradius itself, and SQL Server running on a Windows machine.

I used rlm_sql_unixodbc. I found that numeric results more than
four character long were considered "out of range".

EXPAND %{sql:SELECT 9999 }
   --> 9999
My-Int := 9999

Executing select query: SELECT 10000
rlm_sql_unixodbc: 22003 [Microsoft][ODBC Driver 17 for SQL Server]Numeric value out of range 

       Executing select query: SELECT -1000
rlm_sql_unixodbc: 22003 [Microsoft][ODBC Driver 17 for SQL Server]Numeric value out of range 

Then I used rlm_sql_unixodbc to connect to freetds and thence
to SQL Server. This time numbers more than four digits long are
simply truncated:

   EXPAND %{sql:SELECT 123456 }
      --> 1234

   EXPAND %{sql:SELECT '123456' }
      --> 123456

   EXPAND %{sql:SELECT CAST(123456 as varchar) }
      --> 123456

rlm_sql_freetds connects to SQL Server without a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.