Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

bk commit into 5.1 tree (kostja:1.2606)

From: <konstantin(at)mysql.com>
Date: Wed Oct 31 2007 - 16:48:49 EDT


Below is the list of changes that have just been committed into a local 5.1 repository of kostja. When kostja does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository.
For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@1.2606, 2007-10-31 23:48:41+03:00, kostja@bodhi.(none) +1 -0   Try to fix a Windows compilation warning.

  sql-common/client.c@1.145, 2007-10-31 23:48:37+03:00, kostja@bodhi.(none) +70 -55     Move a block of auxiliary functions to the beginning of the file,     to avoid compilation warnings on Windows.     Add comments, albeit trivial, while we're at it.

diff -Nrup a/sql-common/client.c b/sql-common/client.c

--- a/sql-common/client.c	2007-10-31 18:33:06 +03:00

+++ b/sql-common/client.c 2007-10-31 23:48:37 +03:00
@@ -272,6 +272,76 @@ static int wait_for_data(my_socket fd, u  }
 #endif /* defined(__WIN__) || defined(__NETWARE__) */  

+/**
+ Set the internal error message to mysql handler
+
+ @param mysql connection handle (client side)
+ @param errcode CR_ error code, passed to ER macro to get
+ error text
+ @parma sqlstate SQL standard sqlstate
+*/
+
+void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate)
+{
+ NET *net;
+ DBUG_ENTER("set_mysql_error");
+ DBUG_PRINT("enter", ("error :%d '%s'", errcode, ER(errcode)));
+ DBUG_ASSERT(mysql != 0);
+
+ net= &mysql->net;
+ net->last_errno= errcode;
+ strmov(net->last_error, ER(errcode));
+ strmov(net->sqlstate, sqlstate);
+
+ DBUG_VOID_RETURN;
+}
+
+/**
+ Clear possible error state of struct NET
+
+ @param net clear the state of the argument
+*/
+
+void net_clear_error(NET *net)
+{
+ net->last_errno= 0;
+ net->last_error[0]= '\0';
+ strmov(net->sqlstate, not_error_sqlstate);
+}
+
+/**
+ Set an error message on the client.
+
+ @param mysql connection handle
+ @param errcode CR_* errcode, for client errors
+ @param sqlstate SQL standard sql state, unknown_sqlstate for the
+ majority of client errors.
+ @param format error message template, in sprintf format
+ @param ... variable number of arguments
+*/
+
+static void set_mysql_extended_error(MYSQL *mysql, int errcode,
+ const char *sqlstate,
+ const char *format, ...)
+{
+ NET *net;
+ va_list args;
+ DBUG_ENTER("set_mysql_extended_error");
+ DBUG_PRINT("enter", ("error :%d '%s'", errcode, format));
+ DBUG_ASSERT(mysql != 0);
+
+ net= &mysql->net;
+ net->last_errno= errcode;
+ va_start(args, format);
+ my_vsnprintf(net->last_error, sizeof(net->last_error)-1,
+ format, args);
+ va_end(args);
+ strmov(net->sqlstate, sqlstate);
+
+ DBUG_VOID_RETURN;
+}
+
+
 

 /*
   Create a named pipe connection
@@ -726,61 +796,6 @@ void free_old_query(MYSQL *mysql)

   mysql->info= 0;
   DBUG_VOID_RETURN;
 }

-
-/*
-  Set the internal error message to mysql handler
-*/
-
-void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate)
-{
-  NET *net;
-  DBUG_ENTER("set_mysql_error");
-  DBUG_PRINT("enter", ("error :%d '%s'", errcode, ER(errcode)));
-  DBUG_ASSERT(mysql != 0);
-
-  net= &mysql->net;
-  net->last_errno= errcode;
-  strmov(net->last_error, ER(errcode));
-  strmov(net->sqlstate, sqlstate);
-
-  DBUG_VOID_RETURN;
-}
-
-/**
-  Clear possible error state of struct NET
-
-  @param net  clear the state of the argument
-*/
-
-void net_clear_error(NET *net)
-{
-  net->last_errno= 0;
-  net->last_error[0]= '\0';
-  strmov(net->sqlstate, not_error_sqlstate);
-}
-
-
-static void set_mysql_extended_error(MYSQL *mysql, int errcode,
-                                     const char *sqlstate,
-                                     const char *format, ...)
-{
-  NET *net;
-  va_list args;
-  DBUG_ENTER("set_mysql_extended_error");
-  DBUG_PRINT("enter", ("error :%d '%s'", errcode, format));
-  DBUG_ASSERT(mysql != 0);
-
-  net= &mysql->net;
-  net->last_errno= errcode;
-  va_start(args, format);
-  my_vsnprintf(net->last_error, sizeof(net->last_error)-1,
-               format, args);
-  va_end(args);
-  strmov(net->sqlstate, sqlstate);
-
-  DBUG_VOID_RETURN;
-}
-
 

 /*
   Flush result set sent from server

-- 
MySQL Code Commits Mailing List
For list archives: 
http://lists.mysql.com/commits
To unsubscribe:    
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Wed Oct 31 16:49:13 2007
Do you need help?X

This archive was generated by hypermail 2.1.8 : Thu Jul 03 2008 - 11:14:48 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library