diff --git a/examples/c/apitest.c b/examples/c/apitest.c index 597a108a2686b4dd501513ea895c25a2de1b8dad..c5867fc4f83c9b7bec54f27ee534f153277035cb 100644 --- a/examples/c/apitest.c +++ b/examples/c/apitest.c @@ -279,7 +279,8 @@ void verify_schema_less(TAOS* taos) { int code = 0, affected_rows = 0; char* lines[] = { - "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000", + // test support \n \t \r + "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"aaa\tbbb\nccc\\\\tddd\\\\neee\\nfff\\rggg\\thhh\",c2=false,c4=4f64 1626006833639000000", "st,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833640000000", "ste,t2=5f64,t3=L\"ste\" c1=true,c2=4i64,c3=\"iam\" 1626056811823316532", "st,t1=4i64,t2=5f64,t3=\"t4\" c1=3i64,c3=L\"passitagain\",c2=true,c4=5f64 1626006833642000000", diff --git a/src/client/src/tscParseLineProtocol.c b/src/client/src/tscParseLineProtocol.c index 3d61b9e3fcf2bd74a5e757a6107613ec6fcea5ea..3ddf8609907b27e55dd55a08744d449af132d537 100644 --- a/src/client/src/tscParseLineProtocol.c +++ b/src/client/src/tscParseLineProtocol.c @@ -2116,7 +2116,7 @@ static int32_t parseSmlValue(TAOS_SML_KV *pKV, const char **idx, int32_t sqlLen, switch (tag_state) { case tag_common: if (back_slash == true) { - if (*cur != ',' && *cur != '=' && *cur != ' ' && *cur != 'n' ) { + if (*cur != ',' && *cur != '=' && *cur != ' ' && *cur != 'n' && *cur != 't' && *cur != 'r') { tscError("SML:0x%"PRIx64" tag value: state(%d), incorrect character(%c) escaped", info->id, tag_state, *cur); ret = TSDB_CODE_TSC_LINE_SYNTAX_ERROR; goto error; @@ -2176,7 +2176,7 @@ static int32_t parseSmlValue(TAOS_SML_KV *pKV, const char **idx, int32_t sqlLen, break; case tag_lqoute: if (back_slash == true) { - if (*cur != ',' && *cur != '=' && *cur != ' ' && *cur != 'n') { + if (*cur != ',' && *cur != '=' && *cur != ' ' && *cur != 'n' && *cur != 't' && *cur != 'r') { tscError("SML:0x%"PRIx64" tag value: state(%d), incorrect character(%c) escaped", info->id, tag_state, *cur); ret = TSDB_CODE_TSC_LINE_SYNTAX_ERROR; goto error; @@ -2231,7 +2231,7 @@ static int32_t parseSmlValue(TAOS_SML_KV *pKV, const char **idx, int32_t sqlLen, switch (val_state) { case val_common: if (back_slash == true) { - if (*cur != '\\' && *cur != '"' && *cur != 'n') { + if (*cur != '\\' && *cur != '"' && *cur != 'n' && *cur != 't' && *cur != 'r') { tscError("SML:0x%"PRIx64" field value: state(%d), incorrect character(%c) escaped", info->id, val_state, *cur); ret = TSDB_CODE_TSC_LINE_SYNTAX_ERROR; goto error; @@ -2319,7 +2319,7 @@ static int32_t parseSmlValue(TAOS_SML_KV *pKV, const char **idx, int32_t sqlLen, break; case val_lqoute: if (back_slash == true) { - if (*cur != '\\' && *cur != '"' && *cur != 'n') { + if (*cur != '\\' && *cur != '"' && *cur != 'n' && *cur != 't' && *cur != 'r') { tscError("SML:0x%"PRIx64" field value: state(%d), incorrect character(%c) escaped", info->id, val_state, *cur); ret = TSDB_CODE_TSC_LINE_SYNTAX_ERROR; goto error;