|
|
Choosing A Webhost: |
CVS update of libmysequoia/src (CarobMySQL.cpp): msg#00057db.carob.cvs
Date: Friday, February 17, 2006 @ 11:48:25 Author: zsolt Path: /cvsroot/carob/libmysequoia/src Modified: CarobMySQL.cpp (1.48 -> 1.49) - modified if the user gives the hardcoded mysql port first try to connect to sequoia hardcoded port and if not successful than to the mysql hardcoded port - small leak fix ----------------+ CarobMySQL.cpp | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) Index: libmysequoia/src/CarobMySQL.cpp diff -u libmysequoia/src/CarobMySQL.cpp:1.48 libmysequoia/src/CarobMySQL.cpp:1.49 --- libmysequoia/src/CarobMySQL.cpp:1.48 Mon Feb 13 13:44:23 2006 +++ libmysequoia/src/CarobMySQL.cpp Fri Feb 17 11:48:25 2006 @@ -101,7 +101,7 @@ { LOG4CXX_DEBUG(logger, "Entering connect: host=" << host << " user=" << user << " passwd=" << passwd << " db=" << db << " port=" << port); - bool defaultport = port == 0; + bool defaultport = false; if (mysqlPtr->status != MYSQL_STATUS_READY) { @@ -152,14 +152,20 @@ if (!port) { - //check if the cnf file contains the hardcoded mysql port (3306) - //if so, then first try to connect to the default sequoia port (25322) - //and if is unsuccessful, then to the 3306 port. - port = mysqlPtr->options.port == 3306 ? 25322 : mysqlPtr->options.port; + port = mysqlPtr->options.port; if (!port) port = 25322; } + //check if the port contains the hardcoded mysql port (3306) + //if so, then first try to connect to the default sequoia port (25322) + //and if is unsuccessful, then to the 3306 port. + if (port == 3306) + { + port = 25322; + defaultport = true; + } + /* set the default character set if not set */ if (!mysqlPtr->options.charset_name) mysqlPtr->options.charset_name = cstrdup("latin1"); @@ -287,14 +293,15 @@ stmtPtr->setQueryTimeout(mysqlPtr->options.read_timeout); stmtPtr->setFetchSize(1); } - + + FREE_AND_NULL_ARRAY(mysqlPtr->info); + if (stmtPtr->execute(fromString(std::string(query,length)))) { mysqlPtr->affected_rows = 0; drsPtr = stmtPtr->getResultSet(); mysqlPtr->field_count = drsPtr ? drsPtr->getNumberOfColumns() : 0; mysqlPtr->status = MYSQL_STATUS_GET_RESULT; - FREE_AND_NULL_ARRAY(mysqlPtr->info); LOG4CXX_INFO(logger, "Executed query with result set. Field_count=" << mysqlPtr->field_count); } else
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS update of carob/src (Statement.cpp), gilles-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
|---|---|
| Next by Date: | CVS update of carob (include/Connection.hpp src/Connection.cpp), gilles-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Previous by Thread: | CVS update of libmysequoia/src (CarobMySQL.cpp), zsolt-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Next by Thread: | CVS update of libmysequoia/src (CarobMySQL.cpp), zsolt-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|