提交 e2bf05e7 编写于 作者: D dapan1121

fix sql convertion issue

上级 dd6f16ff
...@@ -209,7 +209,7 @@ char* strtolower(char *dst, const char *src) { ...@@ -209,7 +209,7 @@ char* strtolower(char *dst, const char *src) {
} }
char* strntolower(char *dst, const char *src, int32_t n) { char* strntolower(char *dst, const char *src, int32_t n) {
int esc = 0; int esc = 0, inEsc = 0;
char quote = 0, *p = dst, c; char quote = 0, *p = dst, c;
assert(dst != NULL); assert(dst != NULL);
...@@ -226,10 +226,16 @@ char* strntolower(char *dst, const char *src, int32_t n) { ...@@ -226,10 +226,16 @@ char* strntolower(char *dst, const char *src, int32_t n) {
} else if (c == quote) { } else if (c == quote) {
quote = 0; quote = 0;
} }
} else if (inEsc) {
if (c == '`') {
inEsc = 0;
}
} else if (c >= 'A' && c <= 'Z') { } else if (c >= 'A' && c <= 'Z') {
c -= 'A' - 'a'; c -= 'A' - 'a';
} else if (c == '\'' || c == '"') { } else if (inEsc == 0 && (c == '\'' || c == '"')) {
quote = c; quote = c;
} else if (c == '`' && quote == 0) {
inEsc = 1;
} }
*p++ = c; *p++ = c;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册