xcable / odbc

Automatically exported from code.google.com/p/odbc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

tests fail with SQL Server Native Client 11.0 #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
... testing with the "msdriver" option of "SQL Server Native Client 11.0" and 
one of the existing tests is failing:
mssql_test.go:530: test "select cast('abc' as varchar(max))" failed: expect 
"abc", but got "\x00\x00\x00"
panic: runtime error: slice bounds out of range [recovered]
        panic: runtime error: slice bounds out of range

It is throwing the panic on column/odbc:217.  If I test with "msdriver" option 
of "SQL Server" then I do not get the error.  Do you want me to try to look 
into it before I submit the code change for review again?  Do you know what 
might be causing it?

Luke

Original issue reported on code.google.com by alex.bra...@gmail.com on 25 Apr 2013 at 1:04

GoogleCodeExporter commented 9 years ago
It looks like the SQL Server Native Client 11.0 API returns a type of 
SQL_VARCHAR for varchar(max) columns but returns a special length of 0.  I 
think the fix is to check for length of 0 and if so, treat it as a non-bindable 
column.

Original comment by lukemaul...@gmail.com on 26 Apr 2013 at 1:01

GoogleCodeExporter commented 9 years ago
lukemauldin,

Sounds like a plan. Would you like to send the fix? If not, I will fix it 
myself eventually.

Alex

Original comment by alex.bra...@gmail.com on 26 Apr 2013 at 2:50

GoogleCodeExporter commented 9 years ago
Here https://codereview.appspot.com/9009043/ is a fix as you suggested. Please, 
review it. I will wait for your CL 8751045 to be submitted first.

Alex

Original comment by alex.bra...@gmail.com on 29 Apr 2013 at 4:22

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 3a97962d9419.

Original comment by alex.bra...@gmail.com on 1 May 2013 at 7:58