Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

CVS update of libmysequoia (3 files): msg#00113

db.carob.cvs

Subject: CVS update of libmysequoia (3 files)

Date: Tuesday, February 28, 2006 @ 11:53:33
Author: csaba
Path: /cvsroot/carob/libmysequoia

Modified: include/CarobMySQL.hpp (1.26 -> 1.27) src/CarobMySQL.cpp (1.54
-> 1.55) src/MySQLAPI.cpp (1.48 -> 1.49)

Implemented mysql_set_character_set()


------------------------+
include/CarobMySQL.hpp | 5 +++++
src/CarobMySQL.cpp | 22 ++++++++++++++++++++++
src/MySQLAPI.cpp | 19 +++++++++++++++++++
3 files changed, 46 insertions(+)


Index: libmysequoia/include/CarobMySQL.hpp
diff -u libmysequoia/include/CarobMySQL.hpp:1.26
libmysequoia/include/CarobMySQL.hpp:1.27
--- libmysequoia/include/CarobMySQL.hpp:1.26 Wed Feb 22 15:23:57 2006
+++ libmysequoia/include/CarobMySQL.hpp Tue Feb 28 11:53:33 2006
@@ -204,6 +204,11 @@
void push_init_command(const char *cmd);

/**
+ * Set the character set for the connection
+ */
+ int set_character_set(const char *name);
+
+ /**
* Creates a prepared statement
*/
CarobStmt *createPreparedStatment();
Index: libmysequoia/src/CarobMySQL.cpp
diff -u libmysequoia/src/CarobMySQL.cpp:1.54
libmysequoia/src/CarobMySQL.cpp:1.55
--- libmysequoia/src/CarobMySQL.cpp:1.54 Thu Feb 23 13:58:31 2006
+++ libmysequoia/src/CarobMySQL.cpp Tue Feb 28 11:53:33 2006
@@ -731,6 +731,28 @@
LOG4CXX_DEBUG(logger, "Leaving push_init_command.");
}

+int
+CarobMYSQL::set_character_set(const char *name)
+{
+ LOG4CXX_DEBUG(logger, "Entering set_character_set: name=" << name);
+
+ bool result = false;
+ char buff[254];
+
+ snprintf(buff, sizeof(buff), "SET NAMES %s", name);
+ if ((result=real_query(buff, strlen(buff))) == true)
+ {
+ mysqlPtr->options.charset_name = strdup(name);
+ }
+ else
+ {
+ set_error(CR_CANT_READ_CHARSET, SQLT_UNKNOWN);
+ }
+
+ LOG4CXX_DEBUG(logger, "Leaving set_character_set: result=" << result);
+ return result == true ? 0 : 1;
+}
+
MYSQL *
CarobMYSQL::getMYSQL ()
{
Index: libmysequoia/src/MySQLAPI.cpp
diff -u libmysequoia/src/MySQLAPI.cpp:1.48 libmysequoia/src/MySQLAPI.cpp:1.49
--- libmysequoia/src/MySQLAPI.cpp:1.48 Thu Feb 23 16:53:45 2006
+++ libmysequoia/src/MySQLAPI.cpp Tue Feb 28 11:53:33 2006
@@ -902,6 +902,25 @@
return result;
}

+/* Set the default character set for the current connection */
+int STDCALL
+mysql_set_character_set(MYSQL *mysql, const char *name)
+{
+ LOG4CXX_DEBUG(logger, "Entering mysql_set_character_set: mysql=" << mysql <<
" name=" << name);
+
+ int result;
+
+ if (mysql)
+ {
+ result = getCarob(mysql)->set_character_set(name);
+ }
+ else
+ result = 1;
+
+ LOG4CXX_DEBUG(logger, "Leaving mysql_set_character_set: result=" << result);
+ return result;
+}
+
/* Returns the name of the default character set for the connection. */
const char *
mysql_character_set_name (MYSQL * mysql)


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Free Magazines

Cisco News
Receive 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

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo