steino / odbc

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

Tests fail due to not-null columns 'canBeNull' and 'data' #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. go test -run TestMSSQLCreateInsertDelete

What do you see instead?
mssql_test.go:163: SQLExecute: {23000} [FreeTDS][SQL Server]Cannot insert the 
value NULL into column 'canBeNull', table 'gonuts.dbo.temp'; column does not 
allow nulls. INSERT fails.

What version of the product are you using? On what operating system?
Server: MS-SQL 2008
Client: Linux (64-bit), unixodbc, freetds

Please provide any additional information below.
Changing the 'create table' line (mssql_test.go:148) to include explicit 
nullability seems to fix it:
WAS:
exec(t, db, "create table dbo.temp (name varchar(20), age int, isGirl bit, 
weight decimal(5,2), dob datetime, data varbinary(10), canBeNull varchar(10))")

IS NOW:
exec(t, db, "create table dbo.temp (name varchar(20), age int, isGirl bit, 
weight decimal(5,2), dob datetime, data varbinary(10) null, canBeNull 
varchar(10) null)")

Original issue reported on code.google.com by gov...@ver.slu.is on 21 Aug 2013 at 5:08

GoogleCodeExporter commented 9 years ago
Here is the change https://codereview.appspot.com/12848048/ as per you 
suggestion. Please, review. Thank you.

Alex

Original comment by alex.bra...@gmail.com on 22 Aug 2013 at 7:22

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

Original comment by alex.bra...@gmail.com on 22 Aug 2013 at 11:38