~mkindahl/drizzle/remove-mem-casts

« back to all changes in this revision

Viewing changes to drizzled/protocol.cc

  • Committer: Mats Kindahl
  • Date: 2008-08-07 06:24:22 UTC
  • mfrom: (212.2.53 drizzle)
  • Revision ID: mats@mysql.com-20080807062422-20kyv6ssp4grfm0s
Manual merge of lp:drizzle into ~mkindahl/remove-mem-casts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
#include "mysql_priv.h"
28
28
#include <stdarg.h>
 
29
#include <drizzled/drizzled_error_messages.h>
29
30
 
30
31
static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024;
31
32
/* Declared non-static only because of the embedded library. */
166
167
            ha_rows affected_rows, uint64_t id, const char *message)
167
168
{
168
169
  NET *net= &thd->net;
169
 
  uchar buff[MYSQL_ERRMSG_SIZE+10],*pos;
 
170
  uchar buff[DRIZZLE_ERRMSG_SIZE+10],*pos;
170
171
 
171
172
  if (! net->vio)       // hack for re-parsing queries
172
173
  {
278
279
  NET *net= &thd->net;
279
280
  uint length;
280
281
  /*
281
 
    buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + MYSQL_ERRMSG_SIZE:512
 
282
    buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + DRIZZLE_ERRMSG_SIZE:512
282
283
  */
283
 
  uchar buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
 
284
  uchar buff[2+1+SQLSTATE_LENGTH+DRIZZLE_ERRMSG_SIZE], *pos;
284
285
 
285
286
  if (net->vio == 0)
286
287
  {
293
294
  {
294
295
    /* The first # is to make the protocol backward compatible */
295
296
    buff[2]= '#';
296
 
    pos= (uchar*) strmov((char*) buff+3, mysql_errno_to_sqlstate(sql_errno));
 
297
    pos= (uchar*) strmov((char*) buff+3, drizzle_errno_to_sqlstate(sql_errno));
297
298
  }
298
 
  length= (uint) (strmake((char*) pos, err, MYSQL_ERRMSG_SIZE-1) -
 
299
  length= (uint) (strmake((char*) pos, err, DRIZZLE_ERRMSG_SIZE-1) -
299
300
                  (char*) buff);
300
301
  err= (char*) buff;
301
302
 
807
808
    we support 0-6 decimals for time.
808
809
*/
809
810
 
810
 
bool Protocol_text::store(MYSQL_TIME *tm)
 
811
bool Protocol_text::store(DRIZZLE_TIME *tm)
811
812
{
812
813
  char buff[40];
813
814
  uint length;
825
826
}
826
827
 
827
828
 
828
 
bool Protocol_text::store_date(MYSQL_TIME *tm)
 
829
bool Protocol_text::store_date(DRIZZLE_TIME *tm)
829
830
{
830
831
  char buff[MAX_DATE_STRING_REP_LENGTH];
831
832
  size_t length= my_date_to_str(tm, buff);
839
840
    we support 0-6 decimals for time.
840
841
*/
841
842
 
842
 
bool Protocol_text::store_time(MYSQL_TIME *tm)
 
843
bool Protocol_text::store_time(DRIZZLE_TIME *tm)
843
844
{
844
845
  char buff[40];
845
846
  uint length;