~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleimport.cc

Merge Monty - Updates to pandora-build to support features of gcc 4.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <boost/program_options.hpp>
28
28
#include <pthread.h>
29
29
 
30
 
#include <drizzled/definitions.h>
31
 
#include <drizzled/internal/my_sys.h>
32
30
/* Added this for string translation. */
33
31
#include <drizzled/gettext.h>
34
32
#include <drizzled/configmake.h>
35
33
 
36
 
#include "user_detect.h"
37
 
 
38
34
namespace po= boost::program_options;
39
35
using namespace std;
40
36
using namespace drizzled;
43
39
 
44
40
int exitcode= 0;
45
41
 
46
 
const char *program_name= "drizzleimport";
 
42
const char *program_name= "drizzlesimport";
47
43
 
48
44
/* Global Thread counter */
49
45
uint32_t counter;
354
350
{
355
351
try
356
352
{
 
353
  int error=0;
 
354
 
357
355
  po::options_description commandline_options("Options used only in command line");
358
356
  commandline_options.add_options()
359
357
 
409
407
  "Port number to use for connection") 
410
408
  ("protocol", po::value<string>(&opt_protocol)->default_value("mysql"),
411
409
  "The protocol of connection (mysql or drizzle).")
412
 
  ("user,u", po::value<string>(&current_user)->default_value(UserDetect().getUser()),
 
410
  ("user,u", po::value<string>(&current_user)->default_value(""),
413
411
  "User for login if not current user.")
414
412
  ;
415
413
 
461
459
  po::notify(vm);
462
460
  if (vm.count("protocol"))
463
461
  {
464
 
    boost::to_lower(opt_protocol);
 
462
    std::transform(opt_protocol.begin(), opt_protocol.end(),
 
463
      opt_protocol.begin(), ::tolower);
 
464
 
465
465
    if (not opt_protocol.compare("mysql"))
466
466
      use_drizzle_protocol=false;
467
467
    else if (not opt_protocol.compare("drizzle"))
599
599
    }
600
600
 
601
601
    for (; *argv != NULL; argv++)
602
 
      if (int error= write_to_table(*argv, con))
 
602
      if ((error= write_to_table(*argv, con)))
603
603
        if (exitcode == 0)
604
604
          exitcode= error;
605
605
    db_disconnect(current_host, con);