~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzletest.cc

Remove PLUGIN and MODULES.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
#ifdef HAVE_SYS_WAIT_H
51
51
#include <sys/wait.h>
52
52
#endif
 
53
#include <cassert>
 
54
#include <sys/stat.h>
 
55
#include <sys/types.h>
 
56
#include <fcntl.h>
53
57
 
54
58
#include PCRE_HEADER
55
59
 
60
64
/* Added this for string translation. */
61
65
#include "drizzled/gettext.h"
62
66
#include "drizzled/hash.h"
 
67
#include "drizzled/my_time.h"
 
68
#include "drizzled/charset.h"
63
69
 
64
70
#ifndef DRIZZLE_RETURN_SERVER_GONE
65
71
#define DRIZZLE_RETURN_HANDSHAKE_FAILED DRIZZLE_RETURN_ERROR_CODE
109
115
static bool abort_on_error= true;
110
116
static bool server_initialized= false;
111
117
static bool is_windows= false;
 
118
static bool opt_mysql= false;
112
119
static char **default_argv;
113
120
static const char *load_default_groups[]= { "drizzletest", "client", 0 };
114
121
static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer;
1335
1342
 
1336
1343
*/
1337
1344
 
1338
 
static int compare_files2(File fd, const char* filename2)
 
1345
static int compare_files2(int fd, const char* filename2)
1339
1346
{
1340
1347
  int error= RESULT_OK;
1341
 
  File fd2;
 
1348
  int fd2;
1342
1349
  uint32_t len, len2;
1343
1350
  char buff[512], buff2[512];
1344
1351
  const char *fname= filename2;
1413
1420
 
1414
1421
static int compare_files(const char* filename1, const char* filename2)
1415
1422
{
1416
 
  File fd;
 
1423
  int fd;
1417
1424
  int error;
1418
1425
 
1419
1426
  if ((fd= my_open(filename1, O_RDONLY, MYF(0))) < 0)
1442
1449
static int string_cmp(string* ds, const char *fname)
1443
1450
{
1444
1451
  int error;
1445
 
  File fd;
 
1452
  int fd;
1446
1453
  char temp_file_path[FN_REFLEN];
1447
1454
 
1448
1455
  if ((fd= create_temp_file(temp_file_path, NULL,
2961
2968
static void do_perl(struct st_command *command)
2962
2969
{
2963
2970
  int error;
2964
 
  File fd;
 
2971
  int fd;
2965
2972
  FILE *res_file;
2966
2973
  char buf[FN_REFLEN];
2967
2974
  char temp_file_path[FN_REFLEN];
3924
3931
    die("Failed on drizzle_create()");
3925
3932
  if (!drizzle_con_create(con_slot->drizzle, &con_slot->con))
3926
3933
    die("Failed on drizzle_con_create()");
 
3934
  if (opt_mysql)
 
3935
    drizzle_con_add_options(&con_slot->con, DRIZZLE_CON_MYSQL);
3927
3936
 
3928
3937
  /* Use default db name */
3929
3938
  if (ds_database.length() == 0)
4143
4152
 
4144
4153
*/
4145
4154
 
 
4155
 
 
4156
static int my_strnncoll_simple(const CHARSET_INFO * const  cs, const unsigned char *s, size_t slen,
 
4157
                               const unsigned char *t, size_t tlen,
 
4158
                               bool t_is_prefix)
 
4159
{
 
4160
  size_t len = ( slen > tlen ) ? tlen : slen;
 
4161
  unsigned char *map= cs->sort_order;
 
4162
  if (t_is_prefix && slen > tlen)
 
4163
    slen=tlen;
 
4164
  while (len--)
 
4165
  {
 
4166
    if (map[*s++] != map[*t++])
 
4167
      return ((int) map[s[-1]] - (int) map[t[-1]]);
 
4168
  }
 
4169
  /*
 
4170
    We can't use (slen - tlen) here as the result may be outside of the
 
4171
    precision of a signed int
 
4172
  */
 
4173
  return slen > tlen ? 1 : slen < tlen ? -1 : 0 ;
 
4174
}
 
4175
 
4146
4176
static int read_line(char *buf, int size)
4147
4177
{
4148
4178
  char c, last_quote= 0;
4576
4606
   "Max number of connection attempts when connecting to server",
4577
4607
   (char**) &opt_max_connect_retries, (char**) &opt_max_connect_retries, 0,
4578
4608
   GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
 
4609
  {"mysql", 'm', N_("Use MySQL Protocol."),
 
4610
   (char**) &opt_mysql, (char**) &opt_mysql, 0, GET_BOOL, NO_ARG, 0, 0, 0,
 
4611
   0, 0, 0},
4579
4612
  {"password", 'P', "Password to use when connecting to server.",
4580
4613
   0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
4581
4614
  {"port", 'p', "Port number to use for connection or 0 for default to, in "
5585
5618
    die("Failed in drizzle_create()");
5586
5619
  if (!( drizzle_con_create(cur_con->drizzle, &cur_con->con)))
5587
5620
    die("Failed in drizzle_con_create()");
 
5621
  if (opt_mysql)
 
5622
    drizzle_con_add_options(&cur_con->con, DRIZZLE_CON_MYSQL);
5588
5623
 
5589
5624
  if (!(cur_con->name = strdup("default")))
5590
5625
    die("Out of memory");