diff --git a/packaging/deb/makedeb.sh b/packaging/deb/makedeb.sh index d54953113adf0b872bf538f17b97034f96483c37..e4c795f1b893f78a267faccd38cf1476aa30eba3 100755 --- a/packaging/deb/makedeb.sh +++ b/packaging/deb/makedeb.sh @@ -49,6 +49,7 @@ cp ${compile_dir}/build/bin/taosd ${pkg_dir}${install_home_pat cp ${compile_dir}/build/bin/taos ${pkg_dir}${install_home_path}/bin cp ${compile_dir}/build/lib/${libfile} ${pkg_dir}${install_home_path}/driver cp ${compile_dir}/../src/inc/taos.h ${pkg_dir}${install_home_path}/include +cp ${compile_dir}/../src/inc/taoserror.h ${pkg_dir}${install_home_path}/include cp -r ${top_dir}/tests/examples/* ${pkg_dir}${install_home_path}/examples cp -r ${top_dir}/src/connector/grafana ${pkg_dir}${install_home_path}/connector cp -r ${top_dir}/src/connector/python ${pkg_dir}${install_home_path}/connector diff --git a/packaging/rpm/tdengine.spec b/packaging/rpm/tdengine.spec index 6e9e5e6f8776607abb3ccc11296d0cf14cd90ba3..9ede4102e7c2e1903a2788c3559b5e41dd3cd196 100644 --- a/packaging/rpm/tdengine.spec +++ b/packaging/rpm/tdengine.spec @@ -62,6 +62,7 @@ cp %{_compiledir}/build/bin/taosdemo %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin cp %{_compiledir}/build/lib/${libfile} %{buildroot}%{homepath}/driver cp %{_compiledir}/../src/inc/taos.h %{buildroot}%{homepath}/include +cp %{_compiledir}/../src/inc/taoserror.h %{buildroot}%{homepath}/include cp -r %{_compiledir}/../src/connector/grafana %{buildroot}%{homepath}/connector cp -r %{_compiledir}/../src/connector/python %{buildroot}%{homepath}/connector cp -r %{_compiledir}/../src/connector/go %{buildroot}%{homepath}/connector @@ -138,6 +139,7 @@ if [ $1 -eq 0 ];then ${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${cfg_link_dir}/* || : ${csudo} rm -f ${inc_link_dir}/taos.h || : + ${csudo} rm -f ${inc_link_dir}/taoserror.h || : ${csudo} rm -f ${lib_link_dir}/libtaos.* || : ${csudo} rm -f ${log_link_dir} || : diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index acd6c6ccce220479ce5778344edea4fbf85ea93f..4b653dec9c8307c1f893bad08d4ded6f7ece2b92 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -98,9 +98,10 @@ function install_lib() { } function install_header() { - ${csudo} rm -f ${inc_link_dir}/taos.h || : + ${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h || : ${csudo} cp -f ${script_dir}/inc/* ${install_main_dir}/include && ${csudo} chmod 644 ${install_main_dir}/include/* ${csudo} ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h + ${csudo} ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h } function install_config() { diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index 4660ba5b2aafb197f086fc7b4804c910116f49be..c43f918e8d520a38a0184f0a2a970f6fd78b7cf5 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -109,9 +109,10 @@ function install_lib() { function install_header() { - ${csudo} rm -f ${inc_link_dir}/taos.h || : - ${csudo} cp -f ${source_dir}/src/inc/taos.h ${install_main_dir}/include && ${csudo} chmod 644 ${install_main_dir}/include/* + ${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h || : + ${csudo} cp -f ${source_dir}/src/inc/taos.h ${source_dir}/src/inc/taoserror.h ${install_main_dir}/include && ${csudo} chmod 644 ${install_main_dir}/include/* ${csudo} ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h + ${csudo} ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h } function install_config() { diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 1a24ae8a1f4481abc69e27d6e654bf80cbb3225c..967b14cee915d17aa9b8e5aacd1698a2382c4e5b 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -22,7 +22,7 @@ install_dir="${release_dir}/taos-${version}-${package_name}-$(echo ${build_time} bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${build_dir}/bin/taosdemo ${build_dir}/bin/taosdump ${script_dir}/remove.sh" versioninfo=$(${script_dir}/get_version.sh ${code_dir}/util/src/version.c) lib_files="${build_dir}/lib/libtaos.so.${versioninfo}" -header_files="${code_dir}/inc/taos.h" +header_files="${code_dir}/inc/taos.h ${code_dir}/inc/taoserror.h" cfg_files="${top_dir}/packaging/cfg/*.cfg" install_files="${script_dir}/install.sh ${script_dir}/install_client.sh" diff --git a/packaging/tools/post.sh b/packaging/tools/post.sh index 9e1878365737d614369d536932ba0b00918d2a4f..11f3ab9a9ba0ca75d62c0bca1d81d7b03ff3eb4c 100755 --- a/packaging/tools/post.sh +++ b/packaging/tools/post.sh @@ -61,8 +61,9 @@ function kill_taosd() { } function install_include() { - ${csudo} rm -f ${inc_link_dir}/taos.h || : + ${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h|| : ${csudo} ln -s ${inc_dir}/taos.h ${inc_link_dir}/taos.h + ${csudo} ln -s ${inc_dir}/taoserror.h ${inc_link_dir}/taoserror.h } function install_lib() { diff --git a/packaging/tools/preun.sh b/packaging/tools/preun.sh index 4566db1b5afd185c415238f6501277da3638fcdc..a08f4e304e6f46116644b16f346074660bb445c5 100755 --- a/packaging/tools/preun.sh +++ b/packaging/tools/preun.sh @@ -94,6 +94,7 @@ ${csudo} rm -f ${bin_link_dir}/taosdemo || : ${csudo} rm -f ${bin_link_dir}/taosdump || : ${csudo} rm -f ${cfg_link_dir}/* || : ${csudo} rm -f ${inc_link_dir}/taos.h || : +${csudo} rm -f ${inc_link_dir}/taoserror.h || : ${csudo} rm -f ${lib_link_dir}/libtaos.* || : ${csudo} rm -f ${log_link_dir} || : diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh index 4ada19762c55034751d64de0dd063100424b3503..6c2c6d5ea84fc25e8b3abe94a53e459b2bdb9a28 100755 --- a/packaging/tools/remove.sh +++ b/packaging/tools/remove.sh @@ -61,6 +61,7 @@ function clean_lib() { function clean_header() { # Remove link ${csudo} rm -f ${inc_link_dir}/taos.h || : + ${csudo} rm -f ${inc_link_dir}/taoserror.h || : } function clean_config() { diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index c8ce728de15858e2628bb6a8debd011197ecd184..abebea64df05c1bc6d9e48059074343724290a31 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -191,10 +191,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, *((int8_t *)payload) = TSDB_DATA_TINYINT_NULL; } else { numType = tscToInteger(pToken, &iv, &endptr); - if (errno == ERANGE || iv > INT8_MAX || iv <= INT8_MIN) { - INVALID_SQL_RET_MSG(msg, "data is overflow"); - } else if (TK_ILLEGAL == numType) { + if (TK_ILLEGAL == numType) { INVALID_SQL_RET_MSG(msg, "data is illegal"); + } else if (errno == ERANGE || iv > INT8_MAX || iv <= INT8_MIN) { + INVALID_SQL_RET_MSG(msg, "data is overflow"); } *((int8_t *)payload) = (int8_t)iv; @@ -210,10 +210,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, *((int16_t *)payload) = TSDB_DATA_SMALLINT_NULL; } else { numType = tscToInteger(pToken, &iv, &endptr); - if (errno == ERANGE || iv > INT16_MAX || iv <= INT16_MIN) { - INVALID_SQL_RET_MSG(msg, "data is overflow"); - } else if (TK_ILLEGAL == numType) { + if (TK_ILLEGAL == numType) { INVALID_SQL_RET_MSG(msg, "data is illegal"); + } else if (errno == ERANGE || iv > INT16_MAX || iv <= INT16_MIN) { + INVALID_SQL_RET_MSG(msg, "data is overflow"); } *((int16_t *)payload) = (int16_t)iv; @@ -228,10 +228,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, *((int32_t *)payload) = TSDB_DATA_INT_NULL; } else { numType = tscToInteger(pToken, &iv, &endptr); - if (errno == ERANGE || iv > INT32_MAX || iv <= INT32_MIN) { - INVALID_SQL_RET_MSG(msg, "data is overflow"); - } else if (TK_ILLEGAL == numType) { + if (TK_ILLEGAL == numType) { INVALID_SQL_RET_MSG(msg, "data is illegal"); + } else if (errno == ERANGE || iv > INT32_MAX || iv <= INT32_MIN) { + INVALID_SQL_RET_MSG(msg, "data is overflow"); } *((int32_t *)payload) = (int32_t)iv; @@ -247,10 +247,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, *((int64_t *)payload) = TSDB_DATA_BIGINT_NULL; } else { numType = tscToInteger(pToken, &iv, &endptr); - if (errno == ERANGE || iv > INT64_MAX || iv <= INT64_MIN) { - INVALID_SQL_RET_MSG(msg, "data is overflow"); - } else if (TK_ILLEGAL == numType) { + if (TK_ILLEGAL == numType) { INVALID_SQL_RET_MSG(msg, "data is illegal"); + } else if (errno == ERANGE || iv > INT64_MAX || iv <= INT64_MIN) { + INVALID_SQL_RET_MSG(msg, "data is overflow"); } *((int64_t *)payload) = iv;