Merge branch 'develop' into test/TD-4463
This commit is contained in:
commit
b23d057366
|
@ -24,7 +24,7 @@ echo "compile_dir: ${compile_dir}"
|
||||||
echo "pkg_dir: ${pkg_dir}"
|
echo "pkg_dir: ${pkg_dir}"
|
||||||
|
|
||||||
if [ -d ${pkg_dir} ]; then
|
if [ -d ${pkg_dir} ]; then
|
||||||
rm -rf ${pkg_dir}
|
rm -rf ${pkg_dir}
|
||||||
fi
|
fi
|
||||||
mkdir -p ${pkg_dir}
|
mkdir -p ${pkg_dir}
|
||||||
cd ${pkg_dir}
|
cd ${pkg_dir}
|
||||||
|
@ -67,7 +67,41 @@ fi
|
||||||
cp -r ${top_dir}/src/connector/python ${pkg_dir}${install_home_path}/connector
|
cp -r ${top_dir}/src/connector/python ${pkg_dir}${install_home_path}/connector
|
||||||
cp -r ${top_dir}/src/connector/go ${pkg_dir}${install_home_path}/connector
|
cp -r ${top_dir}/src/connector/go ${pkg_dir}${install_home_path}/connector
|
||||||
cp -r ${top_dir}/src/connector/nodejs ${pkg_dir}${install_home_path}/connector
|
cp -r ${top_dir}/src/connector/nodejs ${pkg_dir}${install_home_path}/connector
|
||||||
cp ${compile_dir}/build/lib/taos-jdbcdriver*dist.* ${pkg_dir}${install_home_path}/connector ||:
|
cp ${compile_dir}/build/lib/taos-jdbcdriver*.* ${pkg_dir}${install_home_path}/connector ||:
|
||||||
|
|
||||||
|
if [ -f ${compile_dir}/build/bin/jemalloc-config ]; then
|
||||||
|
install_user_local_path="/usr/local"
|
||||||
|
mkdir -p ${pkg_dir}${install_user_local_path}/{bin,lib,lib/pkgconfig,include/jemalloc,share/doc/jemalloc,share/man/man3}
|
||||||
|
cp ${compile_dir}/build/bin/jemalloc-config ${pkg_dir}${install_user_local_path}/bin/
|
||||||
|
if [ -f ${compile_dir}/build/bin/jemalloc.sh ]; then
|
||||||
|
cp ${compile_dir}/build/bin/jemalloc.sh ${pkg_dir}${install_user_local_path}/bin/
|
||||||
|
fi
|
||||||
|
if [ -f ${compile_dir}/build/bin/jeprof ]; then
|
||||||
|
cp ${compile_dir}/build/bin/jeprof ${pkg_dir}${install_user_local_path}/bin/
|
||||||
|
fi
|
||||||
|
if [ -f ${compile_dir}/build/include/jemalloc/jemalloc.h ]; then
|
||||||
|
cp ${compile_dir}/build/include/jemalloc/jemalloc.h ${pkg_dir}${install_user_local_path}/include/jemalloc/
|
||||||
|
fi
|
||||||
|
if [ -f ${compile_dir}/build/lib/libjemalloc.so.2 ]; then
|
||||||
|
cp ${compile_dir}/build/lib/libjemalloc.so.2 ${pkg_dir}${install_user_local_path}/lib/
|
||||||
|
ln -sf libjemalloc.so.2 ${pkg_dir}${install_user_local_path}/lib/libjemalloc.so
|
||||||
|
fi
|
||||||
|
if [ -f ${compile_dir}/build/lib/libjemalloc.a ]; then
|
||||||
|
cp ${compile_dir}/build/lib/libjemalloc.a ${pkg_dir}${install_user_local_path}/lib/
|
||||||
|
fi
|
||||||
|
if [ -f ${compile_dir}/build/lib/libjemalloc_pic.a ]; then
|
||||||
|
cp ${compile_dir}/build/lib/libjemalloc_pic.a ${pkg_dir}${install_user_local_path}/lib/
|
||||||
|
fi
|
||||||
|
if [ -f ${compile_dir}/build/lib/pkgconfig/jemalloc.pc ]; then
|
||||||
|
cp ${compile_dir}/build/lib/pkgconfig/jemalloc.pc ${pkg_dir}${install_user_local_path}/lib/pkgconfig/
|
||||||
|
fi
|
||||||
|
if [ -f ${compile_dir}/build/share/doc/jemalloc/jemalloc.html ]; then
|
||||||
|
cp ${compile_dir}/build/share/doc/jemalloc/jemalloc.html ${pkg_dir}${install_user_local_path}/share/doc/jemalloc/
|
||||||
|
fi
|
||||||
|
if [ -f ${compile_dir}/build/share/man/man3/jemalloc.3 ]; then
|
||||||
|
cp ${compile_dir}/build/share/man/man3/jemalloc.3 ${pkg_dir}${install_user_local_path}/share/man/man3/
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
cp -r ${compile_dir}/../packaging/deb/DEBIAN ${pkg_dir}/
|
cp -r ${compile_dir}/../packaging/deb/DEBIAN ${pkg_dir}/
|
||||||
chmod 755 ${pkg_dir}/DEBIAN/*
|
chmod 755 ${pkg_dir}/DEBIAN/*
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
%define homepath /usr/local/taos
|
%define homepath /usr/local/taos
|
||||||
|
%define userlocalpath /usr/local
|
||||||
%define cfg_install_dir /etc/taos
|
%define cfg_install_dir /etc/taos
|
||||||
%define __strip /bin/true
|
%define __strip /bin/true
|
||||||
|
|
||||||
|
@ -75,9 +76,53 @@ fi
|
||||||
cp -r %{_compiledir}/../src/connector/python %{buildroot}%{homepath}/connector
|
cp -r %{_compiledir}/../src/connector/python %{buildroot}%{homepath}/connector
|
||||||
cp -r %{_compiledir}/../src/connector/go %{buildroot}%{homepath}/connector
|
cp -r %{_compiledir}/../src/connector/go %{buildroot}%{homepath}/connector
|
||||||
cp -r %{_compiledir}/../src/connector/nodejs %{buildroot}%{homepath}/connector
|
cp -r %{_compiledir}/../src/connector/nodejs %{buildroot}%{homepath}/connector
|
||||||
cp %{_compiledir}/build/lib/taos-jdbcdriver*dist.* %{buildroot}%{homepath}/connector ||:
|
cp %{_compiledir}/build/lib/taos-jdbcdriver*.* %{buildroot}%{homepath}/connector ||:
|
||||||
cp -r %{_compiledir}/../tests/examples/* %{buildroot}%{homepath}/examples
|
cp -r %{_compiledir}/../tests/examples/* %{buildroot}%{homepath}/examples
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f %{_compiledir}/build/bin/jemalloc-config ]; then
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/bin
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/lib
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/lib/pkgconfig
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/include
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/include/jemalloc
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/share
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/share/doc
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/share/doc/jemalloc
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/share/man
|
||||||
|
mkdir -p %{buildroot}%{userlocalpath}/share/man/man3
|
||||||
|
|
||||||
|
cp %{_compiledir}/build/bin/jemalloc-config %{buildroot}%{userlocalpath}/bin/
|
||||||
|
if [ -f %{_compiledir}/build/bin/jemalloc.sh ]; then
|
||||||
|
cp %{_compiledir}/build/bin/jemalloc.sh %{buildroot}%{userlocalpath}/bin/
|
||||||
|
fi
|
||||||
|
if [ -f %{_compiledir}/build/bin/jeprof ]; then
|
||||||
|
cp %{_compiledir}/build/bin/jeprof %{buildroot}%{userlocalpath}/bin/
|
||||||
|
fi
|
||||||
|
if [ -f %{_compiledir}/build/include/jemalloc/jemalloc.h ]; then
|
||||||
|
cp %{_compiledir}/build/include/jemalloc/jemalloc.h %{buildroot}%{userlocalpath}/include/jemalloc/
|
||||||
|
fi
|
||||||
|
if [ -f %{_compiledir}/build/lib/libjemalloc.so.2 ]; then
|
||||||
|
cp %{_compiledir}/build/lib/libjemalloc.so.2 %{buildroot}%{userlocalpath}/lib/
|
||||||
|
ln -sf libjemalloc.so.2 %{buildroot}%{userlocalpath}/lib/libjemalloc.so
|
||||||
|
fi
|
||||||
|
if [ -f %{_compiledir}/build/lib/libjemalloc.a ]; then
|
||||||
|
cp %{_compiledir}/build/lib/libjemalloc.a %{buildroot}%{userlocalpath}/lib/
|
||||||
|
fi
|
||||||
|
if [ -f %{_compiledir}/build/lib/libjemalloc_pic.a ]; then
|
||||||
|
cp %{_compiledir}/build/lib/libjemalloc_pic.a %{buildroot}%{userlocalpath}/lib/
|
||||||
|
fi
|
||||||
|
if [ -f %{_compiledir}/build/lib/pkgconfig/jemalloc.pc ]; then
|
||||||
|
cp %{_compiledir}/build/lib/pkgconfig/jemalloc.pc %{buildroot}%{userlocalpath}/lib/pkgconfig/
|
||||||
|
fi
|
||||||
|
if [ -f %{_compiledir}/build/share/doc/jemalloc/jemalloc.html ]; then
|
||||||
|
cp %{_compiledir}/build/share/doc/jemalloc/jemalloc.html %{buildroot}%{userlocalpath}/share/doc/jemalloc/
|
||||||
|
fi
|
||||||
|
if [ -f %{_compiledir}/build/share/man/man3/jemalloc.3 ]; then
|
||||||
|
cp %{_compiledir}/build/share/man/man3/jemalloc.3 %{buildroot}%{userlocalpath}/share/man/man3/
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
#Scripts executed before installation
|
#Scripts executed before installation
|
||||||
%pre
|
%pre
|
||||||
csudo=""
|
csudo=""
|
||||||
|
|
|
@ -217,7 +217,7 @@ function install_lib() {
|
||||||
${csudo} ln -s ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so || :
|
${csudo} ln -s ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so || :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#if [ "$verMode" == "cluster" ]; then
|
#if [ "$verMode" == "cluster" ]; then
|
||||||
# # Compatible with version 1.5
|
# # Compatible with version 1.5
|
||||||
# ${csudo} mkdir -p ${v15_java_app_dir}
|
# ${csudo} mkdir -p ${v15_java_app_dir}
|
||||||
# ${csudo} ln -s ${install_main_dir}/connector/taos-jdbcdriver-1.0.2-dist.jar ${v15_java_app_dir}/JDBCDriver-1.0.2-dist.jar
|
# ${csudo} ln -s ${install_main_dir}/connector/taos-jdbcdriver-1.0.2-dist.jar ${v15_java_app_dir}/JDBCDriver-1.0.2-dist.jar
|
||||||
|
@ -227,6 +227,52 @@ function install_lib() {
|
||||||
${csudo} ldconfig
|
${csudo} ldconfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function install_jemalloc() {
|
||||||
|
jemalloc_dir=${script_dir}/jemalloc
|
||||||
|
|
||||||
|
if [ -d ${jemalloc_dir} ]; then
|
||||||
|
${csudo} /usr/bin/install -c -d /usr/local/bin
|
||||||
|
|
||||||
|
if [ -f ${jemalloc_dir}/bin/jemalloc-config ]; then
|
||||||
|
${csudo} /usr/bin/install -c -m 755 ${jemalloc_dir}/bin/jemalloc-config /usr/local/bin
|
||||||
|
fi
|
||||||
|
if [ -f ${jemalloc_dir}/bin/jemalloc.sh ]; then
|
||||||
|
${csudo} /usr/bin/install -c -m 755 ${jemalloc_dir}/bin/jemalloc.sh /usr/local/bin
|
||||||
|
fi
|
||||||
|
if [ -f ${jemalloc_dir}/bin/jeprof ]; then
|
||||||
|
${csudo} /usr/bin/install -c -m 755 ${jemalloc_dir}/bin/jeprof /usr/local/bin
|
||||||
|
fi
|
||||||
|
if [ -f ${jemalloc_dir}/include/jemalloc/jemalloc.h ]; then
|
||||||
|
${csudo} /usr/bin/install -c -d /usr/local/include/jemalloc
|
||||||
|
${csudo} /usr/bin/install -c -m 644 ${jemalloc_dir}/include/jemalloc/jemalloc.h /usr/local/include/jemalloc
|
||||||
|
fi
|
||||||
|
if [ -f ${jemalloc_dir}/lib/libjemalloc.so.2 ]; then
|
||||||
|
${csudo} /usr/bin/install -c -d /usr/local/lib
|
||||||
|
${csudo} /usr/bin/install -c -m 755 ${jemalloc_dir}/lib/libjemalloc.so.2 /usr/local/lib
|
||||||
|
${csudo} ln -sf libjemalloc.so.2 /usr/local/lib/libjemalloc.so
|
||||||
|
${csudo} /usr/bin/install -c -d /usr/local/lib
|
||||||
|
if [ -f ${jemalloc_dir}/lib/libjemalloc.a ]; then
|
||||||
|
${csudo} /usr/bin/install -c -m 755 ${jemalloc_dir}/lib/libjemalloc.a /usr/local/lib
|
||||||
|
fi
|
||||||
|
if [ -f ${jemalloc_dir}/lib/libjemalloc_pic.a ]; then
|
||||||
|
${csudo} /usr/bin/install -c -m 755 ${jemalloc_dir}/lib/libjemalloc_pic.a /usr/local/lib
|
||||||
|
fi
|
||||||
|
if [ -f ${jemalloc_dir}/lib/libjemalloc_pic.a ]; then
|
||||||
|
${csudo} /usr/bin/install -c -d /usr/local/lib/pkgconfig
|
||||||
|
${csudo} /usr/bin/install -c -m 644 ${jemalloc_dir}/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -f ${jemalloc_dir}/share/doc/jemalloc/jemalloc.html ]; then
|
||||||
|
${csudo} /usr/bin/install -c -d /usr/local/share/doc/jemalloc
|
||||||
|
${csudo} /usr/bin/install -c -m 644 ${jemalloc_dir}/share/doc/jemalloc/jemalloc.html /usr/local/share/doc/jemalloc
|
||||||
|
fi
|
||||||
|
if [ -f ${jemalloc_dir}/share/man/man3/jemalloc.3 ]; then
|
||||||
|
${csudo} /usr/bin/install -c -d /usr/local/share/man/man3
|
||||||
|
${csudo} /usr/bin/install -c -m 644 ${jemalloc_dir}/share/man/man3/jemalloc.3 /usr/local/share/man/man3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function install_header() {
|
function install_header() {
|
||||||
${csudo} rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.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} cp -f ${script_dir}/inc/* ${install_main_dir}/include && ${csudo} chmod 644 ${install_main_dir}/include/*
|
||||||
|
@ -252,7 +298,7 @@ function add_newHostname_to_hosts() {
|
||||||
|
|
||||||
function set_hostname() {
|
function set_hostname() {
|
||||||
echo -e -n "${GREEN}Please enter one hostname(must not be 'localhost')${NC}:"
|
echo -e -n "${GREEN}Please enter one hostname(must not be 'localhost')${NC}:"
|
||||||
read newHostname
|
read newHostname
|
||||||
while true; do
|
while true; do
|
||||||
if [[ ! -z "$newHostname" && "$newHostname" != "localhost" ]]; then
|
if [[ ! -z "$newHostname" && "$newHostname" != "localhost" ]]; then
|
||||||
break
|
break
|
||||||
|
@ -360,27 +406,27 @@ function local_fqdn_check() {
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -r -p "Set hostname now? [Y/n] " input
|
read -r -p "Set hostname now? [Y/n] " input
|
||||||
if [ ! -n "$input" ]; then
|
if [ ! -n "$input" ]; then
|
||||||
set_hostname
|
set_hostname
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
case $input in
|
case $input in
|
||||||
[yY][eE][sS]|[yY])
|
[yY][eE][sS]|[yY])
|
||||||
set_hostname
|
set_hostname
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
|
||||||
[nN][oO]|[nN])
|
[nN][oO]|[nN])
|
||||||
set_ipAsFqdn
|
set_ipAsFqdn
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Invalid input..."
|
echo "Invalid input..."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -589,7 +635,7 @@ function clean_service_on_systemd() {
|
||||||
fi
|
fi
|
||||||
${csudo} systemctl disable nginxd &> /dev/null || echo &> /dev/null
|
${csudo} systemctl disable nginxd &> /dev/null || echo &> /dev/null
|
||||||
${csudo} rm -f ${nginx_service_config}
|
${csudo} rm -f ${nginx_service_config}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# taos:2345:respawn:/etc/init.d/taosd start
|
# taos:2345:respawn:/etc/init.d/taosd start
|
||||||
|
@ -674,7 +720,7 @@ function install_service_on_systemd() {
|
||||||
${csudo} systemctl enable nginxd
|
${csudo} systemctl enable nginxd
|
||||||
fi
|
fi
|
||||||
${csudo} systemctl start nginxd
|
${csudo} systemctl start nginxd
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_service() {
|
function install_service() {
|
||||||
|
@ -776,6 +822,7 @@ function update_TDengine() {
|
||||||
install_log
|
install_log
|
||||||
install_header
|
install_header
|
||||||
install_lib
|
install_lib
|
||||||
|
install_jemalloc
|
||||||
if [ "$pagMode" != "lite" ]; then
|
if [ "$pagMode" != "lite" ]; then
|
||||||
install_connector
|
install_connector
|
||||||
fi
|
fi
|
||||||
|
@ -786,7 +833,7 @@ function update_TDengine() {
|
||||||
install_config
|
install_config
|
||||||
|
|
||||||
openresty_work=false
|
openresty_work=false
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
# Check if openresty is installed
|
# Check if openresty is installed
|
||||||
# Check if nginx is installed successfully
|
# Check if nginx is installed successfully
|
||||||
if type curl &> /dev/null; then
|
if type curl &> /dev/null; then
|
||||||
|
@ -797,7 +844,7 @@ function update_TDengine() {
|
||||||
echo -e "\033[44;31;5mNginx for TDengine does not work! Please try again!\033[0m"
|
echo -e "\033[44;31;5mNginx for TDengine does not work! Please try again!\033[0m"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#echo
|
#echo
|
||||||
#echo -e "\033[44;32;1mTDengine is updated successfully!${NC}"
|
#echo -e "\033[44;32;1mTDengine is updated successfully!${NC}"
|
||||||
|
@ -840,7 +887,7 @@ function install_TDengine() {
|
||||||
|
|
||||||
echo -e "${GREEN}Start to install TDengine...${NC}"
|
echo -e "${GREEN}Start to install TDengine...${NC}"
|
||||||
|
|
||||||
install_main_path
|
install_main_path
|
||||||
|
|
||||||
if [ -z $1 ]; then
|
if [ -z $1 ]; then
|
||||||
install_data
|
install_data
|
||||||
|
@ -894,23 +941,23 @@ function install_TDengine() {
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
if [ ! -z "$firstEp" ]; then
|
if [ ! -z "$firstEp" ]; then
|
||||||
tmpFqdn=${firstEp%%:*}
|
tmpFqdn=${firstEp%%:*}
|
||||||
substr=":"
|
substr=":"
|
||||||
if [[ $firstEp =~ $substr ]];then
|
if [[ $firstEp =~ $substr ]];then
|
||||||
tmpPort=${firstEp#*:}
|
tmpPort=${firstEp#*:}
|
||||||
else
|
else
|
||||||
tmpPort=""
|
tmpPort=""
|
||||||
fi
|
fi
|
||||||
if [[ "$tmpPort" != "" ]];then
|
if [[ "$tmpPort" != "" ]];then
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $tmpFqdn -P $tmpPort${GREEN_DARK} to login into cluster, then${NC}"
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $tmpFqdn -P $tmpPort${GREEN_DARK} to login into cluster, then${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $tmpFqdn${GREEN_DARK} to login into cluster, then${NC}"
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $tmpFqdn${GREEN_DARK} to login into cluster, then${NC}"
|
||||||
fi
|
fi
|
||||||
echo -e "${GREEN_DARK}execute ${NC}: create dnode 'newDnodeFQDN:port'; ${GREEN_DARK}to add this new node${NC}"
|
echo -e "${GREEN_DARK}execute ${NC}: create dnode 'newDnodeFQDN:port'; ${GREEN_DARK}to add this new node${NC}"
|
||||||
echo
|
echo
|
||||||
elif [ ! -z "$serverFqdn" ]; then
|
elif [ ! -z "$serverFqdn" ]; then
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $serverFqdn${GREEN_DARK} to login into TDengine server${NC}"
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: taos -h $serverFqdn${GREEN_DARK} to login into TDengine server${NC}"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\033[44;32;1mTDengine is installed successfully!${NC}"
|
echo -e "\033[44;32;1mTDengine is installed successfully!${NC}"
|
||||||
|
|
|
@ -204,7 +204,7 @@ function install_jemalloc() {
|
||||||
if [ -f ${binary_dir}/build/lib/libjemalloc_pic.a ]; then
|
if [ -f ${binary_dir}/build/lib/libjemalloc_pic.a ]; then
|
||||||
/usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc_pic.a /usr/local/lib
|
/usr/bin/install -c -m 755 ${binary_dir}/build/lib/libjemalloc_pic.a /usr/local/lib
|
||||||
fi
|
fi
|
||||||
if [ -f ${binary_dir}/build/lib/libjemalloc_pic.a ]; then
|
if [ -f ${binary_dir}/build/lib/pkgconfig/jemalloc.pc ]; then
|
||||||
/usr/bin/install -c -d /usr/local/lib/pkgconfig
|
/usr/bin/install -c -d /usr/local/lib/pkgconfig
|
||||||
/usr/bin/install -c -m 644 ${binary_dir}/build/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig
|
/usr/bin/install -c -m 644 ${binary_dir}/build/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -30,7 +30,7 @@ else
|
||||||
install_dir="${release_dir}/TDengine-server-${version}"
|
install_dir="${release_dir}/TDengine-server-${version}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Directories and files.
|
# Directories and files
|
||||||
if [ "$pagMode" == "lite" ]; then
|
if [ "$pagMode" == "lite" ]; then
|
||||||
strip ${build_dir}/bin/taosd
|
strip ${build_dir}/bin/taosd
|
||||||
strip ${build_dir}/bin/taos
|
strip ${build_dir}/bin/taos
|
||||||
|
@ -73,6 +73,39 @@ mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/taos
|
||||||
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir}/init.d/tarbitratord.deb || :
|
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir}/init.d/tarbitratord.deb || :
|
||||||
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || :
|
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || :
|
||||||
|
|
||||||
|
if [ -f ${build_dir}/bin/jemalloc-config ]; then
|
||||||
|
mkdir -p ${install_dir}/jemalloc/{bin,lib,lib/pkgconfig,include/jemalloc,share/doc/jemalloc,share/man/man3}
|
||||||
|
cp ${build_dir}/bin/jemalloc-config ${install_dir}/jemalloc/bin
|
||||||
|
if [ -f ${build_dir}/bin/jemalloc.sh ]; then
|
||||||
|
cp ${build_dir}/bin/jemalloc.sh ${install_dir}/jemalloc/bin
|
||||||
|
fi
|
||||||
|
if [ -f ${build_dir}/bin/jeprof ]; then
|
||||||
|
cp ${build_dir}/bin/jeprof ${install_dir}/jemalloc/bin
|
||||||
|
fi
|
||||||
|
if [ -f ${build_dir}/include/jemalloc/jemalloc.h ]; then
|
||||||
|
cp ${build_dir}/include/jemalloc/jemalloc.h ${install_dir}/jemalloc/include/jemalloc
|
||||||
|
fi
|
||||||
|
if [ -f ${build_dir}/lib/libjemalloc.so.2 ]; then
|
||||||
|
cp ${build_dir}/lib/libjemalloc.so.2 ${install_dir}/jemalloc/lib
|
||||||
|
ln -sf libjemalloc.so.2 ${install_dir}/jemalloc/lib/libjemalloc.so
|
||||||
|
fi
|
||||||
|
if [ -f ${build_dir}/lib/libjemalloc.a ]; then
|
||||||
|
cp ${build_dir}/lib/libjemalloc.a ${install_dir}/jemalloc/lib
|
||||||
|
fi
|
||||||
|
if [ -f ${build_dir}/lib/libjemalloc_pic.a ]; then
|
||||||
|
cp ${build_dir}/lib/libjemalloc_pic.a ${install_dir}/jemalloc/lib
|
||||||
|
fi
|
||||||
|
if [ -f ${build_dir}/lib/pkgconfig/jemalloc.pc ]; then
|
||||||
|
cp ${build_dir}/lib/pkgconfig/jemalloc.pc ${install_dir}/jemalloc/lib/pkgconfig
|
||||||
|
fi
|
||||||
|
if [ -f ${build_dir}/share/doc/jemalloc/jemalloc.html ]; then
|
||||||
|
cp ${build_dir}/share/doc/jemalloc/jemalloc.html ${install_dir}/jemalloc/share/doc/jemalloc
|
||||||
|
fi
|
||||||
|
if [ -f ${build_dir}/share/man/man3/jemalloc.3 ]; then
|
||||||
|
cp ${build_dir}/share/man/man3/jemalloc.3 ${install_dir}/jemalloc/share/man/man3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >> remove_temp.sh
|
sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >> remove_temp.sh
|
||||||
mv remove_temp.sh ${install_dir}/bin/remove.sh
|
mv remove_temp.sh ${install_dir}/bin/remove.sh
|
||||||
|
|
|
@ -48,6 +48,7 @@ typedef struct SMultiTbStmt {
|
||||||
bool nameSet;
|
bool nameSet;
|
||||||
bool tagSet;
|
bool tagSet;
|
||||||
uint64_t currentUid;
|
uint64_t currentUid;
|
||||||
|
char *sqlstr;
|
||||||
uint32_t tbNum;
|
uint32_t tbNum;
|
||||||
SStrToken tbname;
|
SStrToken tbname;
|
||||||
SStrToken stbname;
|
SStrToken stbname;
|
||||||
|
@ -1203,7 +1204,6 @@ static int insertBatchStmtExecute(STscStmt* pStmt) {
|
||||||
return pStmt->pSql->res.code;
|
return pStmt->pSql->res.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int stmtParseInsertTbTags(SSqlObj* pSql, STscStmt* pStmt) {
|
int stmtParseInsertTbTags(SSqlObj* pSql, STscStmt* pStmt) {
|
||||||
SSqlCmd *pCmd = &pSql->cmd;
|
SSqlCmd *pCmd = &pSql->cmd;
|
||||||
int32_t ret = TSDB_CODE_SUCCESS;
|
int32_t ret = TSDB_CODE_SUCCESS;
|
||||||
|
@ -1233,28 +1233,28 @@ int stmtParseInsertTbTags(SSqlObj* pSql, STscStmt* pStmt) {
|
||||||
pStmt->mtb.tagSet = true;
|
pStmt->mtb.tagSet = true;
|
||||||
|
|
||||||
sToken = tStrGetToken(pCmd->insertParam.sql, &index, false);
|
sToken = tStrGetToken(pCmd->insertParam.sql, &index, false);
|
||||||
if (sToken.n > 0 && sToken.type == TK_VALUES) {
|
if (sToken.n > 0 && (sToken.type == TK_VALUES || sToken.type == TK_LP)) {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sToken.n <= 0 || sToken.type != TK_USING) {
|
if (sToken.n <= 0 || sToken.type != TK_USING) {
|
||||||
return TSDB_CODE_TSC_INVALID_OPERATION;
|
return tscSQLSyntaxErrMsg(pCmd->payload, "keywords USING is expected", sToken.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
sToken = tStrGetToken(pCmd->insertParam.sql, &index, false);
|
sToken = tStrGetToken(pCmd->insertParam.sql, &index, false);
|
||||||
if (sToken.n <= 0 || ((sToken.type != TK_ID) && (sToken.type != TK_STRING))) {
|
if (sToken.n <= 0 || ((sToken.type != TK_ID) && (sToken.type != TK_STRING))) {
|
||||||
return TSDB_CODE_TSC_INVALID_OPERATION;
|
return tscSQLSyntaxErrMsg(pCmd->payload, "invalid token", sToken.z);
|
||||||
}
|
}
|
||||||
pStmt->mtb.stbname = sToken;
|
pStmt->mtb.stbname = sToken;
|
||||||
|
|
||||||
sToken = tStrGetToken(pCmd->insertParam.sql, &index, false);
|
sToken = tStrGetToken(pCmd->insertParam.sql, &index, false);
|
||||||
if (sToken.n <= 0 || sToken.type != TK_TAGS) {
|
if (sToken.n <= 0 || sToken.type != TK_TAGS) {
|
||||||
return TSDB_CODE_TSC_INVALID_OPERATION;
|
return tscSQLSyntaxErrMsg(pCmd->payload, "keyword TAGS expected", sToken.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
sToken = tStrGetToken(pCmd->insertParam.sql, &index, false);
|
sToken = tStrGetToken(pCmd->insertParam.sql, &index, false);
|
||||||
if (sToken.n <= 0 || sToken.type != TK_LP) {
|
if (sToken.n <= 0 || sToken.type != TK_LP) {
|
||||||
return TSDB_CODE_TSC_INVALID_OPERATION;
|
return tscSQLSyntaxErrMsg(pCmd->payload, ") expected", sToken.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
pStmt->mtb.tags = taosArrayInit(4, sizeof(SStrToken));
|
pStmt->mtb.tags = taosArrayInit(4, sizeof(SStrToken));
|
||||||
|
@ -1291,14 +1291,12 @@ int stmtParseInsertTbTags(SSqlObj* pSql, STscStmt* pStmt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pStmt->mtb.values = sToken;
|
pStmt->mtb.values = sToken;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int stmtGenInsertStatement(SSqlObj* pSql, STscStmt* pStmt, const char* name, TAOS_BIND* tags) {
|
int stmtGenInsertStatement(SSqlObj* pSql, STscStmt* pStmt, const char* name, TAOS_BIND* tags) {
|
||||||
size_t tagNum = taosArrayGetSize(pStmt->mtb.tags);
|
size_t tagNum = taosArrayGetSize(pStmt->mtb.tags);
|
||||||
size_t size = 1048576;
|
size_t size = 1048576;
|
||||||
|
@ -1373,14 +1371,17 @@ int stmtGenInsertStatement(SSqlObj* pSql, STscStmt* pStmt, const char* name, TAO
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(pSql->sqlstr);
|
if (pStmt->mtb.sqlstr == NULL) {
|
||||||
|
pStmt->mtb.sqlstr = pSql->sqlstr;
|
||||||
|
} else {
|
||||||
|
tfree(pSql->sqlstr);
|
||||||
|
}
|
||||||
|
|
||||||
pSql->sqlstr = str;
|
pSql->sqlstr = str;
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// interface functions
|
// interface functions
|
||||||
|
|
||||||
|
@ -1561,7 +1562,6 @@ int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_BIND* tags
|
||||||
}
|
}
|
||||||
|
|
||||||
pStmt->mtb.nameSet = true;
|
pStmt->mtb.nameSet = true;
|
||||||
pStmt->mtb.tagSet = true;
|
|
||||||
|
|
||||||
tscDebug("0x%"PRIx64" SQL: %s", pSql->self, pSql->sqlstr);
|
tscDebug("0x%"PRIx64" SQL: %s", pSql->self, pSql->sqlstr);
|
||||||
|
|
||||||
|
@ -1634,6 +1634,7 @@ int taos_stmt_close(TAOS_STMT* stmt) {
|
||||||
taosHashCleanup(pStmt->pSql->cmd.insertParam.pTableBlockHashList);
|
taosHashCleanup(pStmt->pSql->cmd.insertParam.pTableBlockHashList);
|
||||||
pStmt->pSql->cmd.insertParam.pTableBlockHashList = NULL;
|
pStmt->pSql->cmd.insertParam.pTableBlockHashList = NULL;
|
||||||
taosArrayDestroy(pStmt->mtb.tags);
|
taosArrayDestroy(pStmt->mtb.tags);
|
||||||
|
tfree(pStmt->mtb.sqlstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7482,6 +7482,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
|
||||||
const char* msg1 = "point interpolation query needs timestamp";
|
const char* msg1 = "point interpolation query needs timestamp";
|
||||||
const char* msg2 = "too many tables in from clause";
|
const char* msg2 = "too many tables in from clause";
|
||||||
const char* msg3 = "start(end) time of query range required or time range too large";
|
const char* msg3 = "start(end) time of query range required or time range too large";
|
||||||
|
const char* msg4 = "interval query not supported, since the result of sub query not include valid timestamp column";
|
||||||
const char* msg9 = "only tag query not compatible with normal column filter";
|
const char* msg9 = "only tag query not compatible with normal column filter";
|
||||||
|
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
|
@ -7540,11 +7541,25 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
|
||||||
if (validateIntervalNode(pSql, pQueryInfo, pSqlNode) != TSDB_CODE_SUCCESS) {
|
if (validateIntervalNode(pSql, pQueryInfo, pSqlNode) != TSDB_CODE_SUCCESS) {
|
||||||
return TSDB_CODE_TSC_INVALID_OPERATION;
|
return TSDB_CODE_TSC_INVALID_OPERATION;
|
||||||
} else {
|
} else {
|
||||||
if (isTimeWindowQuery(pQueryInfo) &&
|
if (isTimeWindowQuery(pQueryInfo)) {
|
||||||
(validateFunctionsInIntervalOrGroupbyQuery(pCmd, pQueryInfo) != TSDB_CODE_SUCCESS)) {
|
// check if the first column of the nest query result is timestamp column
|
||||||
return TSDB_CODE_TSC_INVALID_OPERATION;
|
SColumn* pCol = taosArrayGetP(pQueryInfo->colList, 0);
|
||||||
|
if (pCol->info.type != TSDB_DATA_TYPE_TIMESTAMP) {
|
||||||
|
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg4);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (validateFunctionsInIntervalOrGroupbyQuery(pCmd, pQueryInfo) != TSDB_CODE_SUCCESS) {
|
||||||
|
return TSDB_CODE_TSC_INVALID_OPERATION;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set order by info
|
||||||
|
STableMeta* pTableMeta = tscGetMetaInfo(pQueryInfo, 0)->pTableMeta;
|
||||||
|
if (validateOrderbyNode(pCmd, pQueryInfo, pSqlNode, tscGetTableSchema(pTableMeta)) !=
|
||||||
|
TSDB_CODE_SUCCESS) {
|
||||||
|
return TSDB_CODE_TSC_INVALID_OPERATION;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
pQueryInfo->command = TSDB_SQL_SELECT;
|
pQueryInfo->command = TSDB_SQL_SELECT;
|
||||||
|
|
||||||
|
@ -7697,8 +7712,8 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
|
||||||
|
|
||||||
SExprInfo** p = NULL;
|
SExprInfo** p = NULL;
|
||||||
int32_t numOfExpr = 0;
|
int32_t numOfExpr = 0;
|
||||||
|
pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
|
||||||
code = createProjectionExpr(pQueryInfo, pTableMetaInfo, &p, &numOfExpr);
|
code = createProjectionExpr(pQueryInfo, pTableMetaInfo, &p, &numOfExpr);
|
||||||
|
|
||||||
if (pQueryInfo->exprList1 == NULL) {
|
if (pQueryInfo->exprList1 == NULL) {
|
||||||
pQueryInfo->exprList1 = taosArrayInit(4, POINTER_BYTES);
|
pQueryInfo->exprList1 = taosArrayInit(4, POINTER_BYTES);
|
||||||
}
|
}
|
||||||
|
|
|
@ -477,7 +477,6 @@ int doBuildAndSendMsg(SSqlObj *pSql) {
|
||||||
pCmd->command == TSDB_SQL_INSERT ||
|
pCmd->command == TSDB_SQL_INSERT ||
|
||||||
pCmd->command == TSDB_SQL_CONNECT ||
|
pCmd->command == TSDB_SQL_CONNECT ||
|
||||||
pCmd->command == TSDB_SQL_HB ||
|
pCmd->command == TSDB_SQL_HB ||
|
||||||
// pCmd->command == TSDB_SQL_META ||
|
|
||||||
pCmd->command == TSDB_SQL_STABLEVGROUP) {
|
pCmd->command == TSDB_SQL_STABLEVGROUP) {
|
||||||
pRes->code = tscBuildMsg[pCmd->command](pSql, NULL);
|
pRes->code = tscBuildMsg[pCmd->command](pSql, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -627,7 +627,7 @@ static bool hasAdditionalErrorInfo(int32_t code, SSqlCmd *pCmd) {
|
||||||
|
|
||||||
char *z = NULL;
|
char *z = NULL;
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
z = strstr(pCmd->payload, "invalid SQL");
|
z = strstr(pCmd->payload, "invalid operation");
|
||||||
if (z == NULL) {
|
if (z == NULL) {
|
||||||
z = strstr(pCmd->payload, "syntax error");
|
z = strstr(pCmd->payload, "syntax error");
|
||||||
}
|
}
|
||||||
|
|
|
@ -780,7 +780,9 @@ SSDataBlock* doGetDataBlock(void* param, bool* newgroup) {
|
||||||
SSqlRes* pRes = &pSql->res;
|
SSqlRes* pRes = &pSql->res;
|
||||||
|
|
||||||
SSDataBlock* pBlock = pInput->block;
|
SSDataBlock* pBlock = pInput->block;
|
||||||
pOperator->pRuntimeEnv->current = pInput->pTableQueryInfo;
|
if (pOperator->pRuntimeEnv != NULL) {
|
||||||
|
pOperator->pRuntimeEnv->current = pInput->pTableQueryInfo;
|
||||||
|
}
|
||||||
|
|
||||||
pBlock->info.rows = pRes->numOfRows;
|
pBlock->info.rows = pRes->numOfRows;
|
||||||
if (pRes->numOfRows != 0) {
|
if (pRes->numOfRows != 0) {
|
||||||
|
@ -804,6 +806,24 @@ SSDataBlock* doGetDataBlock(void* param, bool* newgroup) {
|
||||||
return pBlock;
|
return pBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void fetchNextBlockIfCompleted(SOperatorInfo* pOperator, bool* newgroup) {
|
||||||
|
SJoinOperatorInfo* pJoinInfo = pOperator->info;
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < pOperator->numOfUpstream; ++i) {
|
||||||
|
SJoinStatus* pStatus = &pJoinInfo->status[i];
|
||||||
|
if (pStatus->pBlock == NULL || pStatus->index >= pStatus->pBlock->info.rows) {
|
||||||
|
pStatus->pBlock = pOperator->upstream[i]->exec(pOperator->upstream[i], newgroup);
|
||||||
|
pStatus->index = 0;
|
||||||
|
|
||||||
|
if (pStatus->pBlock == NULL) {
|
||||||
|
pOperator->status = OP_EXEC_DONE;
|
||||||
|
pJoinInfo->resultInfo.total += pJoinInfo->pRes->info.rows;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
|
SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
|
||||||
SOperatorInfo *pOperator = (SOperatorInfo*) param;
|
SOperatorInfo *pOperator = (SOperatorInfo*) param;
|
||||||
if (pOperator->status == OP_EXEC_DONE) {
|
if (pOperator->status == OP_EXEC_DONE) {
|
||||||
|
@ -816,19 +836,9 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
|
||||||
pJoinInfo->pRes->info.rows = 0;
|
pJoinInfo->pRes->info.rows = 0;
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
for (int32_t i = 0; i < pOperator->numOfUpstream; ++i) {
|
fetchNextBlockIfCompleted(pOperator, newgroup);
|
||||||
SJoinStatus* pStatus = &pJoinInfo->status[i];
|
if (pOperator->status == OP_EXEC_DONE) {
|
||||||
if (pStatus->pBlock == NULL || pStatus->index >= pStatus->pBlock->info.rows) {
|
return pJoinInfo->pRes;
|
||||||
pStatus->pBlock = pOperator->upstream[i]->exec(pOperator->upstream[i], newgroup);
|
|
||||||
pStatus->index = 0;
|
|
||||||
|
|
||||||
if (pStatus->pBlock == NULL) {
|
|
||||||
pOperator->status = OP_EXEC_DONE;
|
|
||||||
|
|
||||||
pJoinInfo->resultInfo.total += pJoinInfo->pRes->info.rows;
|
|
||||||
return pJoinInfo->pRes;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SJoinStatus* st0 = &pJoinInfo->status[0];
|
SJoinStatus* st0 = &pJoinInfo->status[0];
|
||||||
|
@ -847,8 +857,12 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
|
||||||
|
|
||||||
if (ts[st->index] < ts0[st0->index]) { // less than the first
|
if (ts[st->index] < ts0[st0->index]) { // less than the first
|
||||||
prefixEqual = false;
|
prefixEqual = false;
|
||||||
|
|
||||||
if ((++(st->index)) >= st->pBlock->info.rows) {
|
if ((++(st->index)) >= st->pBlock->info.rows) {
|
||||||
break;
|
fetchNextBlockIfCompleted(pOperator, newgroup);
|
||||||
|
if (pOperator->status == OP_EXEC_DONE) {
|
||||||
|
return pJoinInfo->pRes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (ts[st->index] > ts0[st0->index]) { // greater than the first;
|
} else if (ts[st->index] > ts0[st0->index]) { // greater than the first;
|
||||||
if (prefixEqual == true) {
|
if (prefixEqual == true) {
|
||||||
|
@ -856,12 +870,19 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
|
||||||
for (int32_t j = 0; j < i; ++j) {
|
for (int32_t j = 0; j < i; ++j) {
|
||||||
SJoinStatus* stx = &pJoinInfo->status[j];
|
SJoinStatus* stx = &pJoinInfo->status[j];
|
||||||
if ((++(stx->index)) >= stx->pBlock->info.rows) {
|
if ((++(stx->index)) >= stx->pBlock->info.rows) {
|
||||||
break;
|
|
||||||
|
fetchNextBlockIfCompleted(pOperator, newgroup);
|
||||||
|
if (pOperator->status == OP_EXEC_DONE) {
|
||||||
|
return pJoinInfo->pRes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((++(st0->index)) >= st0->pBlock->info.rows) {
|
if ((++(st0->index)) >= st0->pBlock->info.rows) {
|
||||||
break;
|
fetchNextBlockIfCompleted(pOperator, newgroup);
|
||||||
|
if (pOperator->status == OP_EXEC_DONE) {
|
||||||
|
return pJoinInfo->pRes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1132,6 +1153,19 @@ void handleDownstreamOperator(SSqlObj** pSqlObjList, int32_t numOfUpstream, SQue
|
||||||
memcpy(schema, pSchema, numOfCol1*sizeof(SSchema));
|
memcpy(schema, pSchema, numOfCol1*sizeof(SSchema));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update the exprinfo
|
||||||
|
int32_t numOfOutput = (int32_t)tscNumOfExprs(px);
|
||||||
|
for(int32_t i = 0; i < numOfOutput; ++i) {
|
||||||
|
SExprInfo* pex = taosArrayGetP(px->exprList, i);
|
||||||
|
int32_t colId = pex->base.colInfo.colId;
|
||||||
|
for(int32_t j = 0; j < pSourceOperator->numOfOutput; ++j) {
|
||||||
|
if (colId == schema[j].colId) {
|
||||||
|
pex->base.colInfo.colIndex = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
px->pQInfo = createQInfoFromQueryNode(px, &tableGroupInfo, pSourceOperator, NULL, NULL, MASTER_SCAN);
|
px->pQInfo = createQInfoFromQueryNode(px, &tableGroupInfo, pSourceOperator, NULL, NULL, MASTER_SCAN);
|
||||||
tfree(pColumnInfo);
|
tfree(pColumnInfo);
|
||||||
tfree(schema);
|
tfree(schema);
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
*/
|
*/
|
||||||
package com.taosdata.jdbc;
|
package com.taosdata.jdbc;
|
||||||
|
|
||||||
import com.taosdata.jdbc.utils.TaosInfo;
|
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.SQLWarning;
|
import java.sql.SQLWarning;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.taosdata.jdbc.utils.TaosInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JNI connector
|
* JNI connector
|
||||||
*/
|
*/
|
||||||
|
@ -276,23 +276,14 @@ public class TSDBJNIConnector {
|
||||||
private native int validateCreateTableSqlImp(long connection, byte[] sqlBytes);
|
private native int validateCreateTableSqlImp(long connection, byte[] sqlBytes);
|
||||||
|
|
||||||
public long prepareStmt(String sql) throws SQLException {
|
public long prepareStmt(String sql) throws SQLException {
|
||||||
Long stmt = 0L;
|
Long stmt = prepareStmtImp(sql.getBytes(), this.taos);
|
||||||
try {
|
if (stmt == TSDBConstants.JNI_TDENGINE_ERROR) {
|
||||||
stmt = prepareStmtImp(sql.getBytes(), this.taos);
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_SQL);
|
||||||
} catch (Exception e) {
|
} else if (stmt == TSDBConstants.JNI_CONNECTION_NULL) {
|
||||||
e.printStackTrace();
|
|
||||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_ENCODING);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stmt == TSDBConstants.JNI_CONNECTION_NULL) {
|
|
||||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_CONNECTION_NULL);
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_CONNECTION_NULL);
|
||||||
}
|
} else if (stmt == TSDBConstants.JNI_SQL_NULL) {
|
||||||
|
|
||||||
if (stmt == TSDBConstants.JNI_SQL_NULL) {
|
|
||||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_SQL_NULL);
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_SQL_NULL);
|
||||||
}
|
} else if (stmt == TSDBConstants.JNI_OUT_OF_MEMORY) {
|
||||||
|
|
||||||
if (stmt == TSDBConstants.JNI_OUT_OF_MEMORY) {
|
|
||||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_OUT_OF_MEMORY);
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_OUT_OF_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2490,7 +2490,6 @@ static void buildTopBotStruct(STopBotInfo *pTopBotInfo, SQLFunctionCtx *pCtx) {
|
||||||
tmp += POINTER_BYTES * pCtx->param[0].i64;
|
tmp += POINTER_BYTES * pCtx->param[0].i64;
|
||||||
|
|
||||||
size_t size = sizeof(tValuePair) + pCtx->tagInfo.tagsLen;
|
size_t size = sizeof(tValuePair) + pCtx->tagInfo.tagsLen;
|
||||||
// assert(pCtx->param[0].i64 > 0);
|
|
||||||
|
|
||||||
for (int32_t i = 0; i < pCtx->param[0].i64; ++i) {
|
for (int32_t i = 0; i < pCtx->param[0].i64; ++i) {
|
||||||
pTopBotInfo->res[i] = (tValuePair*) tmp;
|
pTopBotInfo->res[i] = (tValuePair*) tmp;
|
||||||
|
@ -2499,7 +2498,6 @@ static void buildTopBotStruct(STopBotInfo *pTopBotInfo, SQLFunctionCtx *pCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool topbot_datablock_filter(SQLFunctionCtx *pCtx, const char *minval, const char *maxval) {
|
bool topbot_datablock_filter(SQLFunctionCtx *pCtx, const char *minval, const char *maxval) {
|
||||||
SResultRowCellInfo *pResInfo = GET_RES_INFO(pCtx);
|
SResultRowCellInfo *pResInfo = GET_RES_INFO(pCtx);
|
||||||
if (pResInfo == NULL) {
|
if (pResInfo == NULL) {
|
||||||
|
@ -2579,13 +2577,14 @@ static void top_function(SQLFunctionCtx *pCtx) {
|
||||||
|
|
||||||
for (int32_t i = 0; i < pCtx->size; ++i) {
|
for (int32_t i = 0; i < pCtx->size; ++i) {
|
||||||
char *data = GET_INPUT_DATA(pCtx, i);
|
char *data = GET_INPUT_DATA(pCtx, i);
|
||||||
TSKEY ts = GET_TS_DATA(pCtx, i);
|
|
||||||
|
|
||||||
if (pCtx->hasNull && isNull(data, pCtx->inputType)) {
|
if (pCtx->hasNull && isNull(data, pCtx->inputType)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
notNullElems++;
|
notNullElems++;
|
||||||
|
|
||||||
|
// NOTE: Set the default timestamp if it is missing [todo refactor]
|
||||||
|
TSKEY ts = (pCtx->ptsList != NULL)? GET_TS_DATA(pCtx, i):0;
|
||||||
do_top_function_add(pRes, (int32_t)pCtx->param[0].i64, data, ts, pCtx->inputType, &pCtx->tagInfo, NULL, 0);
|
do_top_function_add(pRes, (int32_t)pCtx->param[0].i64, data, ts, pCtx->inputType, &pCtx->tagInfo, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2658,13 +2657,13 @@ static void bottom_function(SQLFunctionCtx *pCtx) {
|
||||||
|
|
||||||
for (int32_t i = 0; i < pCtx->size; ++i) {
|
for (int32_t i = 0; i < pCtx->size; ++i) {
|
||||||
char *data = GET_INPUT_DATA(pCtx, i);
|
char *data = GET_INPUT_DATA(pCtx, i);
|
||||||
TSKEY ts = GET_TS_DATA(pCtx, i);
|
|
||||||
|
|
||||||
if (pCtx->hasNull && isNull(data, pCtx->inputType)) {
|
if (pCtx->hasNull && isNull(data, pCtx->inputType)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
notNullElems++;
|
notNullElems++;
|
||||||
|
// NOTE: Set the default timestamp if it is missing [todo refactor]
|
||||||
|
TSKEY ts = (pCtx->ptsList != NULL)? GET_TS_DATA(pCtx, i):0;
|
||||||
do_bottom_function_add(pRes, (int32_t)pCtx->param[0].i64, data, ts, pCtx->inputType, &pCtx->tagInfo, NULL, 0);
|
do_bottom_function_add(pRes, (int32_t)pCtx->param[0].i64, data, ts, pCtx->inputType, &pCtx->tagInfo, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2742,7 +2741,7 @@ static void top_bottom_func_finalizer(SQLFunctionCtx *pCtx) {
|
||||||
if (pCtx->param[1].i64 == PRIMARYKEY_TIMESTAMP_COL_INDEX) {
|
if (pCtx->param[1].i64 == PRIMARYKEY_TIMESTAMP_COL_INDEX) {
|
||||||
__compar_fn_t comparator = (pCtx->param[2].i64 == TSDB_ORDER_ASC) ? resAscComparFn : resDescComparFn;
|
__compar_fn_t comparator = (pCtx->param[2].i64 == TSDB_ORDER_ASC) ? resAscComparFn : resDescComparFn;
|
||||||
qsort(tvp, (size_t)pResInfo->numOfRes, POINTER_BYTES, comparator);
|
qsort(tvp, (size_t)pResInfo->numOfRes, POINTER_BYTES, comparator);
|
||||||
} else if (pCtx->param[1].i64 > PRIMARYKEY_TIMESTAMP_COL_INDEX) {
|
} else /*if (pCtx->param[1].i64 > PRIMARYKEY_TIMESTAMP_COL_INDEX)*/ {
|
||||||
__compar_fn_t comparator = (pCtx->param[2].i64 == TSDB_ORDER_ASC) ? resDataAscComparFn : resDataDescComparFn;
|
__compar_fn_t comparator = (pCtx->param[2].i64 == TSDB_ORDER_ASC) ? resDataAscComparFn : resDataDescComparFn;
|
||||||
qsort(tvp, (size_t)pResInfo->numOfRes, POINTER_BYTES, comparator);
|
qsort(tvp, (size_t)pResInfo->numOfRes, POINTER_BYTES, comparator);
|
||||||
}
|
}
|
||||||
|
|
|
@ -950,7 +950,13 @@ static void doSetInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx,
|
||||||
uint32_t status = aAggs[pCtx[i].functionId].status;
|
uint32_t status = aAggs[pCtx[i].functionId].status;
|
||||||
if ((status & (TSDB_FUNCSTATE_SELECTIVITY | TSDB_FUNCSTATE_NEED_TS)) != 0) {
|
if ((status & (TSDB_FUNCSTATE_SELECTIVITY | TSDB_FUNCSTATE_NEED_TS)) != 0) {
|
||||||
SColumnInfoData* tsInfo = taosArrayGet(pBlock->pDataBlock, 0);
|
SColumnInfoData* tsInfo = taosArrayGet(pBlock->pDataBlock, 0);
|
||||||
pCtx[i].ptsList = (int64_t*) tsInfo->pData;
|
// In case of the top/bottom query again the nest query result, which has no timestamp column
|
||||||
|
// don't set the ptsList attribute.
|
||||||
|
if (tsInfo->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
|
||||||
|
pCtx[i].ptsList = (int64_t*) tsInfo->pData;
|
||||||
|
} else {
|
||||||
|
pCtx[i].ptsList = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (TSDB_COL_IS_UD_COL(pCol->flag) && (pOperator->pRuntimeEnv->scanFlag == MERGE_STAGE)) {
|
} else if (TSDB_COL_IS_UD_COL(pCol->flag) && (pOperator->pRuntimeEnv->scanFlag == MERGE_STAGE)) {
|
||||||
SColIndex* pColIndex = &pOperator->pExpr[i].base.colInfo;
|
SColIndex* pColIndex = &pOperator->pExpr[i].base.colInfo;
|
||||||
|
@ -4228,6 +4234,10 @@ static void updateTableIdInfo(STableQueryInfo* pTableQueryInfo, SSDataBlock* pBl
|
||||||
int32_t step = GET_FORWARD_DIRECTION_FACTOR(order);
|
int32_t step = GET_FORWARD_DIRECTION_FACTOR(order);
|
||||||
pTableQueryInfo->lastKey = ((order == TSDB_ORDER_ASC)? pBlock->info.window.ekey:pBlock->info.window.skey) + step;
|
pTableQueryInfo->lastKey = ((order == TSDB_ORDER_ASC)? pBlock->info.window.ekey:pBlock->info.window.skey) + step;
|
||||||
|
|
||||||
|
if (pTableQueryInfo->pTable == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
STableIdInfo tidInfo = createTableIdInfo(pTableQueryInfo);
|
STableIdInfo tidInfo = createTableIdInfo(pTableQueryInfo);
|
||||||
STableIdInfo *idinfo = taosHashGet(pTableIdInfo, &tidInfo.tid, sizeof(tidInfo.tid));
|
STableIdInfo *idinfo = taosHashGet(pTableIdInfo, &tidInfo.tid, sizeof(tidInfo.tid));
|
||||||
if (idinfo != NULL) {
|
if (idinfo != NULL) {
|
||||||
|
@ -4905,8 +4915,7 @@ static SSDataBlock* doArithmeticOperation(void* param, bool* newgroup) {
|
||||||
updateOutputBuf(&pArithInfo->binfo, &pArithInfo->bufCapacity, pBlock->info.rows);
|
updateOutputBuf(&pArithInfo->binfo, &pArithInfo->bufCapacity, pBlock->info.rows);
|
||||||
|
|
||||||
arithmeticApplyFunctions(pRuntimeEnv, pInfo->pCtx, pOperator->numOfOutput);
|
arithmeticApplyFunctions(pRuntimeEnv, pInfo->pCtx, pOperator->numOfOutput);
|
||||||
|
if (pTableQueryInfo != NULL) {
|
||||||
if (pTableQueryInfo != NULL) { // TODO refactor
|
|
||||||
updateTableIdInfo(pTableQueryInfo, pBlock, pRuntimeEnv->pTableRetrieveTsMap, order);
|
updateTableIdInfo(pTableQueryInfo, pBlock, pRuntimeEnv->pTableRetrieveTsMap, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4949,8 +4958,7 @@ static SSDataBlock* doArithmeticOperation(void* param, bool* newgroup) {
|
||||||
updateOutputBuf(&pArithInfo->binfo, &pArithInfo->bufCapacity, pBlock->info.rows);
|
updateOutputBuf(&pArithInfo->binfo, &pArithInfo->bufCapacity, pBlock->info.rows);
|
||||||
|
|
||||||
arithmeticApplyFunctions(pRuntimeEnv, pInfo->pCtx, pOperator->numOfOutput);
|
arithmeticApplyFunctions(pRuntimeEnv, pInfo->pCtx, pOperator->numOfOutput);
|
||||||
|
if (pTableQueryInfo != NULL) {
|
||||||
if (pTableQueryInfo != NULL) { // TODO refactor
|
|
||||||
updateTableIdInfo(pTableQueryInfo, pBlock, pRuntimeEnv->pTableRetrieveTsMap, order);
|
updateTableIdInfo(pTableQueryInfo, pBlock, pRuntimeEnv->pTableRetrieveTsMap, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,8 @@
|
||||||
gcc -std=c99 lua_connector.c -fPIC -shared -o luaconnector.so -Wall -ltaos
|
lua_header_installed=`apt-cache policy liblua5.3-dev|grep Installed|grep none > /dev/null; echo $?`
|
||||||
|
if [ "$lua_header_installed" = "0" ]; then
|
||||||
|
echo "If need, please input root password to install liblua5.3-dev for build the connector.."
|
||||||
|
sudo apt install -y liblua5.3-dev
|
||||||
|
fi
|
||||||
|
|
||||||
|
gcc -std=c99 lua_connector.c -fPIC -shared -o luaconnector.so -Wall -ltaos -I/usr/include/lua5.3
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -24,6 +24,9 @@ sql drop database if exists $db
|
||||||
sql create database $db keep 36500
|
sql create database $db keep 36500
|
||||||
sql use $db
|
sql use $db
|
||||||
|
|
||||||
|
print =====================================> td-4481
|
||||||
|
sql create database $db
|
||||||
|
|
||||||
print =====================================> test case for twa in single block
|
print =====================================> test case for twa in single block
|
||||||
|
|
||||||
sql create table t1 (ts timestamp, k float);
|
sql create table t1 (ts timestamp, k float);
|
||||||
|
|
|
@ -9,7 +9,7 @@ sql connect
|
||||||
|
|
||||||
print ======================== dnode1 start
|
print ======================== dnode1 start
|
||||||
|
|
||||||
$dbPrefix = nest_query
|
$dbPrefix = nest_db
|
||||||
$tbPrefix = nest_tb
|
$tbPrefix = nest_tb
|
||||||
$mtPrefix = nest_mt
|
$mtPrefix = nest_mt
|
||||||
$tbNum = 10
|
$tbNum = 10
|
||||||
|
@ -17,7 +17,6 @@ $rowNum = 10000
|
||||||
$totalNum = $tbNum * $rowNum
|
$totalNum = $tbNum * $rowNum
|
||||||
|
|
||||||
print =============== nestquery.sim
|
print =============== nestquery.sim
|
||||||
|
|
||||||
$i = 0
|
$i = 0
|
||||||
$db = $dbPrefix . $i
|
$db = $dbPrefix . $i
|
||||||
$mt = $mtPrefix . $i
|
$mt = $mtPrefix . $i
|
||||||
|
|
|
@ -60,4 +60,5 @@ run general/parser/slimit_alter_tags.sim
|
||||||
run general/parser/binary_escapeCharacter.sim
|
run general/parser/binary_escapeCharacter.sim
|
||||||
run general/parser/between_and.sim
|
run general/parser/between_and.sim
|
||||||
run general/parser/last_cache.sim
|
run general/parser/last_cache.sim
|
||||||
|
run general/parser/nestquery.sim
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue