Date: Wednesday, December 7, 2005 @ 11:25:24
Author: zsolt
Path: /cvsroot/carob/libmysequoia
Modified: include/Utils.hpp (1.3 -> 1.4) src/CarobMySQL.cpp (1.6 -> 1.7)
src/MySQLAPI.cpp (1.4 -> 1.5) src/Utils.cpp (1.3 -> 1.4)
correcting include files for error handling.
--------------------+
include/Utils.hpp | 66 +--------------------------------------------------
src/CarobMySQL.cpp | 3 +-
src/MySQLAPI.cpp | 3 ++
src/Utils.cpp | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 73 insertions(+), 65 deletions(-)
Index: libmysequoia/include/Utils.hpp
diff -u libmysequoia/include/Utils.hpp:1.3 libmysequoia/include/Utils.hpp:1.4
--- libmysequoia/include/Utils.hpp:1.3 Wed Dec 7 11:00:24 2005
+++ libmysequoia/include/Utils.hpp Wed Dec 7 11:25:24 2005
@@ -24,74 +24,12 @@
#include <string.h>
-const char *error_sqlstate[]=
-{
- "00000",
- "HY000"
-};
+extern const char *error_sqlstate[];
const int SQLT_OK = 0;
const int SQLT_UNKNOWN = 1;
-const char *error_messages[]=
-{
- "Unknown MySQL error",
- "",
- "",
- "Can't connect to MySQL server on '%-.100s' (%d)",
- "Can't create TCP/IP socket (%d)",
- "Unknown MySQL server host '%-.100s' (%d)",
- "MySQL server has gone away",
- "Protocol mismatch; server version = %d, client version = %d",
- "MySQL client ran out of memory",
- "Wrong host info",
- "",
- "%-.100s via TCP/IP",
- "Error in server handshake",
- "Lost connection to MySQL server during query",
- "Commands out of sync; you can't run this command now",
- "",
- "",
- "",
- "",
- "Can't initialize character set %-.32s (path: %-.100s)",
- "",
- "",
- "",
- "",
- "",
- "",
- "SSL connection error",
- "",
- "",
- "Invalid use of null pointer",
- "Statement not prepared",
- "No data supplied for parameters in prepared statement",
- "Data truncated",
- "No parameters exist in the statement",
- "Invalid parameter number",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "Wrong or unknown protocol",
- "Invalid connection handle",
- "",
- "Row retrieval was canceled by mysql_stmt_close() call",
- "Attempt to read column without prior row fetch",
- "Prepared statement contains no metadata",
- "Attempt to read a row while there is no result set associated with the
statement",
- "This feature is not implemented yet",
- ""
-};
+extern const char *error_messages[];
#define FREE_AND_NULL(p) if (p) {delete p; p=0;}
Index: libmysequoia/src/CarobMySQL.cpp
diff -u libmysequoia/src/CarobMySQL.cpp:1.6 libmysequoia/src/CarobMySQL.cpp:1.7
--- libmysequoia/src/CarobMySQL.cpp:1.6 Wed Dec 7 11:00:24 2005
+++ libmysequoia/src/CarobMySQL.cpp Wed Dec 7 11:25:24 2005
@@ -20,9 +20,10 @@
*/
#include <CarobMySQL.hpp>
+
#include <Utils.hpp>
-/* MySQL error messages */
+/* MySQL include */
#include <errmsg.h>
using namespace CarobNS;
Index: libmysequoia/src/MySQLAPI.cpp
diff -u libmysequoia/src/MySQLAPI.cpp:1.4 libmysequoia/src/MySQLAPI.cpp:1.5
--- libmysequoia/src/MySQLAPI.cpp:1.4 Wed Dec 7 11:00:24 2005
+++ libmysequoia/src/MySQLAPI.cpp Wed Dec 7 11:25:24 2005
@@ -23,6 +23,9 @@
#include <Utils.hpp>
+/* MySQL include */
+#include <errmsg.h>
+
/* Library initialization, shutdown */
/* Gets or initializes a MYSQL structure. */
Index: libmysequoia/src/Utils.cpp
diff -u libmysequoia/src/Utils.cpp:1.3 libmysequoia/src/Utils.cpp:1.4
--- libmysequoia/src/Utils.cpp:1.3 Wed Dec 7 11:00:24 2005
+++ libmysequoia/src/Utils.cpp Wed Dec 7 11:25:24 2005
@@ -24,6 +24,72 @@
/* MySQL include */
#include <errmsg.h>
+const char *error_sqlstate[]=
+{
+ "00000",
+ "HY000"
+};
+
+const char *error_messages[]=
+{
+ "Unknown MySQL error",
+ "",
+ "",
+ "Can't connect to MySQL server on '%-.100s' (%d)",
+ "Can't create TCP/IP socket (%d)",
+ "Unknown MySQL server host '%-.100s' (%d)",
+ "MySQL server has gone away",
+ "Protocol mismatch; server version = %d, client version = %d",
+ "MySQL client ran out of memory",
+ "Wrong host info",
+ "",
+ "%-.100s via TCP/IP",
+ "Error in server handshake",
+ "Lost connection to MySQL server during query",
+ "Commands out of sync; you can't run this command now",
+ "",
+ "",
+ "",
+ "",
+ "Can't initialize character set %-.32s (path: %-.100s)",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "SSL connection error",
+ "",
+ "",
+ "Invalid use of null pointer",
+ "Statement not prepared",
+ "No data supplied for parameters in prepared statement",
+ "Data truncated",
+ "No parameters exist in the statement",
+ "Invalid parameter number",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "Wrong or unknown protocol",
+ "Invalid connection handle",
+ "",
+ "Row retrieval was canceled by mysql_stmt_close() call",
+ "Attempt to read column without prior row fetch",
+ "Prepared statement contains no metadata",
+ "Attempt to read a row while there is no result set associated with the
statement",
+ "This feature is not implemented yet",
+ ""
+};
+
char *cstrdup(const char *src)
{
return src ? cstrdup(src, strlen(src)) : 0;
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits