google-code-export / django-pyodbc

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

NULL ForeignKey generates incorrect SQL #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create any model who's Foreign Key has null=True and attempt to Insert a
record for that model while omiting the Foreign Key. 

What is the expected output? What do you see instead?

The driver appears to fail set NOT NULL on the foreign key which causes an
error message like:

IntegrityError: ('23000', "[23000] [FreeTDS][SQL Server]INSERT statement
conflicted with COLUMN FOREIGN KEY constraint
'FK__mypri_ser__altpr__6477ECF3'. The conflict occurred in database
'webdesk_db', table 'mypri_person', column 'id'. (547) (SQLExecDirectW)")

What version of the product are you using? On what operating system?
CLIENT: Django 1.2 alpha 1 SVN-12267 on Ubuntu 9.10
SERVER: SQL Server 2000 8.00.760 on Windows 2000 SP 4 and SQL Server 2000

Please provide any additional information below.

It would appear that there may be additional issues related to this:
http://code.google.com/p/django-pyodbc/issues/detail?id=61 and 
http://code.google.com/p/django-pyodbc/issues/detail?id=48

I am sorry if there could be more information with this ticket. I'm not
exactly educated on SQL.

Original issue reported on code.google.com by DLacew...@gmail.com on 20 Jan 2010 at 10:32