~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/oldlibdrizzle/oldlibdrizzle.cc

  • Committer: Stewart Smith
  • Date: 2009-07-02 17:18:18 UTC
  • mfrom: (1085 staging)
  • mto: This revision was merged to the branch mainline in revision 1089.
  • Revision ID: stewart@flamingspork.com-20090702171818-qrp4d403iw8tazlg
mergeĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <drizzled/error.h>
22
22
#include <drizzled/sql_state.h>
23
23
#include <drizzled/session.h>
24
 
#include <drizzled/data_home.h>
25
24
#include "pack.h"
26
25
#include "errmsg.h"
27
26
#include "oldlibdrizzle.h"
28
27
 
 
28
#include <algorithm>
 
29
 
 
30
using namespace std;
 
31
 
29
32
#define PROTOCOL_VERSION 10
30
33
 
31
34
extern uint32_t drizzled_tcp_port;
165
168
    pos=drizzleclient_net_store_length(pos, session->main_da.last_insert_id());
166
169
    int2store(pos, session->main_da.server_status());
167
170
    pos+=2;
168
 
    tmp= cmin(session->main_da.total_warn_count(), (uint32_t)65535);
 
171
    tmp= min(session->main_da.total_warn_count(), (uint32_t)65535);
169
172
    message= session->main_da.message();
170
173
  }
171
174
  else
174
177
    pos=drizzleclient_net_store_length(pos, 0);
175
178
    int2store(pos, session->server_status);
176
179
    pos+=2;
177
 
    tmp= cmin(session->total_warn_count, (uint32_t)65535);
 
180
    tmp= min(session->total_warn_count, (uint32_t)65535);
178
181
  }
179
182
 
180
183
  /* We can only return up to 65535 warnings in two bytes */
239
242
    Don't send warn count during SP execution, as the warn_list
240
243
    is cleared between substatements, and mysqltest gets confused
241
244
  */
242
 
  uint32_t tmp= cmin(total_warn_count, (uint32_t)65535);
 
245
  uint32_t tmp= min(total_warn_count, (uint32_t)65535);
243
246
  buff[0]= DRIZZLE_PROTOCOL_NO_MORE_DATA;
244
247
  int2store(buff+1, tmp);
245
248
  /*
704
707
    server_capabilites|= CLIENT_COMPRESS;
705
708
#endif /* HAVE_COMPRESS */
706
709
 
707
 
    end= buff + strlen(server_version);
 
710
    end= buff + strlen(VERSION);
708
711
    if ((end - buff) >= SERVER_VERSION_LENGTH)
709
712
      end= buff + (SERVER_VERSION_LENGTH - 1);
710
 
    memcpy(buff, server_version, end - buff);
 
713
    memcpy(buff, VERSION, end - buff);
711
714
    *end= 0;
712
715
    end++;
713
716