~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: Brian Aker
  • Date: 2009-03-09 15:52:42 UTC
  • mfrom: (919.2.14 mordred)
  • Revision ID: brian@tangent.org-20090309155242-lv5dje0wgd44rcm8
Merge of Monty's work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
#include "client_priv.h"
37
37
#include <string>
38
 
#include CMATH_H
39
38
#include <algorithm>
40
39
#include <mystrings/m_ctype.h>
41
40
#include <stdarg.h>
116
115
 
117
116
#include <drizzled/gettext.h>
118
117
 
119
 
#if defined(CMATH_NAMESPACE)
120
 
  using namespace CMATH_NAMESPACE;
121
 
#endif
122
 
 
123
 
const char *VER= "14.14";
124
 
 
125
 
/* Don't try to make a nice table if the data is too big */
126
 
#define MAX_COLUMN_LENGTH       (uint32_t)1024
127
 
 
128
 
/* Buffer to hold 'version' and 'version_comment' */
129
 
#define MAX_SERVER_VERSION_LENGTH     128
130
118
 
131
119
void* sql_alloc(unsigned size);       // Don't use drizzled alloc for these
132
120
void sql_element_free(void *ptr);
137
125
#define vidattr(A) {}      // Can't get this to work
138
126
#endif
139
127
 
140
 
#ifdef FN_NO_CASE_SENCE
141
 
#define cmp_database(cs,A,B) my_strcasecmp((cs), (A), (B))
142
 
#else
143
 
#define cmp_database(cs,A,B) strcmp((A),(B))
144
 
#endif
145
 
 
146
128
#include "completion_hash.h"
147
129
 
148
130
using namespace std;
149
131
 
 
132
const string VER("14.14");
 
133
/* Don't try to make a nice table if the data is too big */
 
134
const uint32_t MAX_COLUMN_LENGTH= 1024;
 
135
 
 
136
/* Buffer to hold 'version' and 'version_comment' */
 
137
const int MAX_SERVER_VERSION_LENGTH= 128;
 
138
 
150
139
#define PROMPT_CHAR '\\'
151
140
#define DEFAULT_DELIMITER ";"
152
141
 
1455
1444
  const char* readline= "readline";
1456
1445
 
1457
1446
  printf(_("%s  Ver %s Distrib %s, for %s (%s) using %s %s\n"),
1458
 
         my_progname, VER, drizzleclient_get_client_info(),
 
1447
         my_progname, VER.c_str(), drizzleclient_get_client_info(),
1459
1448
         SYSTEM_TYPE, MACHINE_TYPE,
1460
1449
         readline, rl_library_version);
1461
1450
 
3542
3531
  */
3543
3532
  get_current_db();
3544
3533
 
3545
 
  if (!current_db || cmp_database(charset_info, current_db,tmp))
 
3534
  if (!current_db || strcmp(current_db,tmp))
3546
3535
  {
3547
3536
    if (one_database)
3548
3537
    {