Browse files

fix raising handshake error when no database name given, and raise re…

…asonable exception instead of SystemError on connection error
  • Loading branch information...
1 parent 05166cc commit fca017fde84a3d1920b5dfc13ab0b8e993a7d5dc @hongqn hongqn committed Feb 28, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/Connection.cpp
  2. +1 −1 python/umysql.c
View
2 lib/Connection.cpp
@@ -294,7 +294,7 @@ bool Connection::processHandshake()
return false;
}
- if (!(serverCaps & MCP_CONNECT_WITH_DB) && m_database.empty())
+ if ((serverCaps & MCP_CONNECT_WITH_DB) && m_database.empty())
{
m_clientCaps &= ~MCP_CONNECT_WITH_DB;
}
View
2 python/umysql.c
@@ -857,7 +857,7 @@ PyObject *Connection_connect(Connection *self, PyObject *args)
if (!UMConnection_Connect (self->conn, host, port, username, password, database, acObj ? &autoCommit : NULL, charset))
{
- return NULL;
+ return HandleError(self, "connect");
}
Py_RETURN_NONE;

0 comments on commit fca017f

Please sign in to comment.