~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.cc

  • Committer: Monty Taylor
  • Author(s): Andrew Hutchings
  • Date: 2011-02-21 13:59:06 UTC
  • mto: This revision was merged to the branch mainline in revision 2190.
  • Revision ID: andrew@linuxjedi.co.uk-20110221135906-mywndoq7oypdumya
Separate the server detection functions into a .h file
Include the new .h in drizzle to detect if we are connecting to drizzled
If we are connecting to drizzled output TRUE/FALSE for boolean

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
    cout << "-- Host: " << current_host << "    Database: " << db_name << endl;
242
242
    cout << "-- ------------------------------------------------------" << endl;
243
243
    cout << "-- Server version\t" << db_connection->getServerVersion();
244
 
    if (db_connection->getServerType() == DrizzleDumpConnection::SERVER_MYSQL_FOUND)
 
244
    if (db_connection->getServerType() == ServerDetect::SERVER_MYSQL_FOUND)
245
245
      cout << " (MySQL server)";
246
 
    else if (db_connection->getServerType() == DrizzleDumpConnection::SERVER_DRIZZLE_FOUND)
 
246
    else if (db_connection->getServerType() == ServerDetect::SERVER_DRIZZLE_FOUND)
247
247
      cout << " (Drizzle server)";
248
248
    cout << endl << endl;
249
249
  }
351
351
    std::cerr << _("-- Retrieving database structures...") << std::endl;
352
352
 
353
353
  /* Blocking the MySQL privilege tables too because we can't import them due to bug#646187 */
354
 
  if (db_connection->getServerType() == DrizzleDumpConnection::SERVER_MYSQL_FOUND)
 
354
  if (db_connection->getServerType() == ServerDetect::SERVER_MYSQL_FOUND)
355
355
    query= "SELECT SCHEMA_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('information_schema', 'performance_schema', 'mysql')";
356
356
  else
357
357
    query= "SELECT SCHEMA_NAME, DEFAULT_COLLATION_NAME FROM DATA_DICTIONARY.SCHEMAS WHERE SCHEMA_NAME NOT IN ('information_schema','data_dictionary')";
360
360
  while ((row= drizzle_row_next(tableres)))
361
361
  {
362
362
    std::string database_name(row[0]);
363
 
    if (db_connection->getServerType() == DrizzleDumpConnection::SERVER_MYSQL_FOUND)
 
363
    if (db_connection->getServerType() == ServerDetect::SERVER_MYSQL_FOUND)
364
364
      database= new DrizzleDumpDatabaseMySQL(database_name, db_connection);
365
365
    else
366
366
      database= new DrizzleDumpDatabaseDrizzle(database_name, db_connection);
383
383
  for (vector<string>::const_iterator it= db_names.begin(); it != db_names.end(); ++it)
384
384
  {
385
385
    temp= *it;
386
 
    if (db_connection->getServerType() == DrizzleDumpConnection::SERVER_MYSQL_FOUND)
 
386
    if (db_connection->getServerType() == ServerDetect::SERVER_MYSQL_FOUND)
387
387
      database= new DrizzleDumpDatabaseMySQL(temp, db_connection);
388
388
    else
389
389
      database= new DrizzleDumpDatabaseDrizzle(temp, db_connection);
396
396
{
397
397
  DrizzleDumpDatabase *database;
398
398
 
399
 
  if (db_connection->getServerType() == DrizzleDumpConnection::SERVER_MYSQL_FOUND)
 
399
  if (db_connection->getServerType() == ServerDetect::SERVER_MYSQL_FOUND)
400
400
    database= new DrizzleDumpDatabaseMySQL(db, db_connection);
401
401
  else
402
402
    database= new DrizzleDumpDatabaseDrizzle(db, db_connection);
742
742
    maybe_exit(EX_DRIZZLEERR);
743
743
  }
744
744
 
745
 
  if ((db_connection->getServerType() == DrizzleDumpConnection::SERVER_MYSQL_FOUND) and (not opt_data_is_mangled))
 
745
  if ((db_connection->getServerType() == ServerDetect::SERVER_MYSQL_FOUND) and (not opt_data_is_mangled))
746
746
    db_connection->queryNoResult("SET NAMES 'utf8'");
747
747
 
748
748
  if (vm.count("destination-type"))