~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump_data.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:
561
561
    throw std::exception();
562
562
  }
563
563
 
564
 
  boost::match_flag_type flags = boost::match_default; 
565
 
 
566
 
  boost::regex mysql_regex("(5\\.[0-9]+\\.[0-9]+)");
567
 
  boost::regex drizzle_regex("(20[0-9]{2}\\.(0[1-9]|1[012])\\.[0-9]+)");
568
 
 
569
 
  std::string version(getServerVersion());
570
 
 
571
 
  if (regex_search(version, mysql_regex, flags))
572
 
    serverType= SERVER_MYSQL_FOUND;
573
 
  else if (regex_search(version, drizzle_regex, flags))
574
 
    serverType= SERVER_DRIZZLE_FOUND;
575
 
  else
576
 
    serverType= SERVER_UNKNOWN_FOUND;
 
564
  ServerDetect server_detect= ServerDetect(&connection);
 
565
 
 
566
  serverType= server_detect.getServerType();
 
567
  serverVersion= server_detect.getServerVersion();
577
568
}
578
569
 
579
570
drizzle_result_st* DrizzleDumpConnection::query(std::string &str_query)