--- misc/mysql_splitter/splitter.cpp 2011/05/11 10:14:11 1458 +++ misc/mysql_splitter/splitter.cpp 2011/05/11 11:11:42 1459 @@ -101,17 +101,20 @@ return 2; } - time_t start = time(NULL); + time_t start = time(NULL); + + const char* SEARCH = "CREATE DATABASE"; + const int SEARCHLEN = strlen(SEARCH); while ( in.good() ) { in.getline(linebuf, BUFSIZE); - string line(linebuf); - //if (line.substr(0, 15) == "CREATE DATABASE" ) { - if ( boost::starts_with(line, "CREATE DATABASE") ) { + //if ( boost::starts_with(line, "CREATE DATABASE") ) { + if (strncmp(linebuf,SEARCH, SEARCHLEN) == 0) { + string line(linebuf); if (out.is_open() ) { out.close(); } @@ -145,9 +148,9 @@ if (out.is_open() ) { - out << line << endl; + out << linebuf << endl; } else { - header << line << endl; //collect preamble for later use + header << linebuf << endl; //collect preamble for later use } }