~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/client.c

Merging stdize-code with main trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2008 Drizzle Open Source Project
2
 
 
3
 
   This program is free software; you can redistribute it and/or modify
4
 
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; version 2 of the License.
6
 
 
7
 
   This program is distributed in the hope that it will be useful,
8
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
   GNU General Public License for more details.
11
 
 
12
 
   You should have received a copy of the GNU General Public License
13
 
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2008 MySQL
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 */
 
20
 
15
21
 
16
22
/*
17
23
  This file is included by both libdrizzle.c (the DRIZZLE client C API)
101
107
static int wait_for_data(int fd, int32_t timeout);
102
108
int connect_with_timeout(int fd, const struct sockaddr *name, uint namelen, int32_t timeout);
103
109
 
104
 
CHARSET_INFO *default_client_charset_info = &my_charset_latin1;
 
110
CHARSET_INFO *default_client_charset_info = &my_charset_utf8_general_ci;
105
111
 
106
112
/* Server error code and message */
107
113
unsigned int drizzle_server_last_errno;
1363
1369
                             PROTOCOL_VERSION);
1364
1370
    goto error;
1365
1371
  }
1366
 
  end=strend((char*) net->read_pos+1);
 
1372
  end= strchr((char*) net->read_pos+1, '\0');
1367
1373
  drizzle->thread_id=uint4korr(end+1);
1368
1374
  end+=5;
1369
1375
  /*
1456
1462
    read_user_name((char*) end);
1457
1463
 
1458
1464
  /* We have to handle different version of handshake here */
1459
 
  end= strend(end) + 1;
 
1465
  end= strchr(end, '\0') + 1;
1460
1466
  if (passwd[0])
1461
1467
  {
1462
1468
    {