| 52 | } |
| 53 | |
| 54 | void Util::string_replace(const std::string &src, const std::string &dst, |
| 55 | std::string *str) { |
| 56 | std::string::size_type pos = 0; |
| 57 | std::string::size_type srclen = src.size(); |
| 58 | std::string::size_type dstlen = dst.size(); |
| 59 | |
| 60 | while ((pos = str->find(src, pos)) != std::string::npos) { |
| 61 | str->replace(pos, srclen, dst); |
| 62 | pos += dstlen; |
| 63 | } |
| 64 | |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | // normalize sql for parse result after parse |
| 69 | std::string Util::normalize(const std::string &sql) { |