Open aet08 opened 4 years ago
irb(main):001:0> UserT.count SQL (4.9ms) USE [GenDB] (5.5ms) SELECT COUNT(*) FROM [UserT] => 2
irb(main):003:0> UserT.first UserT Load (9.6ms) EXEC sp_executesql N'SELECT [UserT]. FROM [UserT] OFFSET 0 ROWS FETCH NEXT @0 ROWS ONLY', N'@0 int', @0 = 1 [["LIMIT", nil]] ActiveRecord::StatementInvalid: TinyTds::Error: Incorrect syntax near '0'.: EXEC sp_executesql N'SELECT [UserT]. FROM [UserT] OFFSET 0 ROWS FETCH NEXT @0 ROWS ONLY', N'@0 int', @0 = 1 from (irb):3
Should return first record for UserT
UserT Load (9.6ms) EXEC sp_executesql N'SELECT [UserT]. FROM [UserT] WHERE [UserT].[id] = @0', N'@0 int', @0 = 1 [["id", nil]] ActiveRecord::StatementInvalid: TinyTds::Error: Invalid column name 'id'.: EXEC sp_executesql N'SELECT [UserT]. FROM [UserT] WHERE [UserT].[id] = @0', N'@0 int', @0 = 1 from (irb):3
5.2.4.3
x.x.x
FreeTDS details:
Compile-time settings (established with the "configure" script) Version: freetds v1.00.82 freetds.conf directory: /etc/freetds MS db-lib source compatibility: no Sybase binary compatibility: yes Thread safety: yes iconv library: yes TDS version: 4.2 iODBC: no unixodbc: yes SSPI "trusted" logins: no Kerberos: yes OpenSSL: no GnuTLS: yes MARS: no
Unable to recreate the issue. Could you provide a test case (https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/main/test/cases) or more information on the issue?
Issue
irb(main):001:0> UserT.count SQL (4.9ms) USE [GenDB] (5.5ms) SELECT COUNT(*) FROM [UserT] => 2
irb(main):003:0> UserT.first UserT Load (9.6ms) EXEC sp_executesql N'SELECT [UserT]. FROM [UserT] OFFSET 0 ROWS FETCH NEXT @0 ROWS ONLY', N'@0 int', @0 = 1 [["LIMIT", nil]] ActiveRecord::StatementInvalid: TinyTds::Error: Incorrect syntax near '0'.: EXEC sp_executesql N'SELECT [UserT]. FROM [UserT] OFFSET 0 ROWS FETCH NEXT @0 ROWS ONLY', N'@0 int', @0 = 1 from (irb):3
Expected behavior
Should return first record for UserT
Actual behavior
UserT Load (9.6ms) EXEC sp_executesql N'SELECT [UserT]. FROM [UserT] WHERE [UserT].[id] = @0', N'@0 int', @0 = 1 [["id", nil]] ActiveRecord::StatementInvalid: TinyTds::Error: Invalid column name 'id'.: EXEC sp_executesql N'SELECT [UserT]. FROM [UserT] WHERE [UserT].[id] = @0', N'@0 int', @0 = 1 from (irb):3
How to reproduce
Details
5.2.4.3
x.x.x
x.x.x
FreeTDS details: