Coder Social home page Coder Social logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
This issue may related with change of revision 46fde04e1e45.
When _mssql.pyx is changed as below, connection error don't occur.

@@ -460,8 +460,8 @@

         # add the port to the server string if it doesn't have one already and
         # if we are not using an instance
-        if ':' not in server and not instance:
-            server = '%s:%s' % (server, port)
+        #if ':' not in server and not instance:
+        #    server = '%s:%s' % (server, port)

         # override the HOST to be the portion without the server, otherwise
         # FreeTDS chokes when server still has the port definition.
@@ -470,10 +470,10 @@
         # doesn't get fixed for a while.  But if it does get fixed, this code
         # can be deleted.
         # patch: http://lists.ibiblio.org/pipermail/freetds/2011q2/026997.html
-        #if ':' in server:
-        #    os.environ['TDSHOST'] = server.split(':', 1)[0]
-        #else:
-        #    os.environ['TDSHOST'] = server
+        if ':' in server:
+            os.environ['TDSHOST'] = server.split(':', 1)[0]
+        else:
+            os.environ['TDSHOST'] = server

         # Add ourselves to the global connection list
         connection_object_list.append(self)
@@ -488,7 +488,8 @@
         dbsetlogintime(login_timeout)

         # Connect to the server
-        self.dbproc = dbopen(login, server)
+        #self.dbproc = dbopen(login, server)
+        self.dbproc = dbopen(login, '<pymssql dynamic>')

         # Frees the login record, can be called immediately after dbopen.
         dbloginfree(login)

Original comment by [email protected] on 18 Apr 2011 at 7:32

from pymssql.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
What version of FreeTDS are you using on Windows, the bundled version?  Its 
likely that was the cause.  A FreeTDS bug was preventing "host:port" from 
working correctly which is what is used internally by pymssql.  See this post:

http://lists.ibiblio.org/pipermail/freetds/2011q2/027004.html

Our bundled version of FreeTDS is out of date and likely does not have the bug 
fix.

You can test this by repacking the latest FreeTDS snapshot from freetds.org, 
zipping it, and replacing that int he pymssql source tree.  Then re-compile and 
I bet it works.

> Above script worked in CentOS 5.5 32bit well.

What version of FreeTDS were you using in CentOS?

Original comment by [email protected] on 25 Apr 2011 at 9:31

  • Changed state: Accepted

from pymssql.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
I use the bundled version on Windows.
And I upgrade CentOS 5.6 and FreeTDS 0.64 is installed on CentOS 5.6.

I cannot download FreeTDS 
snapshot(ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/current/freetds-current.t
gz) from www.freetds.org.

So, I checkout source from CVS and try to build FreeTDS snapshot on MSYS and 
Cygwin.
To build, I refer to INSTALL.CVS document.
But, I cannot build FreeTDS with below Error on MSYS.
$ ./autogen.sh
running /bin/autoreconf in /d/prj/pysrc_build/freetds_cvs/freetds:
' is already registered with AC_CONFIG_FILES.
/usr/src/autoconf/autoconf-2.67/lib/autoconf/status.m4:290: AC_CONFIG_FILES is 
expanded from...
configure.ac:824: the top level
autom4te-2.67: /bin/m4 failed with exit status: 1
C:\devtool\MinGW\msys\1.0\bin\aclocal: /usr/bin/autom4te-2.67 failed with exit 
status: 1
autoreconf: aclocal failed with exit status: 1
' is already registered with AC_CONFIG_FILES.
/usr/src/autoconf/autoconf-2.67/lib/autoconf/status.m4:290: AC_CONFIG_FILES is 
expanded from...
configure.ac:824: the top level
autom4te-2.67: /bin/m4 failed with exit status: 1
C:\devtool\MinGW\msys\1.0\bin\aclocal: /usr/bin/autom4te-2.67 failed with exit 
status: 1
autoreconf: aclocal failed with exit status: 1

Same error occurred on Cygwin.

Do you know how to build FreeTDS on windows with MSYS or Cygwin?

Original comment by [email protected] on 26 Apr 2011 at 4:36

from pymssql.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
I solved this issue using latest snapshot.
Thank you for your help.
The attached files are freetds.zip of latest snapshot build and installers for 
python 2.5/2.6.

I build FreeTDS snapshot using MSYS and tdm-gcc.
1. download http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-0.91rc.tgz
2. $ export PATH=/c/devtool/mingw_tdm/bin/:$PATH
3. $ gcc -v
4. $ ./configure --prefix=/opt/freetds/freetds --enable-shared=no 
--enable-static=yes --enable-msdblib --enable-odbc-wide --with-tdsver=7.1 
5. $ make
6. $ make install
7. zip /opt/freetds/freetds folder to freetds.zip
8. replace win32\freetds.zip
9. d:\work\python26 setup.py build -c mingw32 bdist_wininst

Original comment by [email protected] on 27 Apr 2011 at 2:53

Attachments:

from pymssql.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
Could it be possible to release a py2.7 version of this build ?

thx

Original comment by [email protected] on 28 Aug 2011 at 9:50

from pymssql.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
You can find the installer for py2.7 in issue 54.

Original comment by [email protected] on 29 Aug 2011 at 1:25

from pymssql.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024
tested && approuved ;)

Very thanks to you !

Original comment by [email protected] on 30 Aug 2011 at 11:41

from pymssql.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 18, 2024

Original comment by [email protected] on 8 Mar 2012 at 3:18

  • Changed state: WontFix

from pymssql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.