WilliamRen / django-pyodbc

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

Port number incorrect for dsnless connections #92

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. when using host_is_server=True in settings.py, the port number is inserted 
incorrectly into the connection string.

What is the expected output? What do you see instead?
The connections string should look like this:
  DRIVER={FreeTDS};SERVER=<myserver>;Port=1433;UID=...
but instead looks like this:
  DRIVER={FreeTDS};SERVER=<myserver>,1433;UID=...
So the 'Port=' text is missing, and the comma should be a semicolon.

What version of the product are you using? On what operating system?
Trunk at r183 on Linux Mint 9 with unixodbc and freetds.

Please provide any additional information below.
I tried adding the missing text in base.py and the connection now works.  So 
the fix is in the line after the one containing "if port_str:", replace
  host_str += ',%s' % port_str
with
  host_str += ';Port=%s' % port_str

Original issue reported on code.google.com by robin.pe...@gmail.com on 21 Oct 2010 at 4:20

GoogleCodeExporter commented 8 years ago
Update: the same thing happens on WinXP.

Original comment by robin.pe...@gmail.com on 30 Oct 2010 at 7:27

GoogleCodeExporter commented 8 years ago
This is just the change described by the OP in form of a patch file.

Original comment by shai2pla...@gmail.com on 5 Jan 2011 at 2:14

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by vcc.ch...@gmail.com on 24 Mar 2011 at 4:50

GoogleCodeExporter commented 8 years ago
Fixed in r188, thanks.

Original comment by vcc.ch...@gmail.com on 17 Apr 2011 at 4:56