提交 b6e04604 编写于 作者: H Haojun Liao

[td-3967]

上级 9e1a04ee
......@@ -468,11 +468,7 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, SSqlCmd *pCmd, int1
int32_t j = 0;
for (uint32_t k = 1; k < sToken.n - 1; ++k) {
if (sToken.z[k] == '\\' || (sToken.z[k] == delim && sToken.z[k + 1] == delim)) {
if (sToken.z[k] == '\\') {
tmpTokenBuf[j] = GET_ESCAPE_CHAR(sToken.z[k+1]);
} else {
tmpTokenBuf[j] = sToken.z[k + 1];
}
cnt++;
j++;
......
......@@ -415,7 +415,7 @@ uint32_t tGetToken(char* z, uint32_t* tokenId) {
int delim = z[0];
bool strEnd = false;
for (i = 1; z[i]; i++) {
if (z[i] == '\\') {
if (z[i] == '\\') { // ignore the escaped character that follows this backslash
i++;
continue;
}
......
......@@ -57,12 +57,15 @@ class TDTestCase:
# https://www.ltg.ed.ac.uk/~richard/unicode-sample.html
# Basic Latin
data = r'! # $ % & ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~'
data = r'! # $ % & ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~'
tdLog.info("insert Basic Latin %d length data: %s" % (len(data), data))
tdSql.execute("insert into tb values (now, '%s')" % data)
tdSql.query("select * from tb")
tdSql.checkRows(3)
data = data.replace('\\\\', '\\')
tdSql.checkData(2, 1, data)
# tdSql.execute("insert into tb values(now, 'abc')")
# Latin-1 Supplement
data = ' ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册