From 59aaca41f1d7fde6493c9164cabca840c3c4fd0a Mon Sep 17 00:00:00 2001 From: Bob Dempsey Date: Thu, 24 Jul 2014 08:56:08 -0500 Subject: [PATCH 1/3] 4.5.2 merge #1 --- InfiniDBContributorAgreement.pdf | Bin 0 -> 64230 bytes README.md | 28 ++- build/Build.bat | 5 +- build/clean | 1 - build/make_src_tar | 1 - build/releasenum | 4 +- configure | 20 +- configure.ac | 2 +- dbcon/ddlpackageproc/libddlpackageproc.rc | 8 +- dbcon/dmlpackage/calpontdmlpackage.h | 191 +++++++++--------- dbcon/dmlpackage/commanddmlpackage.cpp | 31 +-- dbcon/dmlpackage/deletedmlpackage.cpp | 22 +- dbcon/dmlpackage/insertdmlpackage.cpp | 77 +++---- dbcon/dmlpackage/updatedmlpackage.cpp | 30 +-- .../commandpackageprocessor.cpp | 4 + dbcon/dmlpackageproc/libdmlpackageproc.rc | 8 +- dbcon/execplan/arithmeticcolumn.cpp | 13 +- dbcon/execplan/calpontselectexecutionplan.h | 4 +- dbcon/execplan/constantcolumn.h | 1 - dbcon/execplan/constantfilter.cpp | 36 +++- dbcon/execplan/constantfilter.h | 3 + dbcon/execplan/functioncolumn.cpp | 14 +- dbcon/execplan/returnedcolumn.cpp | 4 + dbcon/execplan/returnedcolumn.h | 11 +- dbcon/execplan/simplecolumn.cpp | 6 + dbcon/execplan/simplecolumn.h | 1 - dbcon/execplan/simplefilter.cpp | 29 +++ dbcon/execplan/simplefilter.h | 3 + dbcon/joblist/crossenginestep.cpp | 16 ++ dbcon/joblist/expressionstep.cpp | 122 +++++++++-- dbcon/joblist/expressionstep.h | 4 + dbcon/joblist/jlf_common.cpp | 3 + dbcon/joblist/jlf_common.h | 2 - dbcon/joblist/jlf_execplantojoblist.cpp | 170 +++++++++++++++- dbcon/joblist/jlf_tuplejoblist.cpp | 16 +- dbcon/joblist/joblistfactory.cpp | 3 - dbcon/joblist/jobstep.cpp | 4 +- dbcon/joblist/jobstep.h | 29 +++ dbcon/joblist/libjoblist.rc | 8 +- dbcon/joblist/pdictionaryscan.cpp | 48 +++-- dbcon/joblist/primitivestep.h | 1 + dbcon/joblist/resourcemanager.cpp | 2 +- dbcon/joblist/subquerystep.cpp | 16 ++ dbcon/joblist/tuple-bps.cpp | 88 ++++---- dbcon/joblist/tupleaggregatestep.cpp | 67 +++++- dbcon/joblist/tupleannexstep.cpp | 78 +++---- dbcon/joblist/tupleconstantstep.cpp | 18 +- dbcon/joblist/tuplehashjoin.cpp | 25 ++- dbcon/joblist/tuplehashjoin.h | 8 +- dbcon/joblist/tuplehavingstep.cpp | 18 +- dbcon/joblist/tupleunion.cpp | 24 ++- dbcon/joblist/windowfunctionstep.cpp | 51 ++++- dbcon/joblist/windowfunctionstep.h | 1 + dbcon/mysql/ha_calpont_ddl.cpp | 4 +- dbcon/mysql/ha_calpont_dml.cpp | 13 +- dbcon/mysql/ha_calpont_execplan.cpp | 139 ++++++++----- dbcon/mysql/ha_calpont_impl.cpp | 108 +++++++++- dbcon/mysql/ha_calpont_impl_if.h | 2 +- dbcon/mysql/ha_from_sub.cpp | 37 ++-- dbcon/mysql/ha_window_function.cpp | 21 +- dbcon/mysql/libcalmysql.rc | 8 +- dbcon/mysql/mysql-Calpont | 2 +- ddlproc/DDLProc.rc | 8 +- decomsvr/DecomSvr.rc | 8 +- dmlproc/DMLProc.rc | 8 +- dmlproc/dmlprocessor.cpp | 7 +- exemgr/ExeMgr.rc | 8 +- exemgr/main.cpp | 74 +++---- oam/install_scripts/binary_installer.sh | 1 + oam/install_scripts/infinidb | 2 +- oam/install_scripts/infinidb.def | 5 +- oam/install_scripts/performance_installer.sh | 1 + oam/install_scripts/post-install | 2 +- oam/install_scripts/startupTests.sh | 2 +- oam/install_scripts/user_installer.sh | 1 + oam/oamcpp/liboamcpp.rc | 8 +- oam/post/functions | 2 +- oam/post/test-001.sh | 2 +- oam/post/test-002.sh | 2 +- oam/post/test-003.sh | 2 +- oam/post/test-004.sh | 2 +- oamapps/calpontSupport/findStranded.sh | 2 +- oamapps/calpontSupport/sqlLogs.sh | 2 +- oamapps/postConfigure/helpers.cpp | 6 +- oamapps/postConfigure/postConfigure.cpp | 19 +- primitives/primproc/PrimProc.rc | 8 +- tools/dbloadxml/colxml.rc | 8 +- tools/setConfig/configxml.sh | 2 +- utils/autoconf/configure.ac | 2 +- utils/configcpp/libconfigcpp.rc | 8 +- utils/configcpp/versionnumber.h | 4 +- utils/dataconvert/dataconvert.cpp | 56 +++-- utils/funcexp/func_date_add.cpp | 23 ++- utils/funcexp/funcexp.cpp | 3 + utils/idbhdfs/hdfs-12/setenv-hdfs-12 | 19 +- utils/idbhdfs/hdfs-20/setenv-hdfs-20 | 21 +- utils/querytele/querytele_types.cpp | 4 +- utils/querytele/querytele_types.h | 2 +- utils/querytele/queryteleclient.cpp | 8 +- utils/querytele/queryteleclient.h | 2 + utils/querytele/queryteleprotoimpl.cpp | 174 +++++++++++++++- utils/querytele/queryteleprotoimpl.h | 5 + utils/querytele/serverdriver.cpp | 4 +- utils/querytele/telestats.h | 2 +- utils/rowgroup/rowgroup.cpp | 130 ++++++------ utils/rowgroup/rowgroup.h | 36 ++-- utils/udfsdk/libudf_mysql.rc | 8 +- utils/udfsdk/libudfsdk.rc | 8 +- utils/winport/idb_64_enterprise.nsi | 6 +- utils/winport/idb_64_standard.nsi | 6 +- utils/winport/libwinport.vcxproj | 17 ++ utils/winport/winfinidb.rc | 8 +- versioning/BRM/controllernode.rc | 8 +- versioning/BRM/dbrm.cpp | 7 +- versioning/BRM/libbrm.rc | 8 +- versioning/BRM/oidserver.cpp | 14 +- versioning/BRM/tablelockserver.cpp | 2 + versioning/BRM/workernode.rc | 8 +- writeengine/bulk/cpimport.cpp | 1 - writeengine/bulk/cpimport.rc | 8 +- writeengine/bulk/we_tableinfo.cpp | 1 + writeengine/libwriteengine.rc | 8 +- writeengine/server/WriteEngineServer.rc | 8 +- writeengine/shared/we_bulkrollbackmgr.cpp | 80 +++++++- writeengine/splitter/splitter.rc | 8 +- writeengine/splitter/we_brmupdater.cpp | 6 +- writeengine/splitter/we_brmupdater.h | 3 +- writeengine/splitter/we_sdhandler.cpp | 17 +- writeengine/splitter/we_sdhandler.h | 10 +- writeengine/splitter/we_splclient.cpp | 2 +- writeengine/splitter/we_splclient.h | 6 +- 131 files changed, 1908 insertions(+), 758 deletions(-) create mode 100644 InfiniDBContributorAgreement.pdf diff --git a/InfiniDBContributorAgreement.pdf b/InfiniDBContributorAgreement.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b48a2ae4e16fca6c68be0fd0ca33141104904f89 GIT binary patch literal 64230 zcmZ5{Wl&sA&@K|(b#Yxhu(&%cPH=a3clQLB1pel`9Oiy=@)tPfnPj?T4x~v>K7Y8po!`9KCU+DZaoHTBhj_9JIAngEm8yb*|g|~&X zn;kkx-NMesi-zk>u8A%#j&9>>{hyw||F8d_+JDNPHm=_PqYcuu@pAL=w0dj))~&jy zo0XQ0w-=2O=xt~kkhYD#Hw{S9<*l9c|CBQSQ!1LEgTVgY@><>&-ZuZWmFJ`p{ND+H zu{%eR_S8c)8qox!<_onYLGXdO?AeN&MXid!7zE z3H!GZ_AuW2Iz3JOdim-f`{j}P$br)8-}IfC(y`XdUYSAOYt!RZQ2=NE3ySLB#jt;S z8?Vm~^vx147ZR@!)3sl(pwjD~5-&HP*R6m{iRU-+qE}p^?BGE$uk9tZsYG#KEoh-j z;aC&M@_Nm6sS0IMdOk=i&W`hZW??V4&kzlLthNNpq!C&QBn4%x5h^l3g1w#y!7zI% zuk}?(C*2VkYqk+ea%6XF2xXW)V3II#?lqk*F(JJvn;HM|r~I1eY;{axM{$Qyqj;C; zS+u!22wJIV4_)@^bNSH3R+DIM-v+mDT}fDg?IQwY)H? zHioid5nRl&ritFQXm_*c@wa}aNK0iF{T`RsUFHcAEC zc-iX0*{k#|HgTjderUyQ1$e+BpLqiVFI6>PtEjP72m)PPA)xcI-KPsihsUyQlQiId z&p{;+*Ps|0_JIF(I2oydKyF%A@iP?H6a8MS&|C z#JDZu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atsef7qv9K($ds=2-fh(w1 zF>I3%6fH7@;KxPeRH{55SdcEq}l9tct-^RZIF$IQjdAtk@HRI?*`#2oIqvW&?Qv+GfVZp{eb%8Z`){d(ySw=dERV=%8_V@e zFUbpp-;axV$6c?zQ4+YLXN&JG$Y#dB^)g*e{7#IkL0)&y=KX(ERzsIB0^VRB)Tg7& zzBQNsTz0{YXa7Fg8}hczb%6wYcOZ7zpo`tit0da4mt7`{dL%sS81Fn-Rl8Wu@5q81 zG<7(0ZTGLVti%3ov74GDbiGIlFq^YAt4CxvaCrD=KVP2rl*S^3xrRHiHC-6c2BSrR z=Pt#mjzooo`oE;kBc&W@7_G#^QeIk)&(4$Kd#TU5C|tsqf=Jj{eGHO7n)>_s_zFQ1|YxO=P8vZLu4TbvLmwmzl)rMot>4P+>HFcX>45VTp!5pe=c&n|Dkbmuz!Ge z|C7eW!S(@||4$kx7yG|uIe|*HT@?VR~!OF$Kjz~o%t|0M$0060AdjJ3c literal 0 HcmV?d00001 diff --git a/README.md b/README.md index 3e3fdc59..cdd161ef 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# This is InfiniDB 4.5.1 +# This is InfiniDB 4.5.2 ## Build prerequisites To build InfiniDB from source you will need: @@ -22,9 +22,9 @@ Along with a working C++ compiler and GNU software development tools you will ne ### InfiniDB MySQL - wget -Omysql-4.5.1-3.tar.gz https://github.com/infinidb/mysql/archive/4.5.1-3.tar.gz - tar -zxf mysql-4.5.1-3.tar.gz - ln -s mysql-4.5.1-3 mysql + wget -Omysql-4.5.2-1.tar.gz https://github.com/infinidb/mysql/archive/4.5.2-1.tar.gz + tar -zxf mysql-4.5.2-1.tar.gz + ln -s mysql-4.5.2-1 mysql cd mysql ./configure --prefix=$HOME/infinidb/mysql make @@ -33,9 +33,9 @@ Along with a working C++ compiler and GNU software development tools you will ne ### InfiniDB cd .. - wget -Oinfinidb-4.5.1-3.tar.gz https://github.com/infinidb/infinidb/archive/4.5.1-3.tar.gz - tar -zxf infinidb-4.5.1-3.tar.gz - ln -s infinidb-4.5.1-3 infinidb + wget -Oinfinidb-4.5.2-1.tar.gz https://github.com/infinidb/infinidb/archive/4.5.2-1.tar.gz + tar -zxf infinidb-4.5.2-1.tar.gz + ln -s infinidb-4.5.2-1 infinidb cd infinidb ./configure --prefix=$HOME/infinidb make @@ -44,3 +44,17 @@ Along with a working C++ compiler and GNU software development tools you will ne This will leave you with `$HOME/infinidb` as a binary tree. Follow the Binary Download instructions in the InfiniDB 4.5 Installation Guide (available on http://www.infinidb.co/). +## How to Contribute + * You may submit your contributions via GitHub pull requests. + * The submission must be by the original author. + * Along with any pull requests, please state that the contribution is your original work +and that you license the work to the project under the project's open source license +and the InfiniDB Contributor Agreement +(see InfiniDBContributorAgreement.pdf). Whether or not you state this explicitly, +by submitting any copyrighted material via pull request, email, or other means you agree to +license the material under the project's open source license and warrant that you have the +legal authority to do so. + * The InfiniDB Project committee will review your pull request and shall decide when and +whether to merge your request in the main InfiniDB project. The InfiniDB Project +committee will inform you of any decision regarding your request. + diff --git a/build/Build.bat b/build/Build.bat index 72935475..3757e542 100755 --- a/build/Build.bat +++ b/build/Build.bat @@ -1,8 +1,8 @@ @echo off set branch=%1 -IF "%1" == "" ( - set branch=4.5.1 +IF "%branch%" == "" ( + set branch=4.5 ) set basedir=\InfiniDB_%branch% echo Building %basedir% @@ -14,7 +14,6 @@ git checkout %branch% git stash git pull git stash pop -IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER echo ====================================== echo updating InfiniDB source diff --git a/build/clean b/build/clean index bca6a966..d85e3b61 100755 --- a/build/clean +++ b/build/clean @@ -7,7 +7,6 @@ for x in \ dbcon \ ddlproc \ decomsvr \ -dmlib \ dmlproc \ exemgr \ mysql \ diff --git a/build/make_src_tar b/build/make_src_tar index a30bedc3..0000c358 100755 --- a/build/make_src_tar +++ b/build/make_src_tar @@ -94,7 +94,6 @@ rm -rf utils/multicast rm -rf utils/openpgm rm -rf tools/reserveStacks rm -rf dbcon/doc dbcon/ingres dbcon/plsql -rm -rf dmlib cd tools rm -rf brmtest dataPump evalidx fixdate nettest pgm pingproc rebuildEM snconvert updateGenii valprint rm -rf cfread dbgen dbgen-ssb ddldriver dmldriver idb_comp sendPlan vbgen diff --git a/build/releasenum b/build/releasenum index 2649d1ea..90bb05b1 100644 --- a/build/releasenum +++ b/build/releasenum @@ -1,5 +1,5 @@ # $Id: releasenum 1851 2013-03-22 20:48:04Z dhill $ -version=4.5.1 -release=3 +version=4.5.2 +release=1 diff --git a/configure b/configure index 081f0b90..6237f864 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for infinidb 4.5.1. +# Generated by GNU Autoconf 2.59 for infinidb 4.5.2. # # Report bugs to . # @@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='infinidb' PACKAGE_TARNAME='infinidb' -PACKAGE_VERSION='4.5.1' -PACKAGE_STRING='infinidb 4.5.1' +PACKAGE_VERSION='4.5.2' +PACKAGE_STRING='infinidb 4.5.2' PACKAGE_BUGREPORT='support@infinidb.co' ac_default_prefix=/usr/local @@ -954,7 +954,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures infinidb 4.5.1 to adapt to many kinds of systems. +\`configure' configures infinidb 4.5.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1020,7 +1020,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of infinidb 4.5.1:";; + short | recursive ) echo "Configuration of infinidb 4.5.2:";; esac cat <<\_ACEOF @@ -1163,7 +1163,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -infinidb configure 4.5.1 +infinidb configure 4.5.2 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1177,7 +1177,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by infinidb $as_me 4.5.1, which was +It was created by infinidb $as_me 4.5.2, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1833,7 +1833,7 @@ fi # Define the identity of the package. PACKAGE='infinidb' - VERSION='4.5.1' + VERSION='4.5.2' cat >>confdefs.h <<_ACEOF @@ -25753,7 +25753,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by infinidb $as_me 4.5.1, which was +This file was extended by infinidb $as_me 4.5.2, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25819,7 +25819,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -infinidb config.status 4.5.1 +infinidb config.status 4.5.2 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index a25d7d11..1e3637e9 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(infinidb, 4.5.1, support@infinidb.co) +AC_INIT(infinidb, 4.5.2, support@infinidb.co) ### we don't want the deault CXXFLAGS set by AC_INIT, but we do want to allow the user to set them SAVE_CXXFLAGS= if test -n "$CXXFLAGS"; then diff --git a/dbcon/ddlpackageproc/libddlpackageproc.rc b/dbcon/ddlpackageproc/libddlpackageproc.rc index 24a6b02f..512bff8b 100644 --- a/dbcon/ddlpackageproc/libddlpackageproc.rc +++ b/dbcon/ddlpackageproc/libddlpackageproc.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB DDL API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "libddlpackageproc" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "libddlpackageproc.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/dbcon/dmlpackage/calpontdmlpackage.h b/dbcon/dmlpackage/calpontdmlpackage.h index 311d9d8b..01e94068 100644 --- a/dbcon/dmlpackage/calpontdmlpackage.h +++ b/dbcon/dmlpackage/calpontdmlpackage.h @@ -25,6 +25,8 @@ #ifndef CALPONTDMLPACKAGE_H #define CALPONTDMLPACKAGE_H #include +#include + #include "bytestream.h" #include "dmlpackage.h" #include "dmltable.h" @@ -84,160 +86,152 @@ namespace dmlpackage * @param sqlStatement the parsed SqlStatement */ virtual int buildFromSqlStatement( SqlStatement& sqlStatement ) = 0; - - /** @brief build a CalpontDMLPackage from valuelist built from mysql table fields + + /** @brief build a CalpontDMLPackage from valuelist built from mysql table fields * * @param tableValuesMap the value list for each column in the table - * @param colNameList the column name for each column - * @param columns number of columns in the table - * @param rows number of rows to be touched + * @param colNameList the column name for each column + * @param columns number of columns in the table + * @param rows number of rows to be touched */ - virtual int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows) = 0; + virtual int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows) = 0; /** @brief get the table object */ - inline DMLTable* get_Table() { return fTable; } + DMLTable* get_Table() { return fTable; } /** @brief set the DML statement (the parsed statement) * * @param statement the dml statement to set */ - inline void set_DMLStatement( const std::string& statement ) - { fDMLStatement = statement; } + void set_DMLStatement( const std::string& statement ) { fDMLStatement = statement; } /** @brief get the DML statement (the parsed statement) */ - inline const std::string get_DMLStatement() const { return fDMLStatement; } + const std::string get_DMLStatement() const { return fDMLStatement; } /** @brief set the SQL statement (the original SQL statement) * * @param statement the SQL statement to set (the original SQL statement with quotes) */ - inline void set_SQLStatement( const std::string& statement ) - { fSQLStatement = statement; } + void set_SQLStatement( const std::string& statement ) { fSQLStatement = statement; } /** @brief get the SQL statement (the original SQL statement) */ - inline const std::string get_SQLStatement() const { return fSQLStatement; } - - /** @brief get the logging flag - */ - inline const bool get_Logging() const { return fLogging; } - - /** @brief set the logging flag + const std::string get_SQLStatement() const { return fSQLStatement; } + + /** @brief get the logging flag + */ + const bool get_Logging() const { return fLogging; } + + /** @brief set the logging flag * * @param logging the logging flag to set */ - inline void set_Logging( bool logging ) - { - fLogging = logging; - } - - /** @brief get the logending flag - */ - inline const bool get_Logending() const { return fLogending; } - - /** @brief set the logending flag + void set_Logging( bool logging ) { fLogging = logging; } + + /** @brief get the logending flag + */ + const bool get_Logending() const { return fLogending; } + + /** @brief set the logending flag * * @param logending the logending flag to set */ - inline void set_Logending( bool logending ) - { - fLogending = logending; - } - - /** @brief get the isFromCol flag - */ - inline const bool get_IsFromCol() const { return fIsFromCol; } - - /** @brief set the update column from column flag + void set_Logending( bool logending ) { fLogending = logending; } + + /** @brief get the isFromCol flag + */ + const bool get_IsFromCol() const { return fIsFromCol; } + + /** @brief set the update column from column flag * * @param logging the logging flag to set */ - inline void set_IsFromCol ( bool isFromCol ) - { - fIsFromCol = isFromCol; - } + void set_IsFromCol ( bool isFromCol ) { fIsFromCol = isFromCol; } /** @brief set the Table name * * @param tableName the name to set */ - inline void set_TableName( std::string& tableName ) - { - fTableName = tableName; - if(fTable != 0) - fTable->set_TableName(tableName); - } + void set_TableName( std::string& tableName ) + { + fTableName = tableName; + if(fTable != 0) + fTable->set_TableName(tableName); + } /** @brief get the Table name */ - inline const std::string get_TableName() const { return fTableName; } + const std::string get_TableName() const { return fTableName; } /** @brief set the Schema name * * @param the schema to set */ - inline void set_SchemaName( std::string& schemaName ) - { - fSchemaName = schemaName; - if(fTable != 0) - fTable->set_SchemaName(schemaName); - } + void set_SchemaName( std::string& schemaName ) + { + fSchemaName = schemaName; + if(fTable != 0) + fTable->set_SchemaName(schemaName); + } /** @brief get the Schema name */ - inline const std::string get_SchemaName() const { return fSchemaName; } + const std::string get_SchemaName() const { return fSchemaName; } /** @brief does this dml statement have a filter */ - inline bool HasFilter() const { return fHasFilter; } - inline void HasFilter( bool hasFilter) { fHasFilter = hasFilter; } + bool HasFilter() const { return fHasFilter; } + void HasFilter( bool hasFilter) { fHasFilter = hasFilter; } /** @brief get the filter statement */ - inline const std::string get_QueryString() const { return fQueryString; } + const std::string get_QueryString() const { return fQueryString; } /** @brief set the sessionID associated with this package */ - inline void set_SessionID( int sessionID ) { fSessionID = sessionID; } + void set_SessionID( int sessionID ) { fSessionID = sessionID; } /** @brief get the sessionID associated with this package */ - inline int get_SessionID() const { return fSessionID; } - - /** @brief set the transaction ID associated with this package + int get_SessionID() const { return fSessionID; } + + /** @brief set the transaction ID associated with this package */ - inline void set_TxnID( execplan::CalpontSystemCatalog::SCN txnID ) { fTxnId = txnID; } + void set_TxnID( execplan::CalpontSystemCatalog::SCN txnID ) { fTxnId = txnID; } /** @brief get the transaction ID associated with this package */ - inline execplan::CalpontSystemCatalog::SCN get_TxnID() const { return fTxnId; } - /** @brief set the chunkmanager associated with this package + execplan::CalpontSystemCatalog::SCN get_TxnID() const { return fTxnId; } + /** @brief set the chunkmanager associated with this package */ - inline void set_ChunkManager( WriteEngine::ChunkManager* cm ) { fCM = cm; } + void set_ChunkManager( WriteEngine::ChunkManager* cm ) { fCM = cm; } /** @brief get the chunkmanager associated with this package */ - inline WriteEngine::ChunkManager* get_ChunkManager() const { return fCM; } - /** @brief get the ExecutionPlan associated with this package - */ - inline boost::shared_ptr get_ExecutionPlan() - { - return fPlan; - } - - inline bool get_isInsertSelect() { return fIsInsertSelect; } - inline void set_isInsertSelect( const bool isInsertSelect ) { fIsInsertSelect = isInsertSelect; } - - inline bool get_isBatchInsert() { return fIsBatchInsert; } - inline void set_isBatchInsert( const bool isBatchInsert ) { fIsBatchInsert = isBatchInsert; } - - inline bool get_isAutocommitOn() { return fIsAutocommitOn; } - inline void set_isAutocommitOn( const bool isAutocommitOn ) { fIsAutocommitOn = isAutocommitOn; } - - inline uint32_t getTableOid() { return fTableOid; } - inline void setTableOid( const uint32_t tableOid ) { fTableOid = tableOid; } - + WriteEngine::ChunkManager* get_ChunkManager() const { return fCM; } + + /** @brief get the ExecutionPlan associated with this package + */ + boost::shared_ptr get_ExecutionPlan() + { + return fPlan; + } + + bool get_isInsertSelect() { return fIsInsertSelect; } + void set_isInsertSelect( const bool isInsertSelect ) { fIsInsertSelect = isInsertSelect; } + + bool get_isBatchInsert() { return fIsBatchInsert; } + void set_isBatchInsert( const bool isBatchInsert ) { fIsBatchInsert = isBatchInsert; } + + bool get_isAutocommitOn() { return fIsAutocommitOn; } + void set_isAutocommitOn( const bool isAutocommitOn ) { fIsAutocommitOn = isAutocommitOn; } + uint32_t getTableOid() { return fTableOid; } + void setTableOid( const uint32_t tableOid ) { fTableOid = tableOid; } + + void uuid(const boost::uuids::uuid& uuid) { fUuid = uuid; } + const boost::uuids::uuid& uuid() const { return fUuid; } + protected: void initializeTable(); @@ -248,19 +242,20 @@ namespace dmlpackage std::string fSQLStatement; std::string fQueryString; int fSessionID; - execplan::CalpontSystemCatalog::SCN fTxnId; - boost::shared_ptr fPlan; + boost::uuids::uuid fUuid; + execplan::CalpontSystemCatalog::SCN fTxnId; + boost::shared_ptr fPlan; DMLTable *fTable; bool fHasFilter; - bool fLogging; - bool fLogending; - bool fIsFromCol; + bool fLogging; + bool fLogending; + bool fIsFromCol; std::string StripLeadingWhitespace( std::string value ); - bool fIsInsertSelect; - bool fIsBatchInsert; - bool fIsAutocommitOn; - uint32_t fTableOid; - WriteEngine::ChunkManager* fCM; + bool fIsInsertSelect; + bool fIsBatchInsert; + bool fIsAutocommitOn; + uint32_t fTableOid; + WriteEngine::ChunkManager* fCM; }; } #endif //CALPONTDMLPACKAGE_H diff --git a/dbcon/dmlpackage/commanddmlpackage.cpp b/dbcon/dmlpackage/commanddmlpackage.cpp index 56b22e9a..a2ddfa18 100644 --- a/dbcon/dmlpackage/commanddmlpackage.cpp +++ b/dbcon/dmlpackage/commanddmlpackage.cpp @@ -52,14 +52,16 @@ namespace dmlpackage messageqcpp::ByteStream::quadbyte session_id = fSessionID; bytestream << session_id; + bytestream << fUuid; + bytestream << fDMLStatement; bytestream << fSQLStatement; // for cleartablelock, this is table lockID - bytestream << (uint8_t)fLogging; - bytestream << fSchemaName; - bytestream << fTableName; - bytestream << fTableOid; - bytestream << static_cast(fIsAutocommitOn); - bytestream << static_cast(fIsBatchInsert); + bytestream << (uint8_t)fLogging; + bytestream << fSchemaName; + bytestream << fTableName; + bytestream << fTableOid; + bytestream << static_cast(fIsAutocommitOn); + bytestream << static_cast(fIsBatchInsert); return retval; } @@ -70,17 +72,18 @@ namespace dmlpackage messageqcpp::ByteStream::quadbyte session_id; bytestream >> session_id; fSessionID = session_id; + bytestream >> fUuid; bytestream >> fDMLStatement; bytestream >> fSQLStatement; // for cleartablelock, this is table lockID - uint8_t logging; - bytestream >> logging; - fLogging = (logging != 0); - bytestream >> fSchemaName; - bytestream >> fTableName; - bytestream >> fTableOid; - bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsAutocommitOn); - bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsBatchInsert); + uint8_t logging; + bytestream >> logging; + fLogging = (logging != 0); + bytestream >> fSchemaName; + bytestream >> fTableName; + bytestream >> fTableOid; + bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsAutocommitOn); + bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsBatchInsert); return retval; } diff --git a/dbcon/dmlpackage/deletedmlpackage.cpp b/dbcon/dmlpackage/deletedmlpackage.cpp index bbeb5890..a6858c0c 100644 --- a/dbcon/dmlpackage/deletedmlpackage.cpp +++ b/dbcon/dmlpackage/deletedmlpackage.cpp @@ -62,6 +62,8 @@ int DeleteDMLPackage::write(messageqcpp::ByteStream& bytestream) messageqcpp::ByteStream::quadbyte hasFilter = fHasFilter; bytestream << hasFilter; + bytestream << fUuid; + bytestream << fDMLStatement; bytestream << fSQLStatement; bytestream << fSchemaName; @@ -92,6 +94,8 @@ int DeleteDMLPackage::read(messageqcpp::ByteStream& bytestream) bytestream >> hasFilter; fHasFilter = (hasFilter != 0); + bytestream >> fUuid; + std::string dmlStatement; bytestream >> fDMLStatement; bytestream >> fSQLStatement; @@ -187,26 +191,26 @@ int DeleteDMLPackage::buildFromBuffer(std::string& buffer, int columns, int rows int DeleteDMLPackage::buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows ) { - int retval = 1; + int retval = 1; initializeTable(); - //The row already built from MySql parser. -/* Row *aRowPtr = new Row(); - std::string colName; - std::vector colValList; - for (int j = 0; j < columns; j++) + //The row already built from MySql parser. +/* Row *aRowPtr = new Row(); + std::string colName; + std::vector colValList; + for (int j = 0; j < columns; j++) { //Build a column list colName = colNameList[j]; - + colValList = tableValuesMap[j]; DMLColumn* aColumn = new DMLColumn(colName, colValList, false); (aRowPtr->get_ColumnList()).push_back(aColumn); } - //build a row list for a table + //build a row list for a table fTable->get_RowList().push_back(aRowPtr); */ - return retval; + return retval; } } // namespace dmlpackage diff --git a/dbcon/dmlpackage/insertdmlpackage.cpp b/dbcon/dmlpackage/insertdmlpackage.cpp index b331d227..9caf5eb3 100644 --- a/dbcon/dmlpackage/insertdmlpackage.cpp +++ b/dbcon/dmlpackage/insertdmlpackage.cpp @@ -57,20 +57,22 @@ int InsertDMLPackage::write(messageqcpp::ByteStream& bytestream) messageqcpp::ByteStream::quadbyte session_id = fSessionID; bytestream << session_id; + bytestream << fUuid; + bytestream << fDMLStatement; bytestream << fDMLStatement; bytestream << fSchemaName; - bytestream << (uint8_t)fLogging; - bytestream << (uint8_t)fLogending; + bytestream << (uint8_t)fLogging; + bytestream << (uint8_t)fLogending; if (fTable != 0) { retval = fTable->write(bytestream); } - bytestream << fTableOid; - bytestream << static_cast(fIsInsertSelect); - bytestream << static_cast(fIsBatchInsert); - bytestream << static_cast(fIsAutocommitOn); - + bytestream << fTableOid; + bytestream << static_cast(fIsInsertSelect); + bytestream << static_cast(fIsBatchInsert); + bytestream << static_cast(fIsAutocommitOn); + return retval; } @@ -81,24 +83,25 @@ int InsertDMLPackage::read(messageqcpp::ByteStream& bytestream) messageqcpp::ByteStream::quadbyte session_id; bytestream >> session_id; fSessionID = session_id; + bytestream >> fUuid; std::string dmlStatement; bytestream >> fDMLStatement; - bytestream >> fSQLStatement; + bytestream >> fSQLStatement; bytestream >> fSchemaName; - uint8_t logging; - bytestream >> logging; - fLogging = (logging != 0); - uint8_t logending; - bytestream >> logending; - fLogending = (logending != 0); - + uint8_t logging; + bytestream >> logging; + fLogging = (logging != 0); + uint8_t logending; + bytestream >> logending; + fLogending = (logending != 0); + fTable = new DMLTable(); retval = fTable->read(bytestream); - bytestream >> fTableOid; - bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsInsertSelect); - bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsBatchInsert); - bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsAutocommitOn); + bytestream >> fTableOid; + bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsInsertSelect); + bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsBatchInsert); + bytestream >> reinterpret_cast< messageqcpp::ByteStream::byte&>(fIsAutocommitOn); return retval; } @@ -150,27 +153,27 @@ int InsertDMLPackage::buildFromBuffer(std::string& buffer, int columns, int rows int InsertDMLPackage::buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows ) { - int retval = 1; + int retval = 1; initializeTable(); - Row *aRowPtr = new Row(); - std::string colName; - std::vector colValList; - for (int j = 0; j < columns; j++) + Row *aRowPtr = new Row(); + std::string colName; + std::vector colValList; + for (int j = 0; j < columns; j++) { //Build a column list colName = colNameList[j]; - + colValList = tableValuesMap[j]; DMLColumn* aColumn = new DMLColumn(colName, colValList, false); (aRowPtr->get_ColumnList()).push_back(aColumn); } - //build a row list for a table + //build a row list for a table fTable->get_RowList().push_back(aRowPtr); - aRowPtr = NULL; - delete aRowPtr; - return retval; + aRowPtr = NULL; + delete aRowPtr; + return retval; } int InsertDMLPackage::buildFromSqlStatement(SqlStatement& sqlStatement) @@ -184,7 +187,7 @@ int InsertDMLPackage::buildFromSqlStatement(SqlStatement& sqlStatement) throw runtime_error("insertStmt.fValuesOrQueryPtr == NULL"); initializeTable(); - bool isNULL = false; + bool isNULL = false; // only if we don't have a select statement if (0 == insertStmt.fValuesOrQueryPtr->fQuerySpecPtr) { @@ -219,13 +222,13 @@ int InsertDMLPackage::buildFromSqlStatement(SqlStatement& sqlStatement) { colValue = *iter; if ( strcasecmp(colValue.c_str(), "NULL") == 0) - { - isNULL = true; - } - else - { - isNULL = false; - } + { + isNULL = true; + } + else + { + isNULL = false; + } DMLColumn *aColumn = new DMLColumn(colName,colValue, isNULL); (aRow->get_ColumnList()).push_back(aColumn); diff --git a/dbcon/dmlpackage/updatedmlpackage.cpp b/dbcon/dmlpackage/updatedmlpackage.cpp index 8c886ad7..de634d32 100644 --- a/dbcon/dmlpackage/updatedmlpackage.cpp +++ b/dbcon/dmlpackage/updatedmlpackage.cpp @@ -61,10 +61,12 @@ int UpdateDMLPackage::write(messageqcpp::ByteStream& bytestream) messageqcpp::ByteStream::quadbyte hasFilter = fHasFilter; bytestream << hasFilter; + bytestream << fUuid; + bytestream << fDMLStatement; bytestream << fSQLStatement; bytestream << fSchemaName; - bytestream << (uint8_t)fIsFromCol; + bytestream << (uint8_t)fIsFromCol; if (fTable != 0) { retval = fTable->write(bytestream); @@ -72,7 +74,7 @@ int UpdateDMLPackage::write(messageqcpp::ByteStream& bytestream) if(fHasFilter) { bytestream += *(fPlan.get()); - } + } return retval; } @@ -92,13 +94,15 @@ int UpdateDMLPackage::read(messageqcpp::ByteStream& bytestream) bytestream >> hasFilter; fHasFilter = (hasFilter != 0); + bytestream >> fUuid; + std::string dmlStatement; bytestream >> fDMLStatement; bytestream >> fSQLStatement; bytestream >> fSchemaName; - uint8_t isFromCol; - bytestream >> isFromCol; - fIsFromCol = (isFromCol != 0); + uint8_t isFromCol; + bytestream >> isFromCol; + fIsFromCol = (isFromCol != 0); fTable = new DMLTable(); retval = fTable->read(bytestream); if(fHasFilter) @@ -204,25 +208,25 @@ int UpdateDMLPackage::buildFromBuffer(std::string& buffer, int columns, int rows } int UpdateDMLPackage::buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows ) { - int retval = 1; + int retval = 1; initializeTable(); - Row *aRowPtr = new Row(); - std::string colName; - std::vector colValList; - for (int j = 0; j < columns; j++) + Row *aRowPtr = new Row(); + std::string colName; + std::vector colValList; + for (int j = 0; j < columns; j++) { //Build a column list colName = colNameList[j]; - + colValList = tableValuesMap[j]; DMLColumn* aColumn = new DMLColumn(colName, colValList, false); (aRowPtr->get_ColumnList()).push_back(aColumn); } - //build a row list for a table + //build a row list for a table fTable->get_RowList().push_back(aRowPtr); - return retval; + return retval; } void UpdateDMLPackage::buildUpdateFromMysqlBuffer(UpdateSqlStatement& updateStmt) diff --git a/dbcon/dmlpackageproc/commandpackageprocessor.cpp b/dbcon/dmlpackageproc/commandpackageprocessor.cpp index ecf356fa..17d0868f 100644 --- a/dbcon/dmlpackageproc/commandpackageprocessor.cpp +++ b/dbcon/dmlpackageproc/commandpackageprocessor.cpp @@ -151,9 +151,13 @@ CommandPackageProcessor::processPackage(dmlpackage::CalpontDMLPackage& cpackage) queRemoved = true; WE_DDLCommandClient ddlClient; uint8_t rc = ddlClient.UpdateSyscolumnNextval(columnOid, nextValInController); + //@bug 5894. Need release lock. + aDbrm->releaseAILock(columnOid); if (rc != 0) throw std::runtime_error("Error in UpdateSyscolumnNextval"); } + else + aDbrm->releaseAILock(columnOid); } } catch (std::exception& ex) diff --git a/dbcon/dmlpackageproc/libdmlpackageproc.rc b/dbcon/dmlpackageproc/libdmlpackageproc.rc index 5d28f013..dadab1d0 100644 --- a/dbcon/dmlpackageproc/libdmlpackageproc.rc +++ b/dbcon/dmlpackageproc/libdmlpackageproc.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB DML API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "libdmlpackageproc" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "libdmlpackageproc.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/dbcon/execplan/arithmeticcolumn.cpp b/dbcon/execplan/arithmeticcolumn.cpp index 10371f00..ef4b729a 100644 --- a/dbcon/execplan/arithmeticcolumn.cpp +++ b/dbcon/execplan/arithmeticcolumn.cpp @@ -323,7 +323,6 @@ void ArithmeticColumn::unserialize(messageqcpp::ByteStream& b) b >> reinterpret_cast< ByteStream::doublebyte&>(fAsc); fSimpleColumnList.clear(); - fAggColumnList.clear(); fExpression->walk(getSimpleCols, &fSimpleColumnList); fAggColumnList.clear(); fExpression->walk(getAggCols, &fAggColumnList); @@ -376,11 +375,12 @@ bool ArithmeticColumn::operator!=(const TreeNode* t) const bool ArithmeticColumn::hasAggregate() { + if (fHasAggregate) return true; fAggColumnList.clear(); fExpression->walk(getAggCols, &fAggColumnList); - if (fAggColumnList.empty()) - return false; - return true; + if (!fAggColumnList.empty()) + fHasAggregate = true; + return fHasAggregate; } bool ArithmeticColumn::hasWindowFunc() @@ -394,6 +394,11 @@ bool ArithmeticColumn::hasWindowFunc() void ArithmeticColumn::setDerivedTable() { + if (hasAggregate()) + { + fDerivedTable = ""; + return; + } if (fExpression) { fExpression->setDerivedTable(); diff --git a/dbcon/execplan/calpontselectexecutionplan.h b/dbcon/execplan/calpontselectexecutionplan.h index e142d20c..b1bb10ef 100644 --- a/dbcon/execplan/calpontselectexecutionplan.h +++ b/dbcon/execplan/calpontselectexecutionplan.h @@ -388,8 +388,8 @@ friend std::ostream &operator<< (std::ostream &, const CalpontSelectExecutionPla void stringTableThreshold(uint32_t t) { fStringTableThreshold = t; } uint32_t stringTableThreshold() const { return fStringTableThreshold; } - void uuid(boost::uuids::uuid uuid) { fUuid = uuid; } - const boost::uuids::uuid& uuid() const { return fUuid; } + void uuid(const boost::uuids::uuid& uuid) { fUuid = uuid; } + const boost::uuids::uuid& uuid() const { return fUuid; } /** * The serialization interface diff --git a/dbcon/execplan/constantcolumn.h b/dbcon/execplan/constantcolumn.h index d69035cb..a03330e2 100644 --- a/dbcon/execplan/constantcolumn.h +++ b/dbcon/execplan/constantcolumn.h @@ -153,7 +153,6 @@ class ConstantColumn : public ReturnedColumn { */ bool operator!=(const ConstantColumn& t) const; - virtual bool hasAggregate() {return false;} virtual bool hasWindowFunc() {return false;} /** Constant column on the filte can always be moved into derived table */ diff --git a/dbcon/execplan/constantfilter.cpp b/dbcon/execplan/constantfilter.cpp index 8ed061c6..2a2a5e06 100644 --- a/dbcon/execplan/constantfilter.cpp +++ b/dbcon/execplan/constantfilter.cpp @@ -35,6 +35,7 @@ using namespace std; #include "bytestream.h" #include "objectreader.h" #include "aggregatecolumn.h" +#include "windowfunctioncolumn.h" namespace { template struct deleter : public unary_function @@ -73,6 +74,7 @@ ConstantFilter::ConstantFilter(const ConstantFilter& rhs): { fFilterList.clear(); fSimpleColumnList.clear(); + fWindowFunctionColumnList.clear(); SSFP ssfp; for (uint32_t i = 0; i < rhs.fFilterList.size(); i++) { @@ -81,6 +83,12 @@ ConstantFilter::ConstantFilter(const ConstantFilter& rhs): fSimpleColumnList.insert(fSimpleColumnList.end(), ssfp->simpleColumnList().begin(), ssfp->simpleColumnList().end()); + fAggColumnList.insert(fAggColumnList.end(), + ssfp->aggColumnList().begin(), + ssfp->aggColumnList().end()); + fWindowFunctionColumnList.insert(fWindowFunctionColumnList.end(), + ssfp->windowfunctionColumnList().begin(), + ssfp->windowfunctionColumnList().end()); } } @@ -111,6 +119,19 @@ ostream& operator<<(ostream& output, const ConstantFilter& rhs) return output; } +bool ConstantFilter::hasAggregate() +{ + fAggColumnList.clear(); + for (uint32_t i = 0; i < fFilterList.size(); i++) + { + if (fFilterList[i]->hasAggregate()) + { + return true; + } + } + return false; +} + void ConstantFilter::serialize(messageqcpp::ByteStream& b) const { FilterList::const_iterator it; @@ -134,7 +155,7 @@ void ConstantFilter::unserialize(messageqcpp::ByteStream& b) { uint32_t size, i; ObjectReader::checkType(b, ObjectReader::CONSTANTFILTER); - SimpleFilter *sc; + SimpleFilter *sf; Filter::unserialize(b); fOp.reset(dynamic_cast(ObjectReader::createTreeNode(b))); @@ -143,9 +164,10 @@ void ConstantFilter::unserialize(messageqcpp::ByteStream& b) fFilterList.clear(); fSimpleColumnList.clear(); fAggColumnList.clear(); + fWindowFunctionColumnList.clear(); for (i = 0; i < size; i++) { - sc = dynamic_cast(ObjectReader::createTreeNode(b)); - SSFP ssfp(sc); + sf = dynamic_cast(ObjectReader::createTreeNode(b)); + SSFP ssfp(sf); fFilterList.push_back(ssfp); fSimpleColumnList.insert(fSimpleColumnList.end(), ssfp->simpleColumnList().begin(), @@ -153,6 +175,9 @@ void ConstantFilter::unserialize(messageqcpp::ByteStream& b) fAggColumnList.insert(fAggColumnList.end(), ssfp->aggColumnList().begin(), ssfp->aggColumnList().end()); + fWindowFunctionColumnList.insert(fWindowFunctionColumnList.end(), + ssfp->windowfunctionColumnList().begin(), + ssfp->windowfunctionColumnList().end()); } b >> fFunctionName; } @@ -209,6 +234,11 @@ bool ConstantFilter::operator!=(const TreeNode* t) const void ConstantFilter::setDerivedTable() { + if (fCol->hasAggregate()) + { + fDerivedTable = ""; + return; + } fDerivedTable = fCol->derivedTable(); } diff --git a/dbcon/execplan/constantfilter.h b/dbcon/execplan/constantfilter.h index b312b785..a1b7fbad 100644 --- a/dbcon/execplan/constantfilter.h +++ b/dbcon/execplan/constantfilter.h @@ -40,6 +40,7 @@ namespace execplan { class ReturnedColumn; class AggregateColumn; +class WindowFunctionColumn; /** * @brief A class to represent a simple column op constant predicate @@ -151,6 +152,7 @@ class ConstantFilter : public Filter { void setDerivedTable(); virtual void replaceRealCol(std::vector&); + virtual bool hasAggregate(); private: SOP fOp; /// connect operator (and or) @@ -179,6 +181,7 @@ class ConstantFilter : public Filter { private: std::vector fSimpleColumnList; std::vector fAggColumnList; + std::vector fWindowFunctionColumnList; }; inline bool ConstantFilter::getBoolVal(rowgroup::Row& row, bool& isNull) diff --git a/dbcon/execplan/functioncolumn.cpp b/dbcon/execplan/functioncolumn.cpp index 4c764043..df1bd741 100644 --- a/dbcon/execplan/functioncolumn.cpp +++ b/dbcon/execplan/functioncolumn.cpp @@ -236,7 +236,6 @@ void FunctionColumn::funcParms (const string& funcParmsInString) fFunctionParms.push_back(sc); } } - } void FunctionColumn::serialize(messageqcpp::ByteStream& b) const @@ -341,13 +340,14 @@ bool FunctionColumn::operator!=(const TreeNode* t) const bool FunctionColumn::hasAggregate() { + if (fHasAggregate) return true; fAggColumnList.clear(); for (uint32_t i = 0; i < fFunctionParms.size(); i++) fFunctionParms[i]->walk(getAggCols, &fAggColumnList); - if (fAggColumnList.empty()) - return false; - return true; + if (!fAggColumnList.empty()) + fHasAggregate = true; + return fHasAggregate; } bool FunctionColumn::hasWindowFunc() @@ -363,6 +363,12 @@ bool FunctionColumn::hasWindowFunc() void FunctionColumn::setDerivedTable() { + if (hasAggregate()) + { + fDerivedTable = ""; + return; + } + fSimpleColumnList.clear(); for (uint32_t i = 0; i < fFunctionParms.size(); i++) fFunctionParms[i]->walk(getSimpleCols, &fSimpleColumnList); diff --git a/dbcon/execplan/returnedcolumn.cpp b/dbcon/execplan/returnedcolumn.cpp index 11779650..b155adbb 100644 --- a/dbcon/execplan/returnedcolumn.cpp +++ b/dbcon/execplan/returnedcolumn.cpp @@ -47,6 +47,7 @@ ReturnedColumn::ReturnedColumn(): fReturnAll (false), fOrderPos((uint64_t)-1), fColSource(0), fColPosition(-1), + fHasAggregate(false), fInputIndex(-1), fOutputIndex(-1), fExpressionId ((uint32_t)-1) @@ -65,6 +66,7 @@ ReturnedColumn::ReturnedColumn(const string& sql): fOrderPos((uint64_t)-1), fColSource(0), fColPosition(-1), + fHasAggregate(false), fData(sql), fInputIndex(-1), fOutputIndex(-1), @@ -84,6 +86,7 @@ ReturnedColumn::ReturnedColumn(const uint32_t sessionID, const bool returnAll): fOrderPos((uint64_t)-1), fColSource(0), fColPosition(-1), + fHasAggregate(false), fInputIndex(-1), fOutputIndex(-1), fExpressionId ((uint32_t)-1) @@ -103,6 +106,7 @@ ReturnedColumn::ReturnedColumn(const ReturnedColumn& rhs, const uint32_t session fOrderPos(rhs.fOrderPos), fColSource(rhs.fColSource), fColPosition(rhs.fColPosition), + fHasAggregate(rhs.fHasAggregate), fData(rhs.fData), fInputIndex(rhs.fInputIndex), fOutputIndex(rhs.fOutputIndex), diff --git a/dbcon/execplan/returnedcolumn.h b/dbcon/execplan/returnedcolumn.h index 5733dfee..c57b8dc5 100644 --- a/dbcon/execplan/returnedcolumn.h +++ b/dbcon/execplan/returnedcolumn.h @@ -137,6 +137,10 @@ class ReturnedColumn : public TreeNode { virtual int64_t colPosition() const { return fColPosition; } virtual void colPosition(const int64_t colPosition) { fColPosition = colPosition; } + // Columns that may have aggregate column involved should implement this interface. + virtual bool hasAggregate() { return fHasAggregate;} + virtual void hasAggregate(bool hasAgg) { fHasAggregate = hasAgg; } + /** * Operations */ @@ -199,12 +203,6 @@ class ReturnedColumn : public TreeNode { const std::vector& windowfunctionColumnList() const { return fWindowFunctionColumnList; } - /* @brief if this column is or contains aggregate column - * - * @note after this function call fAggColumnList is populated - */ - virtual bool hasAggregate() = 0; - /* @brief if this column is or contains window function column * * @note after this function call fWindowFunctionColumnList is populated @@ -230,6 +228,7 @@ class ReturnedColumn : public TreeNode { std::vector fSimpleColumnList; std::vector fAggColumnList; std::vector fWindowFunctionColumnList; + bool fHasAggregate; /// connector internal use. no need to serialize private: std::string fData; diff --git a/dbcon/execplan/simplecolumn.cpp b/dbcon/execplan/simplecolumn.cpp index e19c8e6f..bdc07042 100644 --- a/dbcon/execplan/simplecolumn.cpp +++ b/dbcon/execplan/simplecolumn.cpp @@ -415,6 +415,12 @@ bool SimpleColumn::sameColumn(const ReturnedColumn* rc) const void SimpleColumn::setDerivedTable() { + if (hasAggregate()) + { + fDerivedTable = ""; + return; + } + // fDerivedTable is set at the parsing phase if (!fSchemaName.empty()) fDerivedTable = ""; diff --git a/dbcon/execplan/simplecolumn.h b/dbcon/execplan/simplecolumn.h index 3ff07e44..91d24acc 100644 --- a/dbcon/execplan/simplecolumn.h +++ b/dbcon/execplan/simplecolumn.h @@ -188,7 +188,6 @@ class SimpleColumn : public ReturnedColumn { /** @brief set the column's OID from the syscat */ void setOID(); - virtual bool hasAggregate() {return false;} virtual bool hasWindowFunc() {return false;} void setDerivedTable(); diff --git a/dbcon/execplan/simplefilter.cpp b/dbcon/execplan/simplefilter.cpp index 23e7eae1..3a3ad63f 100644 --- a/dbcon/execplan/simplefilter.cpp +++ b/dbcon/execplan/simplefilter.cpp @@ -515,6 +515,8 @@ void SimpleFilter::setDerivedTable() { string lDerivedTable = ""; string rDerivedTable = ""; + if (hasAggregate()) + return; if (fLhs) { @@ -587,5 +589,32 @@ void SimpleFilter::replaceRealCol(CalpontSelectExecutionPlan::ReturnedColumnList } } +bool SimpleFilter::hasAggregate() +{ + AggregateColumn *lac = dynamic_cast(fLhs); + AggregateColumn *rac = dynamic_cast(fRhs); + fAggColumnList.clear(); + + if (lac) + { + return true; + } + else if (fLhs) + { + if (fLhs->hasAggregate()) + return true; + } + + if (rac) + { + return true; + } + else if (fRhs) + { + if (fRhs->hasAggregate()) + return true; + } + return false; +} } // namespace execplan diff --git a/dbcon/execplan/simplefilter.h b/dbcon/execplan/simplefilter.h index d7c5ba1a..1583e853 100644 --- a/dbcon/execplan/simplefilter.h +++ b/dbcon/execplan/simplefilter.h @@ -37,6 +37,7 @@ */ namespace execplan { class AggregateColumn; + class WindowFunctionColumn; /** * @brief A class to represent a simple WHERE clause predicate @@ -198,6 +199,8 @@ class SimpleFilter : public Filter { // get all simple columns involved in this column const std::vector& simpleColumnList() const { return fSimpleColumnList; } + // walk through the simple filter operands to check existence of aggregate + bool hasAggregate(); // get all aggregate columns involved in this column const std::vector& aggColumnList() const { return fAggColumnList; } diff --git a/dbcon/joblist/crossenginestep.cpp b/dbcon/joblist/crossenginestep.cpp index cfe97c4a..cd37b23a 100644 --- a/dbcon/joblist/crossenginestep.cpp +++ b/dbcon/joblist/crossenginestep.cpp @@ -48,6 +48,9 @@ using namespace rowgroup; #include "dataconvert.h" using namespace dataconvert; +#include "querytele.h" +using namespace querytele; + #include "funcexp.h" #include "jobstep.h" @@ -191,6 +194,7 @@ CrossEngineStep::CrossEngineStep( { fExtendedInfo = "CES: "; getMysqldInfo(jobInfo); + fQtc.stepParms().stepType = StepTeleStats::T_CES; } @@ -475,9 +479,16 @@ void CrossEngineStep::execute() { DrizzleMySQL drizzle; int ret = 0; + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; try { + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + ret = drizzle.init(fHost.c_str(), fPort, fUser.c_str(), fPasswd.c_str(), fSchema.c_str()); if (ret != 0) handleMySqlError(drizzle.getError().c_str(), ret); @@ -630,6 +641,11 @@ void CrossEngineStep::execute() ERR_CROSS_ENGINE_CONNECT, fErrorInfo, fSessionId); } + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + fEndOfResult = true; fOutputDL->endOfInput(); diff --git a/dbcon/joblist/expressionstep.cpp b/dbcon/joblist/expressionstep.cpp index f1c0c5c7..6aa6f822 100644 --- a/dbcon/joblist/expressionstep.cpp +++ b/dbcon/joblist/expressionstep.cpp @@ -134,20 +134,7 @@ void ExpressionStep::expressionFilter(const Filter* filter, JobInfo& jobInfo) throw runtime_error(errmsg.str()); } - // populate the oid vectors - SimpleFilter* sf = NULL; - ConstantFilter* cf = NULL; - if ((sf = dynamic_cast(f)) != NULL) - { - addColumn(sf->lhs(), jobInfo); - addColumn(sf->rhs(), jobInfo); - } - else if ((cf = dynamic_cast(f)) != NULL) - { - //addColumn(cf->col().get(), jobInfo); - for (uint32_t i = 0; i < cf->simpleColumnList().size(); i++) - addColumn(cf->simpleColumnList()[i], jobInfo); - } + addFilter(fExpressionFilter, jobInfo); } @@ -164,13 +151,89 @@ void ExpressionStep::expressionFilter(const ParseTree* filter, JobInfo& jobInfo) } fExpressionFilter->copyTree(*filter); + addFilter(fExpressionFilter, jobInfo); +} + + +void ExpressionStep::addSimpleFilter(SimpleFilter* sf, JobInfo& jobInfo) +{ + addColumn(sf->lhs(), jobInfo); + addColumn(sf->rhs(), jobInfo); +} + + +void ExpressionStep::addFilter(ParseTree* filter, JobInfo& jobInfo) +{ + stack filterStack; + while (filter || !filterStack.empty()) + { + if(filter != NULL) + { + filterStack.push(filter); + filter = filter->left(); + } + else if (!filterStack.empty()) + { + filter = filterStack.top(); + filterStack.pop(); + + TreeNode* tn = filter->data(); + filter = filter->right(); + + ReturnedColumn* rc = dynamic_cast(tn); + SimpleFilter *sf = dynamic_cast(tn); + ConstantFilter *cf = dynamic_cast(tn); + Operator* op = dynamic_cast(tn); + if (rc != NULL) + { + addColumn(rc, jobInfo); + } + else if (sf != NULL) + { + addSimpleFilter(sf, jobInfo); + } + else if (cf != NULL) + { + const ConstantFilter::FilterList& fs = cf->filterList(); + for (ConstantFilter::FilterList::const_iterator i = fs.begin(); i != fs.end(); i++) + { + SimpleFilter* f = dynamic_cast(i->get()); + if (f != NULL) + addSimpleFilter(f, jobInfo); + else + throw logic_error("unknow filter type in constant filter."); + } + } + else if (op == NULL) + { + throw logic_error("tree node not handled in Expression step."); + } + } + } + +#if 0 // have to workaround correlation on exp, the following approach does not work // extract simple columns from parse tree vector scv; - fExpressionFilter->walk(getSimpleCols, &scv); + filter->walk(getSimpleCols, &scv); // populate the oid vectors for (vector::iterator it = scv.begin(); it != scv.end(); it++) addColumn(*it, jobInfo); + + // aggregate columns + vector acv; + filter->walk(getAggCols, &acv); + for (vector::iterator it = acv.begin(); it != acv.end(); it++) + addColumn(*it, jobInfo); + + // window function columns + vector wcv; + filter->walk(getWindowFunctionCols, &wcv); + for (vector::iterator it = wcv.begin(); it != wcv.end(); it++) + addColumn(*it, jobInfo); +#endif + + return; } @@ -228,6 +291,10 @@ void ExpressionStep::addColumn(ReturnedColumn* rc, JobInfo& jobInfo) { populateColumnInfo(rc, jobInfo); } + else if (NULL != (dynamic_cast(rc))) + { + populateColumnInfo(rc, jobInfo); + } else { ConstantColumn* cc = dynamic_cast(rc); @@ -252,10 +319,13 @@ void ExpressionStep::populateColumnInfo(ReturnedColumn* rc, JobInfo& jobInfo) SimpleColumn* sc = dynamic_cast(rc); WindowFunctionColumn* wc = NULL; + AggregateColumn* ac = NULL; if (NULL != sc) return populateColumnInfo(sc, jobInfo); else if (NULL != (wc = dynamic_cast(rc))) return populateColumnInfo(wc, jobInfo); + else if (NULL != (ac = dynamic_cast(rc))) + return populateColumnInfo(ac, jobInfo); else // for now only allow simple and windowfunction column, more work to do. throw runtime_error("Error in parsing expression."); } @@ -351,6 +421,28 @@ void ExpressionStep::populateColumnInfo(WindowFunctionColumn* wc, JobInfo& jobIn } +void ExpressionStep::populateColumnInfo(AggregateColumn* ac, JobInfo& jobInfo) +{ + // As of bug3695, make sure varbinary is not used in function expression. + if (ac->resultType().colDataType == CalpontSystemCatalog::VARBINARY && !fVarBinOK) + throw runtime_error("VARBINARY in filter or function is not supported."); + + // This is for aggregate function in IN/EXISTS sub-query. + TupleInfo ti(setExpTupleInfo(ac->resultType(), ac->expressionId(), ac->alias(), jobInfo)); + uint64_t acKey = ti.key; + string alias(""); + string view(""); + string schema(""); + fTableOids.push_back(jobInfo.keyInfo->tupleKeyToTableOid[acKey]); + fAliases.push_back(alias); + fViews.push_back(view); + fSchemas.push_back(schema); + fTableKeys.push_back(jobInfo.keyInfo->colKeyToTblKey[acKey]); + fColumnKeys.push_back(acKey); + fColumns.push_back(ac); +} + + void ExpressionStep::updateInputIndex(map& indexMap, const JobInfo& jobInfo) { if (jobInfo.trace) diff --git a/dbcon/joblist/expressionstep.h b/dbcon/joblist/expressionstep.h index b6479b03..e551d520 100644 --- a/dbcon/joblist/expressionstep.h +++ b/dbcon/joblist/expressionstep.h @@ -35,6 +35,7 @@ namespace execplan // forward reference class ReturnedColumn; class SimpleColumn; +class SimpleFilter; class WindowFunctionColumn; }; @@ -105,9 +106,12 @@ class ExpressionStep : public JobStep protected: virtual void addColumn(execplan::ReturnedColumn* rc, JobInfo& jobInfo); + virtual void addFilter(execplan::ParseTree* filter, JobInfo& jobInfo); + virtual void addSimpleFilter(execplan::SimpleFilter* sf, JobInfo& jobInfo); virtual void populateColumnInfo(execplan::ReturnedColumn* rc, JobInfo& jobInfo); virtual void populateColumnInfo(execplan::SimpleColumn* sc, JobInfo& jobInfo); virtual void populateColumnInfo(execplan::WindowFunctionColumn* wc, JobInfo& jobInfo); + virtual void populateColumnInfo(execplan::AggregateColumn* ac, JobInfo& jobInfo); // expression diff --git a/dbcon/joblist/jlf_common.cpp b/dbcon/joblist/jlf_common.cpp index 81f0a488..011d006c 100644 --- a/dbcon/joblist/jlf_common.cpp +++ b/dbcon/joblist/jlf_common.cpp @@ -287,6 +287,9 @@ UniqId::UniqId(const execplan::SimpleColumn* sc) : fPseudo(0), fSubId(-1) { + const PseudoColumn* pc = dynamic_cast(sc); + uint32_t pseudoType = (pc) ? pc->pseudoType() : execplan::PSEUDO_UNKNOWN; + fPseudo = pseudoType; } diff --git a/dbcon/joblist/jlf_common.h b/dbcon/joblist/jlf_common.h index b729cbf4..6dcf6526 100644 --- a/dbcon/joblist/jlf_common.h +++ b/dbcon/joblist/jlf_common.h @@ -192,7 +192,6 @@ struct JobInfo constantCol(CONST_COL_NONE), hasDistinct(false), hasAggregation(false), - hasImplicitGroupBy(false), limitStart(0), limitCount(-1), joinNum(0), @@ -242,7 +241,6 @@ struct JobInfo // aggregation bool hasDistinct; bool hasAggregation; - bool hasImplicitGroupBy; std::vector groupByColVec; std::vector distinctColVec; std::vector expressionVec; diff --git a/dbcon/joblist/jlf_execplantojoblist.cpp b/dbcon/joblist/jlf_execplantojoblist.cpp index c919221c..a7da458a 100644 --- a/dbcon/joblist/jlf_execplantojoblist.cpp +++ b/dbcon/joblist/jlf_execplantojoblist.cpp @@ -33,7 +33,9 @@ using namespace std; #include +#include #include +#include namespace ba=boost::algorithm; #include "calpontexecutionplan.h" @@ -122,6 +124,9 @@ const Operator opisnotnull("isnotnull"); const Operator opisnull("isnull"); +const JobStepVector doSimpleFilter(SimpleFilter* sf, JobInfo& jobInfo); + + /* This looks like an inefficient way to get NULL values. Much easier ways to do it. */ int64_t valueNullNum(const CalpontSystemCatalog::ColType& ct) @@ -1599,6 +1604,50 @@ const JobStepVector doConstantBooleanFilter(const ParseTree* n, JobInfo& jobInfo } +bool optimizeIdbPatitionSimpleFilter(SimpleFilter* sf, JobStepVector& jsv, JobInfo& jobInfo) +{ + //@bug5848, not equal filter is not optimized. + if (sf->op()->op() != opeq.op()) + return false; + + const FunctionColumn* fc = static_cast(sf->lhs()); + const ConstantColumn* cc = static_cast(sf->rhs()); + if (fc == NULL) + { + cc = static_cast(sf->lhs()); + fc = static_cast(sf->rhs()); + } + + // not a function or not idbparttition + if (fc == NULL || cc == NULL || fc->functionName().compare("idbpartition") != 0) + return false; + + // make sure the cc has 3 tokens + vector cv; + boost::split(cv, cc->constval(), boost::is_any_of(".")); + if (cv.size() != 3) + return false; + + // construct separate filters, then make job steps + JobStepVector v; + SOP sop = sf->op(); + const funcexp::FunctionParm& parms = fc->functionParms(); + + for (uint64_t i = 0; i < 3; i++) + { + // very weird parms order is: db root, physical partition, segment + // logical partition string : physical partition, segment, db root + ReturnedColumn* lhs = dynamic_cast(parms[(i+1)%3]->data()); + ConstantColumn* rhs = new ConstantColumn(cv[i]); + SimpleFilter* f = new SimpleFilter(sop, lhs->clone(), rhs); + v = doSimpleFilter(f, jobInfo); + jsv.insert(jsv.end(), v.begin(), v.end()); + } + + return true; +} + + const JobStepVector doSimpleFilter(SimpleFilter* sf, JobInfo& jobInfo) { JobStepVector jsv; @@ -2045,7 +2094,16 @@ const JobStepVector doSimpleFilter(SimpleFilter* sf, JobInfo& jobInfo) else if (lhsType == ARITHMETICCOLUMN || rhsType == ARITHMETICCOLUMN || lhsType == FUNCTIONCOLUMN || rhsType == FUNCTIONCOLUMN) { - jsv = doExpressionFilter(sf, jobInfo); + const ReturnedColumn* rc = static_cast(lhs); + if (rc && (!rc->joinInfo()) && rhsType == AGGREGATECOLUMN) + throw IDBExcept(ERR_AGG_IN_WHERE); + + // @bug5848, CP elimination for idbPartition(col) + JobStepVector sv; + if (optimizeIdbPatitionSimpleFilter(sf, sv, jobInfo)) + jsv.swap(sv); + else + jsv = doExpressionFilter(sf, jobInfo); } else if (lhsType == SIMPLECOLUMN && (rhsType == AGGREGATECOLUMN || rhsType == ARITHMETICCOLUMN || rhsType == FUNCTIONCOLUMN)) @@ -2600,6 +2658,7 @@ bool tryCombineFilters(JobStepVector& jsv1, JobStepVector& jsv2, int8_t bop) return false; } + const JobStepVector doConstantFilter(const ConstantFilter* cf, JobInfo& jobInfo) { JobStepVector jsv; @@ -2919,6 +2978,112 @@ const JobStepVector doConstantFilter(const ConstantFilter* cf, JobInfo& jobInfo) } +const JobStepVector doFunctionFilter(const ParseTree* n, JobInfo& jobInfo) +{ + FunctionColumn* fc = dynamic_cast(n->data()); + idbassert(fc); + + JobStepVector jsv; + string functionName = ba::to_lower_copy(fc->functionName()); + if (functionName.compare("in") == 0 || functionName.compare(" in ") == 0) + { + const funcexp::FunctionParm& parms = fc->functionParms(); + FunctionColumn* parm0Fc = dynamic_cast(parms[0]->data()); + PseudoColumn* parm0Pc = dynamic_cast(parms[0]->data()); + vector > constParms(3); + uint64_t constParmsCount = 0; + if (parm0Fc && parm0Fc->functionName().compare("idbpartition") == 0) + { + for (uint64_t i = 1; i < parms.size(); i++) + { + ConstantColumn* cc = dynamic_cast(parms[i]->data()); + if (cc) + { + vector cv; + boost::split(cv, cc->constval(), boost::is_any_of(".")); + if (cv.size() == 3) + { + constParms[1].push_back(cv[0]); + constParms[2].push_back(cv[1]); + constParms[0].push_back(cv[2]); + constParmsCount++; + } + } + } + + if (constParmsCount == (parms.size() - 1)) + { + const funcexp::FunctionParm& pcs = parm0Fc->functionParms(); + for (uint64_t i = 0; i < 3; i++) + { + ConstantFilter* cf = new ConstantFilter(); + SOP sop(new LogicOperator("or")); + PseudoColumn* pc = dynamic_cast(pcs[i]->data()); + idbassert(pc); + SSC col(pc->clone()); + cf->op(sop); + cf->col(col); + sop.reset(new PredicateOperator("=")); + for (uint64_t j = 0; j < constParmsCount; j++) + { + SimpleFilter* f = new SimpleFilter(sop, col->clone(), + new ConstantColumn(constParms[i][j])); + cf->pushFilter(f); + } + + JobStepVector sv = doConstantFilter(cf, jobInfo); + delete cf; + + jsv.insert(jsv.end(), sv.begin(), sv.end()); + } + } + + // put the separate filtered resulted together + JobStepVector sv = doExpressionFilter(n, jobInfo); + jsv.insert(jsv.end(), sv.begin(), sv.end()); + } + else if (parm0Pc != NULL) + { + for (uint64_t i = 1; i < parms.size(); i++) + { + ConstantColumn* cc = dynamic_cast(parms[i]->data()); + if (cc) + { + constParms[0].push_back(cc->constval()); + constParmsCount++; + } + } + + if (constParmsCount == (parms.size() - 1)) + { + ConstantFilter* cf = new ConstantFilter(); + SOP sop(new LogicOperator("or")); + SSC col(parm0Pc->clone()); + cf->op(sop); + cf->col(col); + sop.reset(new PredicateOperator("=")); + for (uint64_t j = 0; j < constParmsCount; j++) + { + SimpleFilter* f = new SimpleFilter(sop, col->clone(), + new ConstantColumn(constParms[0][j])); + cf->pushFilter(f); + } + + JobStepVector sv = doConstantFilter(cf, jobInfo); + delete cf; + + jsv.insert(jsv.end(), sv.begin(), sv.end()); + } + } + } + + if (jsv.empty()) + jsv = doExpressionFilter(n, jobInfo); + + return jsv; +} + + void doAND(JobStepVector& jsv, JobInfo& jobInfo) { // idbassert(jobInfo.stack.size() >= 2); @@ -3035,6 +3200,9 @@ JLF_ExecPlanToJobList::walkTree(ParseTree* n, void* obj) jobInfo->stack.push(jsv); break; case FUNCTIONCOLUMN: + jsv = doFunctionFilter(n, *jobInfo); + jobInfo->stack.push(jsv); + break; case ARITHMETICCOLUMN: jsv = doExpressionFilter(n, *jobInfo); jobInfo->stack.push(jsv); diff --git a/dbcon/joblist/jlf_tuplejoblist.cpp b/dbcon/joblist/jlf_tuplejoblist.cpp index 3ea32a01..d57b96b5 100644 --- a/dbcon/joblist/jlf_tuplejoblist.cpp +++ b/dbcon/joblist/jlf_tuplejoblist.cpp @@ -461,7 +461,7 @@ void adjustLastStep(JobStepVector& querySteps, DeliveredTableMap& deliverySteps, if ((jobInfo.limitCount != (uint64_t) -1) || (jobInfo.constantCol == CONST_COL_EXIST) || - (jobInfo.hasDistinct && jobInfo.hasImplicitGroupBy)) + (jobInfo.hasDistinct)) { if (jobInfo.annexStep.get() == NULL) jobInfo.annexStep.reset(new TupleAnnexStep(jobInfo)); @@ -478,7 +478,7 @@ void adjustLastStep(JobStepVector& querySteps, DeliveredTableMap& deliverySteps, if (jobInfo.constantCol == CONST_COL_EXIST) tas->addConstant(new TupleConstantStep(jobInfo)); - if (jobInfo.hasDistinct && jobInfo.hasImplicitGroupBy) + if (jobInfo.hasDistinct) tas->setDistinct(); } @@ -1052,7 +1052,7 @@ bool combineJobStepsByTable(TableInfoMap::iterator& mit, JobInfo& jobInfo) thjs->setLargeSideBPS(tbps); thjs->joinId(-1); // token join is a filter force it done before other joins thjs->setJoinType(INNER); - thjs->tokenJoin(true); + thjs->tokenJoin(mit->first); tbps->incWaitToRunStepCnt(); SJSTEP spthjs(thjs); @@ -1644,7 +1644,7 @@ SP_JoinInfo joinToLargeTable(uint32_t large, TableInfoMap& tableInfoMap, size_t dcf = 0; // for dictionary column filters, 0 if thjs is null. RowGroup largeSideRG = tableInfoMap[large].fRowGroup; - if (thjs && thjs->tokenJoin()) + if (thjs && thjs->tokenJoin() == large) { dcf = thjs->getLargeKeys().size(); largeSideRG = thjs->getLargeRowGroup(); @@ -2224,7 +2224,7 @@ void joinTablesInOrder(uint32_t largest, JobStepVector& joinSteps, TableInfoMap& size_t startPos = 0; // start point to add new smallsides RowGroup largeSideRG = joinInfoMap[large]->fRowGroup; - if (thjs && thjs->tokenJoin()) + if (thjs && thjs->tokenJoin() == large) largeSideRG = thjs->getLargeRowGroup(); // get info to config the TupleHashjoin @@ -2644,6 +2644,12 @@ void joinTablesInOrder(uint32_t largest, JobStepVector& joinSteps, TableInfoMap& if (*i != large) { + //@bug6117, token should be done for small side tables. + SJSTEP smallJs = joinStepMap[*i].first; + TupleHashJoinStep* smallThjs = dynamic_cast(smallJs.get()); + if (smallThjs && smallThjs->tokenJoin()) + smallThjs->tokenJoin(-1); + // Set join priority for smallsides. joinStepMap[*i] = make_pair(spjs, l); diff --git a/dbcon/joblist/joblistfactory.cpp b/dbcon/joblist/joblistfactory.cpp index 2a36a76d..7d65cb3a 100644 --- a/dbcon/joblist/joblistfactory.cpp +++ b/dbcon/joblist/joblistfactory.cpp @@ -575,9 +575,6 @@ void checkGroupByCols(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo) if (dynamic_cast(i->get()) != NULL) continue; - if ((*i)->orderPos() == (uint64_t) -1) - jobInfo.hasImplicitGroupBy = true; - ReturnedColumn *rc = i->get(); SimpleColumn* sc = dynamic_cast(rc); diff --git a/dbcon/joblist/jobstep.cpp b/dbcon/joblist/jobstep.cpp index f91dbe8c..891db9c1 100644 --- a/dbcon/joblist/jobstep.cpp +++ b/dbcon/joblist/jobstep.cpp @@ -82,7 +82,9 @@ JobStep::JobStep(const JobInfo& j) : fErrorInfo(j.errorInfo), fLogger(j.logger), fLocalQuery(j.localQuery), - fQueryUuid(j.uuid) + fQueryUuid(j.uuid), + fProgress(0), + fStartTime(-1) { QueryTeleServerParms tsp; string teleServerHost(Config::makeConfig()->getConfig("QueryTele", "Host")); diff --git a/dbcon/joblist/jobstep.h b/dbcon/joblist/jobstep.h index 8beac6dd..5f4d6705 100644 --- a/dbcon/joblist/jobstep.h +++ b/dbcon/joblist/jobstep.h @@ -233,6 +233,32 @@ class JobStep void onClauseFilter(bool b) { fOnClauseFilter = b; } protected: + + //@bug6088, for telemetry posting + static const int64_t STEP_TELE_INTERVAL = 5000; // now, this is the browser refresh rate + void postStepStartTele(querytele::StepTeleStats& sts) + { + fStartTime = fLastStepTeleTime = sts.start_time = querytele::QueryTeleClient::timeNowms(); + fQtc.postStepTele(sts); + } + void postStepProgressTele(querytele::StepTeleStats& sts) + { + int64_t crntTime = querytele::QueryTeleClient::timeNowms(); + if ((crntTime - fLastStepTeleTime) >= STEP_TELE_INTERVAL) + { + // interval between step telemetry + sts.start_time = fStartTime; + fQtc.postStepTele(sts); + fLastStepTeleTime = crntTime; + } + } + void postStepSummaryTele(querytele::StepTeleStats& sts) + { + sts.start_time = fStartTime; + sts.end_time = fLastStepTeleTime = querytele::QueryTeleClient::timeNowms(); + fQtc.postStepTele(sts); + } + JobStepAssociation fInputJobStepAssociation; JobStepAssociation fOutputJobStepAssociation; @@ -268,6 +294,9 @@ class JobStep boost::uuids::uuid fQueryUuid; boost::uuids::uuid fStepUuid; querytele::QueryTeleClient fQtc; + uint64_t fProgress; + int64_t fStartTime; + int64_t fLastStepTeleTime; private: static boost::mutex fLogMutex; diff --git a/dbcon/joblist/libjoblist.rc b/dbcon/joblist/libjoblist.rc index cc2190de..5a4dc4a5 100644 --- a/dbcon/joblist/libjoblist.rc +++ b/dbcon/joblist/libjoblist.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB Job List API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "libjoblist.dll" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "libjoblist.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/dbcon/joblist/pdictionaryscan.cpp b/dbcon/joblist/pdictionaryscan.cpp index 6c5664bc..17316ac9 100644 --- a/dbcon/joblist/pdictionaryscan.cpp +++ b/dbcon/joblist/pdictionaryscan.cpp @@ -144,6 +144,7 @@ pDictionaryScan::pDictionaryScan( fMsgBytesIn(0), fMsgBytesOut(0), fMsgsToPm(0), + fMsgsExpect(0), fRm(jobInfo.rm), isEquality(false) { @@ -353,7 +354,7 @@ void pDictionaryScan::sendPrimitiveMessages() int extState; dbrm.getLocalHWM(oid, partNum, segNum, hwm, extState); - uint32_t remainingLbids = + uint32_t remainingLbids = fMsgsExpect = ( (hwm > (fbo + it->size - 1)) ? (it->size) : (hwm - fbo + 1) ); uint32_t msgLbidCount = fLogicalBlocksPerScan; @@ -537,11 +538,12 @@ void pDictionaryScan::receivePrimitiveMessages() StepTeleStats sts; sts.query_uuid = fQueryUuid; sts.step_uuid = fStepUuid; - sts.msg_type = StepTeleStats::ST_START; - sts.start_time = QueryTeleClient::timeNowms(); - sts.total_units_of_work = msgsSent; if (fOid >= 3000) - fQtc.postStepTele(sts); + { + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = fMsgsExpect; + postStepStartTele(sts); + } uint16_t error = status(); //...Be careful here. Mutex is locked prior to entering the loop, so @@ -629,11 +631,18 @@ void pDictionaryScan::receivePrimitiveMessages() mutex.lock(); msgsRecvd++; - sts.msg_type = StepTeleStats::ST_PROGRESS; - sts.total_units_of_work = msgsSent; - sts.units_of_work_completed = msgsRecvd; if (fOid >= 3000) - fQtc.postStepTele(sts); + { + uint64_t progress = msgsRecvd * 100 / fMsgsExpect; + if (progress > fProgress) + { + fProgress = progress; + sts.msg_type = StepTeleStats::ST_PROGRESS; + sts.total_units_of_work = fMsgsExpect; + sts.units_of_work_completed = msgsRecvd; + postStepProgressTele(sts); + } + } //...If producer is waiting, and we have gone below our threshold value, //...then we signal the producer to request more data from primproc @@ -758,19 +767,16 @@ void pDictionaryScan::receivePrimitiveMessages() fExtendedInfo += toString() + logStr.str(); formatMiniStats(); } + + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.phy_io = fPhysicalIO; + sts.cache_io = fCacheIO; + sts.msg_rcv_cnt = sts.total_units_of_work = sts.units_of_work_completed = msgsRecvd; + sts.msg_bytes_in = fMsgBytesIn; + sts.msg_bytes_out = fMsgBytesOut; + sts.rows = fRidResults; + postStepSummaryTele(sts); } - sts.query_uuid = fQueryUuid; - sts.step_uuid = fStepUuid; - sts.msg_type = StepTeleStats::ST_SUMMARY; - sts.phy_io = fPhysicalIO; - sts.cache_io = fCacheIO; - sts.msg_rcv_cnt = sts.total_units_of_work = sts.units_of_work_completed = msgsRecvd; - sts.msg_bytes_in = fMsgBytesIn; - sts.msg_bytes_out = fMsgBytesOut; - sts.rows = fRidResults; - sts.end_time = QueryTeleClient::timeNowms(); - if (fOid >= 3000) - fQtc.postStepTele(sts); rgFifo->endOfInput(); } diff --git a/dbcon/joblist/primitivestep.h b/dbcon/joblist/primitivestep.h index 7b025aa8..1a3941be 100644 --- a/dbcon/joblist/primitivestep.h +++ b/dbcon/joblist/primitivestep.h @@ -796,6 +796,7 @@ class pDictionaryScan : public JobStep, public PrimitiveMsg uint64_t fMsgBytesIn; // total byte count for incoming messages uint64_t fMsgBytesOut; // total byte count for outcoming messages uint32_t fMsgsToPm; // total number of messages sent to PMs + uint32_t fMsgsExpect; // total blocks to scan uint32_t uniqueID; ResourceManager& fRm; BPSOutputType fOutType; diff --git a/dbcon/joblist/resourcemanager.cpp b/dbcon/joblist/resourcemanager.cpp index f0787997..ba0a4f00 100644 --- a/dbcon/joblist/resourcemanager.cpp +++ b/dbcon/joblist/resourcemanager.cpp @@ -182,7 +182,7 @@ namespace joblist { // window function string wt = fConfig->getConfig("WindowFunction", "WorkThreads"); - if (nt.empty()) + if (wt.empty()) fWindowFunctionThreads = numCores(); else fWindowFunctionThreads = fConfig->uFromText(wt); diff --git a/dbcon/joblist/subquerystep.cpp b/dbcon/joblist/subquerystep.cpp index 2508c764..dee31c96 100644 --- a/dbcon/joblist/subquerystep.cpp +++ b/dbcon/joblist/subquerystep.cpp @@ -42,6 +42,9 @@ using namespace rowgroup; #include "exceptclasses.h" using namespace logging; +#include "querytele.h" +using namespace querytele; + #include "funcexp.h" #include "jobstep.h" @@ -60,6 +63,7 @@ SubQueryStep::SubQueryStep(const JobInfo& jobInfo) , fRowsReturned(0) { fExtendedInfo = "SQS: "; + fQtc.stepParms().stepType = StepTeleStats::T_SQS; } SubQueryStep::~SubQueryStep() @@ -347,6 +351,9 @@ void SubAdapterStep::execute() fRowGroupOut.initRow(&rowOut); RGData rowFeData; + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; bool usesFE = false; if (fRowGroupFe.getColumnCount() != (uint32_t) -1) { @@ -360,6 +367,10 @@ void SubAdapterStep::execute() bool more = false; try { + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + fSubStep->run(); more = fInputDL->next(fInputIterator, &rgDataIn); @@ -433,6 +444,11 @@ void SubAdapterStep::execute() printCalTrace(); } + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + // Bug 3136, let mini stats to be formatted if traceOn. fOutputDL->endOfInput(); } diff --git a/dbcon/joblist/tuple-bps.cpp b/dbcon/joblist/tuple-bps.cpp index 53435680..74643d28 100644 --- a/dbcon/joblist/tuple-bps.cpp +++ b/dbcon/joblist/tuple-bps.cpp @@ -1868,6 +1868,18 @@ try bool flowControlOn; fDec->read_some(uniqueID, fNumThreads, bsv, &flowControlOn); size = bsv.size(); + + // @bug 4562 + if (traceOn() && fOid>=3000 && dlTimes.FirstReadTime().tv_sec==0) + dlTimes.setFirstReadTime(); + + if (fOid>=3000 && threadID == 0 && sts.msg_type == StepTeleStats::ST_INVALID && size > 0) + { + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = totalMsgs; + postStepStartTele(sts); + } + if ((size > 5 || flowControlOn) && fNumThreads < fMaxNumThreads) startAggregationThread(); @@ -1883,10 +1895,6 @@ try THROTTLEDEBUG << "receiveMultiPrimitiveMessages wakes up sending side .. " << " msgsSent: " << msgsSent << " msgsRecvd = " << msgsRecvd << endl; } - // @bug 4562 - if (fOid>=3000 && traceOn() && dlTimes.FirstReadTime().tv_sec==0) - dlTimes.setFirstReadTime(); - /* If there's an error and the joblist is being aborted, don't sit around forever waiting for responses. */ if (cancelled()) { @@ -2086,29 +2094,8 @@ try } // end of the per-bytestream loop // @bug 4562 - if (fOid>=3000 && dlTimes.FirstInsertTime().tv_sec==0) - { - sts.msg_type = StepTeleStats::ST_START; - sts.start_time = QueryTeleClient::timeNowms(); - sts.total_units_of_work = totalMsgs; - fQtc.postStepTele(sts); - if (traceOn()) - dlTimes.setFirstInsertTime(); - } - else - { - if (msgsSent > msgsRecvd) - { - sts.msg_type = StepTeleStats::ST_PROGRESS; - sts.total_units_of_work = totalMsgs; - sts.units_of_work_completed = msgsRecvd; - if (sts.total_units_of_work > 0) - { - if ((fOid >= 3000) && ((sts.units_of_work_completed*100/sts.total_units_of_work) % 10 == 0)) - fQtc.postStepTele(sts); - } - } - } + if (traceOn() && fOid>=3000) + dlTimes.setFirstInsertTime(); //update casual partition size = cpv.size(); @@ -2121,7 +2108,24 @@ try cpMutex.unlock(); } cpv.clear(); + mutex.lock(); + + if (fOid >= 3000) + { + uint64_t progress = msgsRecvd * 100 / totalMsgs; + bool postProgress = (progress > fProgress); + if (postProgress) + { + fProgress = progress; + + sts.msg_type = StepTeleStats::ST_PROGRESS; + sts.total_units_of_work = totalMsgs; + sts.units_of_work_completed = msgsRecvd; + postStepProgressTele(sts); + } + } + } // done reading }//try @@ -2199,7 +2203,7 @@ catch(...) mutex.unlock(); } - if (fOid>=3000 && traceOn()) { + if (traceOn() && fOid>=3000) { //...Casual partitioning could cause us to do no processing. In that //...case these time stamps did not get set. So we set them here. if (dlTimes.FirstReadTime().tv_sec==0) { @@ -2327,17 +2331,18 @@ catch(...) formatMiniStats(); } - sts.msg_type = StepTeleStats::ST_SUMMARY; - sts.phy_io = fPhysicalIO; - sts.cache_io = fCacheIO; - sts.msg_rcv_cnt = sts.total_units_of_work = sts.units_of_work_completed = msgsRecvd; - sts.cp_blocks_skipped = fNumBlksSkipped; - sts.msg_bytes_in = fMsgBytesIn; - sts.msg_bytes_out = fMsgBytesOut; - sts.rows = ridsReturned; - sts.end_time = QueryTeleClient::timeNowms();; - if (fOid >= 3000) - fQtc.postStepTele(sts); + if (lastThread && fOid >= 3000) + { + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.phy_io = fPhysicalIO; + sts.cache_io = fCacheIO; + sts.msg_rcv_cnt = sts.total_units_of_work = sts.units_of_work_completed = msgsRecvd; + sts.cp_blocks_skipped = fNumBlksSkipped; + sts.msg_bytes_in = fMsgBytesIn; + sts.msg_bytes_out = fMsgBytesOut; + sts.rows = ridsReturned; + postStepSummaryTele(sts); + } if (ffirstStepType == SCAN && bop == BOP_AND && !cancelled()) { @@ -2876,11 +2881,6 @@ void TupleBPS::addCPPredicates(uint32_t OID, const vector &vals, bool i // TODO: store the sorted vectors from the pcolscans/steps as a minor optimization dbrm.getExtents(OID, extents); - if (extents.empty()) { - ostringstream os; - os << "TupleBPS::addCPPredicates(): OID " << OID << " is empty."; - throw runtime_error(os.str()); - } sort(extents.begin(), extents.end(), ExtentSorter()); if (extentsMap.find(OID) != extentsMap.end()) { diff --git a/dbcon/joblist/tupleaggregatestep.cpp b/dbcon/joblist/tupleaggregatestep.cpp index 00459152..77381c47 100644 --- a/dbcon/joblist/tupleaggregatestep.cpp +++ b/dbcon/joblist/tupleaggregatestep.cpp @@ -53,6 +53,9 @@ using namespace execplan; #include "rowaggregation.h" using namespace rowgroup; +#include "querytele.h" +using namespace querytele; + #include "jlf_common.h" #include "jobstep.h" #include "primitivestep.h" @@ -200,6 +203,7 @@ TupleAggregateStep::TupleAggregateStep( memset(fMemUsage.get(), 0, fNumOfThreads * sizeof(uint64_t)); fExtendedInfo = "TAS: "; + fQtc.stepParms().stepType = StepTeleStats::T_TAS; } @@ -382,7 +386,7 @@ void TupleAggregateStep::doThreadedSecondPhaseAggregate(uint32_t threadID) } catch(...) { - catchHandler("TupleAggregateStep::aggregateRowGroups() caught an unknown exception", + catchHandler("doThreadedSecondPhaseAggregate() caught an unknown exception", tupleAggregateStepErr, fErrorInfo, fSessionId); caughtException = true; } @@ -464,6 +468,14 @@ uint32_t TupleAggregateStep::nextBand_singleThread(messageqcpp::ByteStream &bs) if (fEndOfResult) { + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + // send an empty / error band RGData rgData(fRowGroupOut, 0); fRowGroupOut.setData(&rgData); @@ -935,6 +947,10 @@ void TupleAggregateStep::prep1PhaseAggregate( // for distinct column for (uint64_t i = 0; i < jobInfo.distinctColVec.size(); i++) { + //@bug6126, continue if already in group by + if (groupbyMap.find(jobInfo.distinctColVec[i]) != groupbyMap.end()) + continue; + int64_t colProj = projColPosMap[jobInfo.distinctColVec[i]]; SP_ROWAGG_GRPBY_t groupby(new RowAggGroupByCol(colProj, -1)); groupBy.push_back(groupby); @@ -1425,6 +1441,10 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate( throw logic_error(emsg.str()); } + // check for dup distinct column -- @bug6126 + if (find(keysAgg.begin(), keysAgg.end(), key) != keysAgg.end()) + continue; + uint64_t colProj = projColPosMap[key]; SP_ROWAGG_GRPBY_t groupby(new RowAggGroupByCol(colProj, colAgg)); @@ -2428,6 +2448,10 @@ void TupleAggregateStep::prep2PhasesAggregate( uint64_t colProj = projColPosMap[key]; + // check for dup distinct column -- @bug6126 + if (find(keysAggPm.begin(), keysAggPm.end(), key) != keysAggPm.end()) + continue; + SP_ROWAGG_GRPBY_t groupby(new RowAggGroupByCol(colProj, colAggPm)); groupByPm.push_back(groupby); @@ -3072,7 +3096,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate( throw logic_error(emsg.str()); } - // check for dup distinct column + // check for dup distinct column -- @bug6126 if (find(keysAggPm.begin(), keysAggPm.end(), key) != keysAggPm.end()) continue; @@ -3783,6 +3807,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate( groupBySub.push_back(groupby); k++; } + // add the distinct column as groupby SP_ROWAGG_GRPBY_t groupby(new RowAggGroupByCol(j, k)); groupBySub.push_back(groupby); @@ -4021,6 +4046,13 @@ void TupleAggregateStep::aggregateRowGroups() more = dlIn->next(fInputIter, &rgData); if (traceOn()) dlTimes.setFirstReadTime(); + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + try { // this check covers the no row case @@ -4129,7 +4161,18 @@ void TupleAggregateStep::threadedAggregateRowGroups(uint32_t threadID) more = dlIn->next(fInputIter, &rgData); if (firstRead) { - if (traceOn() && threadID == 0) dlTimes.setFirstReadTime(); + if (threadID == 0) + { + if (traceOn()) + dlTimes.setFirstReadTime(); + + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + } multiDist = dynamic_cast(fAggregator.get()); if (multiDist) @@ -4326,7 +4369,7 @@ void TupleAggregateStep::threadedAggregateRowGroups(uint32_t threadID) } catch(...) { - catchHandler("TupleAggregateStep::aggregateRowGroups() caught an unknown exception", + catchHandler("threadedAggregateRowGroups() caught an unknown exception", tupleAggregateStepErr, fErrorInfo, fSessionId); caughtException = true; } @@ -4405,6 +4448,14 @@ void TupleAggregateStep::doAggregate_singleThread() if (traceOn()) printCalTrace(); + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + // Bug 3136, let mini stats to be formatted if traceOn. fEndOfResult = true; dlp->endOfInput(); @@ -4613,6 +4664,14 @@ uint64_t TupleAggregateStep::doThreadedAggregate(ByteStream& bs, RowGroupDL* dlp if (fEndOfResult) { + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + if (dlp) { dlp->endOfInput(); diff --git a/dbcon/joblist/tupleannexstep.cpp b/dbcon/joblist/tupleannexstep.cpp index d3775077..ea889a14 100644 --- a/dbcon/joblist/tupleannexstep.cpp +++ b/dbcon/joblist/tupleannexstep.cpp @@ -53,6 +53,9 @@ using namespace rowgroup; #include "stlpoolallocator.h" using namespace utils; +#include "querytele.h" +using namespace querytele; + #include "funcexp.h" #include "jobstep.h" #include "jlf_common.h" @@ -115,7 +118,8 @@ TupleAnnexStep::TupleAnnexStep(const JobInfo& jobInfo) : fFeInstance(funcexp::FuncExp::instance()), fJobList(jobInfo.jobListPtr) { - fExtendedInfo = "TXS: "; + fExtendedInfo = "TNS: "; + fQtc.stepParms().stepType = StepTeleStats::T_TNS; } @@ -223,9 +227,6 @@ uint32_t TupleAnnexStep::nextBand(messageqcpp::ByteStream &bs) bs.restart(); more = fOutputDL->next(fOutputIterator, &rgDataOut); - if (traceOn() && dlTimes.FirstReadTime().tv_sec ==0) - dlTimes.setFirstReadTime(); - if (more && !cancelled()) { fRowGroupDeliver.setData(&rgDataOut); @@ -263,15 +264,6 @@ uint32_t TupleAnnexStep::nextBand(messageqcpp::ByteStream &bs) fRowGroupDeliver.resetRowGroup(0); fRowGroupDeliver.setStatus(status()); fRowGroupDeliver.serializeRGData(bs); - - if (traceOn()) - { - dlTimes.setLastReadTime(); - dlTimes.setEndOfInputTime(); - } - - if (traceOn()) - printCalTrace(); } return rowCount; @@ -286,6 +278,24 @@ void TupleAnnexStep::execute() executeNoOrderByWithDistinct(); else executeNoOrderBy(); + + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + + if (traceOn()) + { + if (dlTimes.FirstReadTime().tv_sec ==0) + dlTimes.setFirstReadTime(); + + dlTimes.setLastReadTime(); + dlTimes.setEndOfInputTime(); + printCalTrace(); + } } @@ -300,6 +310,13 @@ void TupleAnnexStep::executeNoOrderBy() more = fInputDL->next(fInputIterator, &rgDataIn); if (traceOn()) dlTimes.setFirstReadTime(); + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + while (more && !cancelled() && !fLimitHit) { fRowGroupIn.setData(&rgDataIn); @@ -360,13 +377,6 @@ void TupleAnnexStep::executeNoOrderBy() while (more) more = fInputDL->next(fInputIterator, &rgDataIn); - if (traceOn()) - { - dlTimes.setLastReadTime(); - dlTimes.setEndOfInputTime(); - printCalTrace(); - } - // Bug 3136, let mini stats to be formatted if traceOn. fOutputDL->endOfInput(); } @@ -393,6 +403,13 @@ void TupleAnnexStep::executeNoOrderByWithDistinct() more = fInputDL->next(fInputIterator, &rgDataIn); if (traceOn()) dlTimes.setFirstReadTime(); + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + while (more && !cancelled() && !fLimitHit) { fRowGroupIn.setData(&rgDataIn); @@ -456,13 +473,6 @@ void TupleAnnexStep::executeNoOrderByWithDistinct() while (more) more = fInputDL->next(fInputIterator, &rgDataIn); - if (traceOn() && !fDelivery) - { - dlTimes.setLastReadTime(); - dlTimes.setEndOfInputTime(); - printCalTrace(); - } - // Bug 3136, let mini stats to be formatted if traceOn. fOutputDL->endOfInput(); } @@ -479,6 +489,13 @@ void TupleAnnexStep::executeWithOrderBy() more = fInputDL->next(fInputIterator, &rgDataIn); if (traceOn()) dlTimes.setFirstReadTime(); + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + while (more && !cancelled()) { fRowGroupIn.setData(&rgDataIn); @@ -550,13 +567,6 @@ void TupleAnnexStep::executeWithOrderBy() while (more) more = fInputDL->next(fInputIterator, &rgDataIn); - if (traceOn() && !fDelivery) - { - dlTimes.setLastReadTime(); - dlTimes.setEndOfInputTime(); - printCalTrace(); - } - // Bug 3136, let mini stats to be formatted if traceOn. fOutputDL->endOfInput(); } diff --git a/dbcon/joblist/tupleconstantstep.cpp b/dbcon/joblist/tupleconstantstep.cpp index 60a652b0..6310348c 100644 --- a/dbcon/joblist/tupleconstantstep.cpp +++ b/dbcon/joblist/tupleconstantstep.cpp @@ -46,6 +46,9 @@ using namespace execplan; #include "rowgroup.h" using namespace rowgroup; +#include "querytele.h" +using namespace querytele; + #include "jlf_common.h" #include "tupleconstantstep.h" @@ -81,6 +84,7 @@ TupleConstantStep::TupleConstantStep(const JobInfo& jobInfo) : fEndOfResult(false) { fExtendedInfo = "TCS: "; + fQtc.stepParms().stepType = StepTeleStats::T_TCS; } @@ -374,12 +378,19 @@ void TupleConstantStep::execute() RGData rgDataIn; RGData rgDataOut; bool more = false; + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; try { more = fInputDL->next(fInputIterator, &rgDataIn); if (traceOn()) dlTimes.setFirstReadTime(); + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + if (!more && cancelled()) { fEndOfResult = true; @@ -418,6 +429,11 @@ void TupleConstantStep::execute() while (more) more = fInputDL->next(fInputIterator, &rgDataIn); + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + // Bug 3136, let mini stats to be formatted if traceOn. if (traceOn()) { @@ -730,7 +746,7 @@ uint32_t TupleConstantOnlyStep::nextBand(messageqcpp::ByteStream &bs) void TupleConstantOnlyStep::fillInConstants() { fRowGroupOut.getRow(0, &fRowOut); - idbassert(fRowConst.getSize() == fRowOut.getSize()); + idbassert(fRowConst.getColumnCount() == fRowOut.getColumnCount()); copyRow(fRowConst, &fRowOut); fRowGroupOut.resetRowGroup(0); fRowGroupOut.setRowCount(1); diff --git a/dbcon/joblist/tuplehashjoin.cpp b/dbcon/joblist/tuplehashjoin.cpp index 580d49d9..d45c8dd9 100644 --- a/dbcon/joblist/tuplehashjoin.cpp +++ b/dbcon/joblist/tuplehashjoin.cpp @@ -80,7 +80,7 @@ TupleHashJoinStep::TupleHashJoinStep(const JobInfo& jobInfo) : joinIsTooBig(false), isExeMgr(jobInfo.isExeMgr), lastSmallOuterJoiner(-1), - fTokenJoin(false), + fTokenJoin(-1), fStatsMutexPtr(new boost::mutex()) { /* Need to figure out how much memory these use... @@ -326,12 +326,15 @@ void TupleHashJoinStep::hjRunner() } StepTeleStats sts; - sts.query_uuid = fQueryUuid; - sts.step_uuid = fStepUuid; - sts.msg_type = StepTeleStats::ST_START; - sts.start_time = QueryTeleClient::timeNowms(); if (fTableOID1 >= 3000) - fQtc.postStepTele(sts); + { + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_START; + sts.start_time = QueryTeleClient::timeNowms(); + sts.total_units_of_work = 1; + postStepStartTele(sts); + } idbassert(joinTypes.size() == smallDLs.size()); idbassert(joinTypes.size() == joiners.size()); @@ -472,11 +475,13 @@ void TupleHashJoinStep::hjRunner() else startJoinThreads(); - sts.msg_type = StepTeleStats::ST_SUMMARY; - sts.end_time = QueryTeleClient::timeNowms(); if (fTableOID1 >= 3000) - fQtc.postStepTele(sts); - + { + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.end_time = QueryTeleClient::timeNowms(); + sts.total_units_of_work = sts.units_of_work_completed = 1; + postStepSummaryTele(sts); + } } uint32_t TupleHashJoinStep::nextBand(messageqcpp::ByteStream &bs) diff --git a/dbcon/joblist/tuplehashjoin.h b/dbcon/joblist/tuplehashjoin.h index 9df0f939..16e3d917 100644 --- a/dbcon/joblist/tuplehashjoin.h +++ b/dbcon/joblist/tuplehashjoin.h @@ -181,8 +181,8 @@ class TupleHashJoinStep : public JobStep, public TupleDeliveryStep virtual bool stringTableFriendly() { return true; } - bool tokenJoin() const { return fTokenJoin; } - void tokenJoin(bool b) { fTokenJoin = b; } + uint32_t tokenJoin() const { return fTokenJoin; } + void tokenJoin(uint32_t k) { fTokenJoin = k; } private: TupleHashJoinStep(); @@ -351,8 +351,8 @@ class TupleHashJoinStep : public JobStep, public TupleDeliveryStep bool isExeMgr; uint32_t lastSmallOuterJoiner; - //@bug5958, for identify token join - bool fTokenJoin; + //@bug5958 & 6117, stores the table key for identify token join + uint32_t fTokenJoin; // moved from base class JobStep boost::mutex* fStatsMutexPtr; diff --git a/dbcon/joblist/tuplehavingstep.cpp b/dbcon/joblist/tuplehavingstep.cpp index 7f3d1db8..d7196ef8 100644 --- a/dbcon/joblist/tuplehavingstep.cpp +++ b/dbcon/joblist/tuplehavingstep.cpp @@ -46,6 +46,9 @@ using namespace execplan; #include "rowgroup.h" using namespace rowgroup; +#include "querytele.h" +using namespace querytele; + #include "funcexp.h" #include "jlf_common.h" @@ -64,7 +67,8 @@ TupleHavingStep::TupleHavingStep(const JobInfo& jobInfo) : fEndOfResult(false), fFeInstance(funcexp::FuncExp::instance()) { - fExtendedInfo = "THS: "; + fExtendedInfo = "HVS: "; + fQtc.stepParms().stepType = StepTeleStats::T_HVS; } @@ -253,12 +257,19 @@ void TupleHavingStep::execute() RGData rgDataIn; RGData rgDataOut; bool more = false; + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; try { more = fInputDL->next(fInputIterator, &rgDataIn); dlTimes.setFirstReadTime(); + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + if (!more && cancelled()) { fEndOfResult = true; @@ -299,6 +310,11 @@ void TupleHavingStep::execute() fEndOfResult = true; fOutputDL->endOfInput(); + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + dlTimes.setLastReadTime(); dlTimes.setEndOfInputTime(); diff --git a/dbcon/joblist/tupleunion.cpp b/dbcon/joblist/tupleunion.cpp index 0e869689..3c4f63ab 100644 --- a/dbcon/joblist/tupleunion.cpp +++ b/dbcon/joblist/tupleunion.cpp @@ -25,6 +25,9 @@ #include #include +#include "querytele.h" +using namespace querytele; + #include "dataconvert.h" #include "hasher.h" #include "jlf_common.h" @@ -93,7 +96,8 @@ TupleUnion::TupleUnion(CalpontSystemCatalog::OID tableOID, const JobInfo& jobInf joinRan(false) { uniquer.reset(new Uniquer_t(10, Hasher(this), Eq(this), allocator)); - fExtendedInfo = "TUS: "; + fExtendedInfo = "TUN: "; + fQtc.stepParms().stepType = StepTeleStats::T_TUN; } TupleUnion::~TupleUnion() @@ -142,8 +146,10 @@ void TupleUnion::readInput(uint32_t which) Row inRow, outRow, tmpRow; bool distinct; uint64_t memUsageBefore, memUsageAfter, memDiff; + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; - l_outputRG = outputRG; dl = inputs[which]; l_inputRG = inputRGs[which]; @@ -171,9 +177,16 @@ void TupleUnion::readInput(uint32_t which) it = dl->getIterator(); more = dl->next(it, &inRGData); - if (traceOn() && dlTimes.FirstReadTime().tv_sec==0) + if (dlTimes.FirstReadTime().tv_sec==0) dlTimes.setFirstReadTime(); + if (fStartTime == -1) + { + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + } + while (more && !cancelled()) { /* normalize each row @@ -264,6 +277,11 @@ void TupleUnion::readInput(uint32_t which) { output->endOfInput(); + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + if (traceOn()) { dlTimes.setLastReadTime(); diff --git a/dbcon/joblist/windowfunctionstep.cpp b/dbcon/joblist/windowfunctionstep.cpp index 284956fe..c8a8b44c 100644 --- a/dbcon/joblist/windowfunctionstep.cpp +++ b/dbcon/joblist/windowfunctionstep.cpp @@ -70,6 +70,9 @@ using namespace ordering; #include "funcexp.h" using namespace funcexp; +#include "querytele.h" +using namespace querytele; + #include "jlf_common.h" #include "jobstep.h" #include "windowfunctionstep.h" @@ -142,6 +145,7 @@ WindowFunctionStep::WindowFunctionStep(const JobInfo& jobInfo) : fRowsReturned(0), fEndOfResult(false), fIsSelect(true), + fUseSSMutex(false), fInputDL(NULL), fOutputDL(NULL), fInputIterator(-1), @@ -154,6 +158,7 @@ WindowFunctionStep::WindowFunctionStep(const JobInfo& jobInfo) : { fTotalThreads = fRm.windowFunctionThreads(); fExtendedInfo = "WFS: "; + fQtc.stepParms().stepType = StepTeleStats::T_WFS; } @@ -253,9 +258,6 @@ uint32_t WindowFunctionStep::nextBand(messageqcpp::ByteStream &bs) fRowGroupDelivered.resetRowGroup(0); fRowGroupDelivered.setStatus(status()); fRowGroupDelivered.serializeRGData(bs); - - if (traceOn()) - printCalTrace(); } return rowCount; @@ -503,7 +505,6 @@ SJSTEP WindowFunctionStep::makeWindowFunctionStep(SJSTEP& step, JobInfo& jobInfo void WindowFunctionStep::initialize(const RowGroup& rg, JobInfo& jobInfo) { - if (jobInfo.trace) cout << "Input to WindowFunctionStep: " << rg.toString() << endl; // query type decides the output by dbroot or partition @@ -527,12 +528,26 @@ void WindowFunctionStep::initialize(const RowGroup& rg, JobInfo& jobInfo) for (uint64_t i = 0; i < colCntIn; i++) colIndexMap.insert(make_pair(keys[i], i)); + // @bug6065, window functions that will update string table + int64_t wfsUpdateStringTable = 0; for (RetColsVector::iterator i=jobInfo.windowCols.begin(); i(i->get()); + uint64_t ridx = getColumnIndex(*i, colIndexMap, jobInfo); // result index + // @bug6065, window functions that will update string table + { + CalpontSystemCatalog::ColType rt = wc->resultType(); + if ((types[ridx] == CalpontSystemCatalog::CHAR || + types[ridx] == CalpontSystemCatalog::VARCHAR) && + rg.getColumnWidth(ridx) >= jobInfo.stringTableThreshold) + { + wfsUpdateStringTable++; + } + } + vector fields; - fields.push_back(getColumnIndex(*i, colIndexMap, jobInfo)); // result + fields.push_back(ridx); // result const RetColsVector& parms = wc->functionParms(); for (uint64_t i = 0; i < parms.size(); i++) // arguments { @@ -732,6 +747,9 @@ void WindowFunctionStep::initialize(const RowGroup& rg, JobInfo& jobInfo) if (jobInfo.trace) cout << "delivered RG: " << fRowGroupDelivered.toString() << endl << endl; + if (wfsUpdateStringTable > 1) + fUseSSMutex = true; + fRowGroupOut = fRowGroupDelivered; } @@ -746,6 +764,13 @@ void WindowFunctionStep::execute() if (traceOn()) dlTimes.setFirstReadTime(); + StepTeleStats sts; + sts.query_uuid = fQueryUuid; + sts.step_uuid = fStepUuid; + sts.msg_type = StepTeleStats::ST_START; + sts.total_units_of_work = 1; + postStepStartTele(sts); + try { while (more && !cancelled()) @@ -770,6 +795,12 @@ void WindowFunctionStep::execute() row.nextRow(); } + //@bug6065, make StringStore::storeString() thread safe, default to false. + rgData.useStoreStringMutex(fUseSSMutex); + + // window function does not change row count + fRowsReturned += rowCnt; + i++; } more = fInputDL->next(fInputIterator, &rgData); @@ -798,6 +829,11 @@ void WindowFunctionStep::execute() fOutputDL->endOfInput(); + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + if (traceOn()) { dlTimes.setEndOfInputTime(); @@ -849,6 +885,11 @@ void WindowFunctionStep::execute() fOutputDL->endOfInput(); + sts.msg_type = StepTeleStats::ST_SUMMARY; + sts.total_units_of_work = sts.units_of_work_completed = 1; + sts.rows = fRowsReturned; + postStepSummaryTele(sts); + if (traceOn()) { dlTimes.setEndOfInputTime(); diff --git a/dbcon/joblist/windowfunctionstep.h b/dbcon/joblist/windowfunctionstep.h index 01005b54..75a85014 100644 --- a/dbcon/joblist/windowfunctionstep.h +++ b/dbcon/joblist/windowfunctionstep.h @@ -159,6 +159,7 @@ class WindowFunctionStep : public JobStep, public TupleDeliveryStep uint64_t fRowsReturned; bool fEndOfResult; bool fIsSelect; + bool fUseSSMutex; //@bug6065, mutex for setStringField // for input/output datalist RowGroupDL* fInputDL; diff --git a/dbcon/mysql/ha_calpont_ddl.cpp b/dbcon/mysql/ha_calpont_ddl.cpp index 8baf1fe0..5149729c 100644 --- a/dbcon/mysql/ha_calpont_ddl.cpp +++ b/dbcon/mysql/ha_calpont_ddl.cpp @@ -625,6 +625,8 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl cal_connection_info* ci = reinterpret_cast(thd->infinidb_vtable.cal_conn_info); if(parser.Good()) { + boost::shared_ptr csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID); + csc->identity(execplan::CalpontSystemCatalog::FE); const ddlpackage::ParseTree &ptree = parser.GetParseTree(); SqlStatement &stmt = *ptree.fList[0]; bool isVarbinaryAllowed = false; @@ -1649,8 +1651,6 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl if (autoIncre) { //Check if the table already has autoincrement column - boost::shared_ptr csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID); - csc->identity(execplan::CalpontSystemCatalog::FE); CalpontSystemCatalog::TableName tableName; tableName.schema = alterTable->fTableName->fSchema; tableName.table = alterTable->fTableName->fName; diff --git a/dbcon/mysql/ha_calpont_dml.cpp b/dbcon/mysql/ha_calpont_dml.cpp index 89b37418..5949a55d 100644 --- a/dbcon/mysql/ha_calpont_dml.cpp +++ b/dbcon/mysql/ha_calpont_dml.cpp @@ -230,6 +230,7 @@ int ProcessCommandStatement(THD *thd, string& dmlStatement, cal_connection_info& int rc = 0; ulong sessionID = tid2sid(thd->thread_id); + CalpontDMLPackage* pDMLPackage; //@Bug 2721 and 2722. Log the statement before issuing commit/rollback if ( dmlStatement == "LOGGING" ) @@ -264,8 +265,6 @@ int ProcessCommandStatement(THD *thd, string& dmlStatement, cal_connection_info& pDMLPackage->write(bytestream); delete pDMLPackage; - idbassert( ci.dmlProc ); - ByteStream::byte b = 0; string errormsg; ByteStream::octbyte rows; @@ -311,7 +310,8 @@ int ProcessCommandStatement(THD *thd, string& dmlStatement, cal_connection_info& thd->killed = THD::KILL_QUERY; thd->main_da.set_error_status(thd, HA_ERR_INTERNAL_ERROR, errormsg.c_str()); } - + delete ci.dmlProc; + ci.dmlProc = NULL; return rc; } @@ -395,7 +395,6 @@ int doProcessInsertValues ( TABLE* table, uint32_t size, cal_connection_info& ci pDMLPackage->write(bytestream); delete pDMLPackage; - idbassert( ci.dmlProc ); ByteStream::byte b = 0; string errormsg; @@ -531,6 +530,9 @@ int ha_calpont_impl_write_last_batch(TABLE* table, cal_connection_info& ci, bool command = "COMMIT"; std::string schema; schema = table->s->db.str; + //@Bug 6112. if no row to be insert and no rows have been inserted, no need to send to DMLProc + if ((size == 0) && (ci.rowsHaveInserted == 0)) + return rc; //@Bug 2715 Check the saved error code. //@Bug 4516 always send the last package to allow DMLProc receive all messages from WES if (( ci.rc != 0 ) || abort ) @@ -696,7 +698,6 @@ int ha_calpont_impl_write_row_(uchar *buf, TABLE* table, cal_connection_info& ci pDMLPackage->write(bytestream); delete pDMLPackage; - idbassert( ci.dmlProc ); ByteStream::byte b = 0; ByteStream::octbyte rows; std::string errorMsg; @@ -818,8 +819,6 @@ int ha_calpont_impl_write_row_(uchar *buf, TABLE* table, cal_connection_info& ci pDMLPackage->write(bytestream); delete pDMLPackage; - idbassert( ci.dmlProc ); - ByteStream::byte b = 0; ByteStream::octbyte rows; std::string errorMsg; diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index f7b919f2..c523c9d0 100644 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -88,6 +88,7 @@ using namespace funcexp; const uint64_t AGG_BIT = 0x01; const uint64_t SUB_BIT = 0x02; const uint64_t AF_BIT = 0x04; +const uint64_t CORRELATED = 0x08; //#define OUTER_JOIN_DEBUG namespace @@ -380,6 +381,7 @@ void debug_walk(const Item *item, void *arg) cout << "ROW_ITEM: " << endl; for (uint32_t i = 0; i < row->cols(); i++) debug_walk(row->element_index(i), 0); + break; } case Item::WINDOW_FUNC_ITEM: { @@ -1273,9 +1275,11 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp) { // @bug 3167 duplicate column alias is full name SimpleColumn *col = dynamic_cast(cols[j].get()); - if (strcasecmp(ifp->field_name, cols[j]->alias().c_str()) == 0 || - (col && cols[j]->alias().find(".") != string::npos && - strcasecmp(ifp->field_name, col->columnName().c_str()) == 0)) + string alias = cols[j]->alias(); + if (strcasecmp(ifp->field_name, alias.c_str()) == 0 || + (col && alias.find(".") != string::npos && + (strcasecmp(ifp->field_name, col->columnName().c_str()) == 0 || + strcasecmp(ifp->field_name, (alias.substr(alias.find_last_of(".")+1)).c_str()) == 0))) //@bug6066 { // @bug4827. Remove the checking because outside tables could be the same // name as inner tables. This function is to identify column from a table, @@ -1303,6 +1307,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp) sc->tableAlias(lower(tableAlias)); sc->viewName(lower(viewName)); sc->resultType(cols[j]->resultType()); + sc->hasAggregate(cols[j]->hasAggregate()); if (col) sc->isInfiniDB(col->isInfiniDB()); @@ -2872,7 +2877,7 @@ ParseTree* buildParseTree(Item_func* item, gp_walk_info& gwi, bool& nonSupport) return pt; } -AggregateColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi) +ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi) { Item_sum* isp = reinterpret_cast(item); Item** sfitempp = isp->args; @@ -2882,7 +2887,7 @@ AggregateColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi) gwi.aggOnSelect = true; // N.B. arg_count is the # of formal parms to the agg fcn. InifniDB only supports 1 argument - if (isp->arg_count > 1 && isp->sum_func() != Item_sum::GROUP_CONCAT_FUNC) + if (isp->arg_count != 1 && isp->sum_func() != Item_sum::GROUP_CONCAT_FUNC) { gwi.fatalParseError = true; gwi.parseErrorText = IDBErrorInfo::instance()->errorMsg(ERR_MUL_ARG_AGG); @@ -2924,8 +2929,9 @@ AggregateColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi) } ORDER **order_item, **end; - for (order_item= gc->order, end=order_item + gc->order_field();order_item < end; - order_item++) + for (order_item= gc->order, + end=order_item + gc->order_field();order_item < end; + order_item++) { Item *ord_col= *(*order_item)->item; if (ord_col->type() == Item::INT_ITEM) @@ -2986,7 +2992,6 @@ AggregateColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi) if (ac->aggOp() == AggregateColumn::COUNT) ac->aggOp(AggregateColumn::COUNT_ASTERISK); - gwi.count_asterisk_list.push_back(ac); ac->constCol(SRCP(buildReturnedColumn(sfitemp, gwi, gwi.fatalParseError))); break; } @@ -2995,7 +3000,6 @@ AggregateColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi) //ac->aggOp(AggregateColumn::COUNT); parm.reset(new ConstantColumn("", ConstantColumn::NULLDATA)); //ac->functionParms(parm); - gwi.count_asterisk_list.push_back(ac); ac->constCol(SRCP(buildReturnedColumn(sfitemp, gwi, gwi.fatalParseError))); break; } @@ -3027,7 +3031,6 @@ AggregateColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi) if (dynamic_cast(rc)) { //@bug5229. handle constant function on aggregate argument - gwi.count_asterisk_list.push_back(ac); ac->constCol(SRCP(rc)); break; } @@ -3232,6 +3235,20 @@ AggregateColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi) ac->expressionId(gwi.returnedCols[i]->expressionId()); } } + + // @bug5977 @note Temporary fix to avoid mysqld crash. The permanent fix will + // be applied in ExeMgr. When the ExeMgr fix is available, this checking + // will be taken out. + if (ac->constCol() && gwi.tbList.empty() && gwi.derivedTbList.empty()) + { + gwi.fatalParseError = true; + gwi.parseErrorText = "No project column found for aggregate function"; + return NULL; + } + else if (ac->constCol()) + { + gwi.count_asterisk_list.push_back(ac); + } return ac; } @@ -3580,23 +3597,36 @@ void gp_walk(const Item *item, void *arg) //if (gwip->ptWorkStack.size() < icp->argument_list()->elements) { List_iterator_fast li(*(icp->argument_list())); - while (Item *it= li++) - { - if ((it->type() == Item::FIELD_ITEM - || it->type() == Item::INT_ITEM - || it->type() == Item::DECIMAL_ITEM - || it->type() == Item::STRING_ITEM - || it->type() == Item::REAL_ITEM - || it->type() == Item::NULL_ITEM - || (it->type() == Item::FUNC_ITEM - && !isPredicateFunction(it, gwip))) && !gwip->rcWorkStack.empty() - ) - { - gwip->ptWorkStack.push(new ParseTree(gwip->rcWorkStack.top())); - gwip->rcWorkStack.pop(); - } - } - } + while (Item *it= li++) + { + //@bug5865 error out non-supported OR with correlated subquery + if (icp->functype() == Item_func::COND_OR_FUNC) + { + vector fieldVec; + uint16_t parseInfo = 0; + parse_item(it, fieldVec, gwip->fatalParseError, parseInfo); + if (parseInfo & CORRELATED) + { + gwip->fatalParseError = true; + gwip->parseErrorText = IDBErrorInfo::instance()->errorMsg(ERR_CORRELATED_SUB_OR); + return; + } + } + if ((it->type() == Item::FIELD_ITEM + || it->type() == Item::INT_ITEM + || it->type() == Item::DECIMAL_ITEM + || it->type() == Item::STRING_ITEM + || it->type() == Item::REAL_ITEM + || it->type() == Item::NULL_ITEM + || (it->type() == Item::FUNC_ITEM + && !isPredicateFunction(it, gwip))) && !gwip->rcWorkStack.empty() + ) + { + gwip->ptWorkStack.push(new ParseTree(gwip->rcWorkStack.top())); + gwip->rcWorkStack.pop(); + } + } + } // @bug1603. MySQL's filter tree is a multi-tree grouped by operator. So more than // two filters saved on the stack so far might belong to this operator. uint32_t leftInStack = gwip->ptWorkStack.size() - icp->argument_list()->elements + 1; @@ -3640,23 +3670,6 @@ void gp_walk(const Item *item, void *arg) Operator* op = new LogicOperator(icp->func_name()); ParseTree* ptp = new ParseTree(op); - // bug 3459. error out non-supported OR with correlated subquery - if (icp->functype() == Item_func::COND_OR_FUNC) - { - SelectFilter *lsel = dynamic_cast(lhs->data()); - SelectFilter *rsel = dynamic_cast(rhs->data()); - ExistsFilter *lexists = dynamic_cast(lhs->data()); - ExistsFilter *rexists = dynamic_cast(rhs->data()); - - if ((lsel && lsel->correlated()) || (rsel && rsel->correlated()) || - (lexists && lexists->correlated()) || (rexists && rexists->correlated())) - { - gwip->fatalParseError = true; - gwip->parseErrorText = IDBErrorInfo::instance()->errorMsg(ERR_CORRELATED_SUB_OR); - break; - } - } - ptp->left(lhs); ptp->right(rhs); gwip->ptWorkStack.push(ptp); @@ -3859,6 +3872,12 @@ void parse_item (Item *item, vector& field_vec, bool& hasNonSupport case Item::FUNC_ITEM: { Item_func* isp = reinterpret_cast(item); + if (string(isp->func_name()) == "") + { + parseInfo |= SUB_BIT; + parseInfo |= CORRELATED; + break; + } Item** sfitempp = isp->arguments(); for (uint32_t i = 0; i < isp->arg_count; i++) parse_item(sfitempp[i], field_vec, hasNonSupportItem, parseInfo); @@ -3928,8 +3947,13 @@ void parse_item (Item *item, vector& field_vec, bool& hasNonSupport break; } case Item::SUBSELECT_ITEM: + { parseInfo |= SUB_BIT; + Item_subselect* sub = (Item_subselect*)item; + if (sub->is_correlated) + parseInfo |= CORRELATED; break; + } case Item::ROW_ITEM: { Item_row *row = (Item_row*)item; @@ -4445,7 +4469,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i //aggregate column case Item::SUM_FUNC_ITEM: { - AggregateColumn *ac = buildAggregateColumn(item, gwi); + ReturnedColumn *ac = buildAggregateColumn(item, gwi); if (gwi.fatalParseError) { // e.g., non-support ref column @@ -4455,7 +4479,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i } // add this agg col to returnedColumnList - boost::shared_ptr spac(ac); + boost::shared_ptr spac(ac); gwi.returnedCols.push_back(spac); gwi.selectCols.push_back('`' + escapeBackTick(spac->alias().c_str()) + '`'); String str(256); @@ -4502,7 +4526,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i } ReturnedColumn* rc = buildFunctionColumn(ifp, gwi, hasNonSupportItem); - + SRCP srcp(rc); if (rc) { if (!hasNonSupportItem && !nonConstFunc(ifp) && !(parseInfo & AF_BIT) && tmpVec.size() == 0) @@ -4510,7 +4534,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i if (isUnion || unionSel || gwi.subSelectType != CalpontSelectExecutionPlan::MAIN_SELECT || parseInfo & SUB_BIT || select_lex.group_list.elements != 0) { - SRCP srcp(buildReturnedColumn(item, gwi, gwi.fatalParseError)); + srcp.reset(buildReturnedColumn(item, gwi, gwi.fatalParseError)); gwi.returnedCols.push_back(srcp); if (ifp->name) srcp->alias(ifp->name); @@ -4532,7 +4556,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i break; } - SRCP srcp(rc); + //SRCP srcp(rc); gwi.returnedCols.push_back(srcp); if ( ((gwi.thd->lex)->sql_command == SQLCOM_UPDATE ) || ((gwi.thd->lex)->sql_command == SQLCOM_DELETE ) || ((gwi.thd->lex)->sql_command == SQLCOM_UPDATE_MULTI ) || ((gwi.thd->lex)->sql_command == SQLCOM_DELETE_MULTI )) { } @@ -4820,6 +4844,11 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i { coltypes.push_back( dynamic_cast(csep->unionVec()[j].get())->returnedCols()[i]->resultType()); + + // @bug5976. set hasAggregate true for the main column if + // one corresponding union column has aggregate + if (dynamic_cast(csep->unionVec()[j].get())->returnedCols()[i]->hasAggregate()) + gwi.returnedCols[i]->hasAggregate(true); } gwi.returnedCols[i]->resultType(dataconvert::DataConvert::convertUnionColType(coltypes)); } @@ -5962,7 +5991,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i if (gwi.derivedTbList.size() >= 1) { SimpleColumn* sc1 = new SimpleColumn(); - + sc1->columnName(sc->columnName()); sc1->tableName(sc->tableName()); sc1->tableAlias(sc->tableAlias()); sc1->viewName(lower(sc->viewName())); @@ -5971,9 +6000,17 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i } } - for (coliter = gwi.count_asterisk_list.begin(); coliter != gwi.count_asterisk_list.end(); ++coliter) { + // @bug5977 @note should never throw this, but checking just in case. + // When ExeMgr fix is ready, this should not error out... + if (dynamic_cast(minSc.get())) + { + gwi.fatalParseError = true; + gwi.parseErrorText = "No project column found for aggregate function"; + setError(gwi.thd, HA_ERR_INTERNAL_ERROR, gwi.parseErrorText); + return HA_ERR_UNSUPPORTED; + } (*coliter)->functionParms(minSc); } diff --git a/dbcon/mysql/ha_calpont_impl.cpp b/dbcon/mysql/ha_calpont_impl.cpp index 09f314a4..e265d7c1 100644 --- a/dbcon/mysql/ha_calpont_impl.cpp +++ b/dbcon/mysql/ha_calpont_impl.cpp @@ -1131,11 +1131,47 @@ uint32_t doUpdateDelete(THD *thd) updateStmt.fNamePtr = qualifiedTablName; pDMLPackage = CalpontDMLFactory::makeCalpontUpdatePackageFromMysqlBuffer( dmlStatement, updateStmt ); } + else if ((thd->lex)->sql_command == SQLCOM_DELETE_MULTI) //@Bug 6121 error out on multi tables delete. + { + if ( (thd->lex->select_lex.join) != 0) + { + multi_delete* deleteTable = (multi_delete*)((thd->lex->select_lex.join)->result); + first_table= (TABLE_LIST*) deleteTable->get_tables(); + if (deleteTable->num_of_tables == 1) + { + schemaName = first_table->db; + tableName = first_table->table_name; + aliasName = first_table->alias; + qualifiedTablName->fName = tableName; + qualifiedTablName->fSchema = schemaName; + pDMLPackage = CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(dmlStatement); + } + else + { + string emsg("Deleting rows from multiple tables in a single statement is currently not supported."); + thd->main_da.set_error_status(thd, HA_ERR_INTERNAL_ERROR, emsg.c_str()); + ci->rc = 1; + thd->row_count_func = 0; + return 0; + } + } + else + { + first_table= (TABLE_LIST*) thd->lex->select_lex.table_list.first; + schemaName = first_table->table->s->db.str; + tableName = first_table->table->s->table_name.str; + aliasName = first_table->alias; + qualifiedTablName->fName = tableName; + qualifiedTablName->fSchema = schemaName; + pDMLPackage = CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(dmlStatement); + } + } else { first_table= (TABLE_LIST*) thd->lex->select_lex.table_list.first; schemaName = first_table->table->s->db.str; tableName = first_table->table->s->table_name.str; + aliasName = first_table->alias; qualifiedTablName->fName = tableName; qualifiedTablName->fSchema = schemaName; pDMLPackage = CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(dmlStatement); @@ -1157,11 +1193,16 @@ uint32_t doUpdateDelete(THD *thd) pDMLPackage->set_SQLStatement( origStmt ); //Save the item list - List items = (thd->lex->select_lex.item_list); - thd->lex->select_lex.item_list = thd->lex->value_list; - - SELECT_LEX select_lex = lex->select_lex; - + List items; + SELECT_LEX select_lex; + if (( (thd->lex)->sql_command == SQLCOM_UPDATE ) || ( (thd->lex)->sql_command == SQLCOM_UPDATE_MULTI ) ) + { + items = (thd->lex->select_lex.item_list); + thd->lex->select_lex.item_list = thd->lex->value_list; + } + select_lex = lex->select_lex; + + //@Bug 2808 Error out on order by or limit clause //@bug5096. support dml limit. if (/*( select_lex.explicit_limit ) || */( select_lex.order_list.elements != 0 ) ) @@ -1239,7 +1280,7 @@ uint32_t doUpdateDelete(THD *thd) return -1; } - +//cout<< "Plan before is " << endl << *updateCP << endl; //set the large side by putting the updated table at the first CalpontSelectExecutionPlan::TableList tbList = updateCP->tableList(); @@ -1290,6 +1331,47 @@ uint32_t doUpdateDelete(THD *thd) throw runtime_error ("column map is empty!"); if (returnedCols.empty()) returnedCols.push_back((updateCP->columnMap()).begin()->second); + //@Bug 6123. get the correct returned columnlist + if (( (thd->lex)->sql_command == SQLCOM_DELETE ) || ( (thd->lex)->sql_command == SQLCOM_DELETE_MULTI ) ) + { + returnedCols.clear(); + //choose the smallest column to project + CalpontSystemCatalog::TableName deleteTableName; + deleteTableName.schema = schemaName; + deleteTableName.table = tableName; + CalpontSystemCatalog::RIDList colrids; + try { + colrids = csc->columnRIDs(deleteTableName); + } + catch (IDBExcept &ie) { + thd->main_da.set_error_status(thd, HA_ERR_UNSUPPORTED, ie.what()); + ci->rc = -1; + thd->row_count_func = 0; + return 0; + } + int minColWidth = -1; + int minWidthColOffset = 0; + for (unsigned int j = 0; j < colrids.size(); j++) + { + CalpontSystemCatalog::ColType ct = csc->colType(colrids[j].objnum); + if (ct.colDataType == CalpontSystemCatalog::VARBINARY) + continue; + + if (minColWidth == -1 || ct.colWidth < minColWidth) + { + minColWidth = ct.colWidth; + minWidthColOffset= j; + } + } + CalpontSystemCatalog::TableColName tcn = csc->colName(colrids[minWidthColOffset].objnum); + SimpleColumn *sc = new SimpleColumn(tcn.schema, tcn.table, tcn.column, csc->sessionID()); + sc->tableAlias(aliasName); + sc->resultType(csc->colType(colrids[minWidthColOffset].objnum)); + SRCP srcp; + srcp.reset(sc); + returnedCols.push_back(srcp); + //cout << "tablename:alias = " << tcn.table<<":"<returnedCols( returnedCols ); if (( (thd->lex)->sql_command == SQLCOM_UPDATE ) || ( (thd->lex)->sql_command == SQLCOM_UPDATE_MULTI ) ) { @@ -1308,14 +1390,16 @@ uint32_t doUpdateDelete(THD *thd) ptsub->walk(makeUpdateSemiJoin, &tbList[0] ); } //cout<< "Plan is " << endl << *updateCP << endl; - thd->lex->select_lex.item_list = items; + if (( (thd->lex)->sql_command == SQLCOM_UPDATE ) || ( (thd->lex)->sql_command == SQLCOM_UPDATE_MULTI ) ) + thd->lex->select_lex.item_list = items; } //cout<< "Plan is " << endl << *updateCP << endl; } //updateCP->traceFlags(1); - // cout<< "Plan is " << endl << *updateCP << endl; + //cout<< "Plan is " << endl << *updateCP << endl; pDMLPackage->HasFilter(true); + pDMLPackage->uuid(updateCP->uuid()); ByteStream bytestream, bytestream1; bytestream << sessionID; @@ -1377,6 +1461,12 @@ uint32_t doUpdateDelete(THD *thd) ci->dmlProc = new MessageQueueClient("DMLProc"); //cout << "test007: doUpdateDelete use new DMLProc client " << ci->dmlProc << " for session " << sessionID << endl; } + else + { + delete ci->dmlProc; + ci->dmlProc = NULL; + ci->dmlProc = new MessageQueueClient("DMLProc"); + } // Send the request to DMLProc ci->dmlProc->write(bytestream); // Get an answer from DMLProc @@ -1590,6 +1680,8 @@ uint32_t doUpdateDelete(THD *thd) string msg = string("InfiniDB Query Stats - ") + e.what(); push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 9999, msg.c_str()); } + delete ci->dmlProc; + ci->dmlProc = NULL; return 0; } diff --git a/dbcon/mysql/ha_calpont_impl_if.h b/dbcon/mysql/ha_calpont_impl_if.h index 899ac7ac..3bba20b5 100644 --- a/dbcon/mysql/ha_calpont_impl_if.h +++ b/dbcon/mysql/ha_calpont_impl_if.h @@ -265,7 +265,7 @@ execplan::ConstantColumn* buildDecimalColumn(Item *item, gp_walk_info &gwi); execplan::SimpleColumn* buildSimpleColumn(Item_field* item, gp_walk_info& gwi); execplan::FunctionColumn* buildCaseFunction(Item_func* item, gp_walk_info& gwi, bool& nonSupport); execplan::ParseTree* buildParseTree(Item_func* item, gp_walk_info& gwi, bool& nonSupport); -execplan::AggregateColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi); +execplan::ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi); execplan::ReturnedColumn* buildWindowFunctionColumn(Item* item, gp_walk_info& gwi, bool& nonSupport); execplan::ReturnedColumn* buildPseudoColumn(Item* item, gp_walk_info& gwi, bool& nonSupport, uint32_t pseudoType); void addIntervalArgs(Item_func* ifp, funcexp::FunctionParm& functionParms); diff --git a/dbcon/mysql/ha_from_sub.cpp b/dbcon/mysql/ha_from_sub.cpp index f6133346..d6a242e5 100644 --- a/dbcon/mysql/ha_from_sub.cpp +++ b/dbcon/mysql/ha_from_sub.cpp @@ -56,8 +56,12 @@ void derivedTableOptimization(SCSEP& csep) vector unionColVec; // only do vertical optimization for union all - if (plan->distinctUnionNum() == 0 ) + // @bug6134. Also skip the vertical optimization for select distinct + // because all columns need to be projected to check the distinctness. + bool verticalOptimization = false; + if (plan->distinctUnionNum() == 0 && !plan->distinct()) { + verticalOptimization = true; for (uint j = 0; j < plan->unionVec().size(); j++) { unionColVec.push_back( @@ -65,24 +69,27 @@ void derivedTableOptimization(SCSEP& csep) } } - int64_t val = 1; - for (uint i = 0; i < cols.size(); i++) + if (verticalOptimization) { - //if (cols[i]->derivedTable().empty()) - if (cols[i]->refCount() == 0) + int64_t val = 1; + for (uint i = 0; i < cols.size(); i++) { - if (cols[i]->derivedRefCol()) - cols[i]->derivedRefCol()->decRefCount(); - cols[i].reset(new ConstantColumn(val)); - for (uint j = 0; j < unionColVec.size(); j++) - unionColVec[j][i].reset(new ConstantColumn(val)); + //if (cols[i]->derivedTable().empty()) + if (cols[i]->refCount() == 0) + { + if (cols[i]->derivedRefCol()) + cols[i]->derivedRefCol()->decRefCount(); + cols[i].reset(new ConstantColumn(val)); + for (uint j = 0; j < unionColVec.size(); j++) + unionColVec[j][i].reset(new ConstantColumn(val)); + } } - } - // set back - plan->returnedCols(cols); - for (uint j = 0; j < unionColVec.size(); j++) - dynamic_cast(plan->unionVec()[j].get())->returnedCols(unionColVec[j]); + // set back + plan->returnedCols(cols); + for (uint j = 0; j < unionColVec.size(); j++) + dynamic_cast(plan->unionVec()[j].get())->returnedCols(unionColVec[j]); + } } /* diff --git a/dbcon/mysql/ha_window_function.cpp b/dbcon/mysql/ha_window_function.cpp index 0bfe8bc3..9011f1ea 100644 --- a/dbcon/mysql/ha_window_function.cpp +++ b/dbcon/mysql/ha_window_function.cpp @@ -107,6 +107,19 @@ ReturnedColumn* buildBoundExp(WF_Boundary& bound, SRCP& order, gp_walk_info& gwi // date_add rc = new FunctionColumn(); string funcName = "date_add_interval"; + // @bug6061 . YEAR, QUARTER, MONTH, WEEK, DAY type + CalpontSystemCatalog::ColType ct; + if (order->resultType().colDataType == CalpontSystemCatalog::DATE && + intervalCol->intervalType() <= IntervalColumn::INTERVAL_DAY) + { + ct.colDataType = CalpontSystemCatalog::DATE; + ct.colWidth = 4; + } + else + { + ct.colDataType = CalpontSystemCatalog::DATETIME; + ct.colWidth = 8; + } // put interval val column to bound (dynamic_cast(rc))->functionName(funcName); @@ -128,13 +141,9 @@ ReturnedColumn* buildBoundExp(WF_Boundary& bound, SRCP& order, gp_walk_info& gwi funcParms.push_back(sptp); } (dynamic_cast(rc))->functionParms(funcParms); - CalpontSystemCatalog::ColType ct; - ct.colDataType = CalpontSystemCatalog::DATETIME; - ct.colWidth = 8; rc->resultType(ct); - FuncExp* funcexp = FuncExp::instance(); - Func* functor = funcexp->getFunctor(funcName); - (dynamic_cast(rc))->operationType(functor->operationType(funcParms, rc->resultType())); + // @bug6061. Use result type as operation type for WF bound expression + rc->operationType(ct); rc->expressionId(gwi.expressionId++); return rc; } diff --git a/dbcon/mysql/libcalmysql.rc b/dbcon/mysql/libcalmysql.rc index 46887807..b1e7b7d8 100644 --- a/dbcon/mysql/libcalmysql.rc +++ b/dbcon/mysql/libcalmysql.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB MySQL Connector API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "libcalmysql" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "libcalmysql.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/dbcon/mysql/mysql-Calpont b/dbcon/mysql/mysql-Calpont index 2d6663a0..875952b3 100755 --- a/dbcon/mysql/mysql-Calpont +++ b/dbcon/mysql/mysql-Calpont @@ -56,7 +56,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR basedir=$INFINIDB_INSTALL_DIR/mysql datadir=$basedir/db diff --git a/ddlproc/DDLProc.rc b/ddlproc/DDLProc.rc index 914403a8..00dcba40 100644 --- a/ddlproc/DDLProc.rc +++ b/ddlproc/DDLProc.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB DDL Processor" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "DDLProc" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "DDLProc.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/decomsvr/DecomSvr.rc b/decomsvr/DecomSvr.rc index f3956243..65401e17 100644 --- a/decomsvr/DecomSvr.rc +++ b/decomsvr/DecomSvr.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB V1 Decompression Server" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "DecomSvr" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "DecomSvr.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/dmlproc/DMLProc.rc b/dmlproc/DMLProc.rc index 01218f97..4fa08a45 100644 --- a/dmlproc/DMLProc.rc +++ b/dmlproc/DMLProc.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB DML Processor" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "DMLProc" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "DMLProc.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/dmlproc/dmlprocessor.cpp b/dmlproc/dmlprocessor.cpp index f35d899e..597d5863 100644 --- a/dmlproc/dmlprocessor.cpp +++ b/dmlproc/dmlprocessor.cpp @@ -325,6 +325,7 @@ void PackageHandler::run() qts.query_uuid = QueryTeleClient::genUUID(); qts.msg_type = QueryTeleStats::QT_START; qts.start_time = QueryTeleClient::timeNowms(); + qts.session_id = fSessionID; qts.query_type = "INSERT"; qts.query = insertPkg.get_SQLStatement(); qts.system_name = oamCache->getSystemName(); @@ -668,9 +669,10 @@ void PackageHandler::run() updatePkg->read(*(fByteStream.get())); updatePkg->set_TxnID(fTxnid); QueryTeleStats qts; - qts.query_uuid = QueryTeleClient::genUUID(); + qts.query_uuid = updatePkg->uuid(); qts.msg_type = QueryTeleStats::QT_START; qts.start_time = QueryTeleClient::timeNowms(); + qts.session_id = fSessionID; qts.query_type = "UPDATE"; qts.query = updatePkg->get_SQLStatement(); qts.system_name = oamCache->getSystemName(); @@ -707,9 +709,10 @@ void PackageHandler::run() deletePkg->read(*(fByteStream.get())); deletePkg->set_TxnID(fTxnid); QueryTeleStats qts; - qts.query_uuid = QueryTeleClient::genUUID(); + qts.query_uuid = deletePkg->uuid(); qts.msg_type = QueryTeleStats::QT_START; qts.start_time = QueryTeleClient::timeNowms(); + qts.session_id = fSessionID; qts.query_type = "DELETE"; qts.query = deletePkg->get_SQLStatement(); qts.system_name = oamCache->getSystemName(); diff --git a/exemgr/ExeMgr.rc b/exemgr/ExeMgr.rc index bf4f3ecc..be35af0c 100644 --- a/exemgr/ExeMgr.rc +++ b/exemgr/ExeMgr.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB Execution Manager" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "ExeMgr" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "ExeMgr.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/exemgr/main.cpp b/exemgr/main.cpp index 7a4a5cf8..04b8c072 100644 --- a/exemgr/main.cpp +++ b/exemgr/main.cpp @@ -577,18 +577,20 @@ class SessionThread csep.unserialize(bs); QueryTeleStats qts; - qts.query_uuid = csep.uuid(); - qts.msg_type = QueryTeleStats::QT_START; - qts.start_time = QueryTeleClient::timeNowms(); - qts.query = csep.data(); - qts.session_id = csep.sessionID(); - qts.query_type = csep.queryType(); - qts.system_name = fOamCachePtr->getSystemName(); - qts.module_name = fOamCachePtr->getModuleName(); - qts.local_query = csep.localQuery(); - qts.schema_name = csep.schemaName(); - if ((csep.sessionID()&0x80000000) == 0) + if ((csep.sessionID()&0x80000000) == 0 && csep.queryType().compare("SELECT") == 0) + { + qts.query_uuid = csep.uuid(); + qts.msg_type = QueryTeleStats::QT_START; + qts.start_time = QueryTeleClient::timeNowms(); + qts.query = csep.data(); + qts.session_id = csep.sessionID(); + qts.query_type = csep.queryType(); + qts.system_name = fOamCachePtr->getSystemName(); + qts.module_name = fOamCachePtr->getModuleName(); + qts.local_query = csep.localQuery(); + qts.schema_name = csep.schemaName(); fTeleClient.postQueryTele(qts); + } if (gDebug > 1 || (gDebug && (csep.sessionID()&0x80000000)==0)) cout << "### For session id " << csep.sessionID() << ", got a CSEP" << endl; @@ -1052,31 +1054,33 @@ class SessionThread { //QueryTeleStats qts; //qts.query_uuid = csep.uuid(); - qts.msg_type = QueryTeleStats::QT_SUMMARY; - qts.max_mem_pct = fStats.fMaxMemPct; - qts.num_files = fStats.fNumFiles; - qts.phy_io = fStats.fPhyIO; - qts.cache_io = fStats.fCacheIO; - qts.msg_rcv_cnt = fStats.fMsgRcvCnt; - qts.cp_blocks_skipped = fStats.fCPBlocksSkipped; - qts.msg_bytes_in = fStats.fMsgBytesIn; - qts.msg_bytes_out = fStats.fMsgBytesOut; - qts.rows = totalRowCount; - //qts.start_time = - qts.end_time = QueryTeleClient::timeNowms(); - //qts.error_no = - //qts.blocks_changed = - qts.session_id = csep.sessionID(); - qts.query_type = csep.queryType(); - qts.query = csep.data(); - qts.system_name = fOamCachePtr->getSystemName(); - qts.module_name = fOamCachePtr->getModuleName(); - qts.local_query = csep.localQuery(); - //qts.user = - //qts.host = - //qts.priority = - if ((csep.sessionID()&0x80000000) == 0) + if ((csep.sessionID()&0x80000000) == 0 && csep.queryType().compare("SELECT") == 0) + { + qts.msg_type = QueryTeleStats::QT_SUMMARY; + qts.max_mem_pct = fStats.fMaxMemPct; + qts.num_files = fStats.fNumFiles; + qts.phy_io = fStats.fPhyIO; + qts.cache_io = fStats.fCacheIO; + qts.msg_rcv_cnt = fStats.fMsgRcvCnt; + qts.cp_blocks_skipped = fStats.fCPBlocksSkipped; + qts.msg_bytes_in = fStats.fMsgBytesIn; + qts.msg_bytes_out = fStats.fMsgBytesOut; + qts.rows = totalRowCount; + //qts.start_time = + qts.end_time = QueryTeleClient::timeNowms(); + //qts.error_no = + //qts.blocks_changed = + qts.session_id = csep.sessionID(); + qts.query_type = csep.queryType(); + qts.query = csep.data(); + qts.system_name = fOamCachePtr->getSystemName(); + qts.module_name = fOamCachePtr->getModuleName(); + qts.local_query = csep.localQuery(); + //qts.user = + //qts.host = + //qts.priority = fTeleClient.postQueryTele(qts); + } } } diff --git a/oam/install_scripts/binary_installer.sh b/oam/install_scripts/binary_installer.sh index bb08f46b..6aa4fe1a 100644 --- a/oam/install_scripts/binary_installer.sh +++ b/oam/install_scripts/binary_installer.sh @@ -248,6 +248,7 @@ if { $INSTALLTYPE == "initial"} { "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 } "closed" { send_user "ERROR: Connection closed\n" ; exit 1 } "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 } + "No such file" { send_user "ERROR: File Not Found\n" ; exit 1 } } send_user "\n" sleep 10 diff --git a/oam/install_scripts/infinidb b/oam/install_scripts/infinidb index 933e686d..9c63457c 100644 --- a/oam/install_scripts/infinidb +++ b/oam/install_scripts/infinidb @@ -30,7 +30,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR InstallDir=$INFINIDB_INSTALL_DIR diff --git a/oam/install_scripts/infinidb.def b/oam/install_scripts/infinidb.def index e583b374..4ebfb201 100644 --- a/oam/install_scripts/infinidb.def +++ b/oam/install_scripts/infinidb.def @@ -1,8 +1,9 @@ +#!/bin/bash # Copy this file to /etc/default and rename it to 'infinidb'. # Change this line to your InfiniDB installation directory INFINIDB_INSTALL_DIR=/usr/local/Calpont LD_LIBRARY_PATH=$INFINIDB_INSTALL_DIR/lib:$INFINIDB_INSTALL_DIR/mysql/lib/mysql -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR -declare -x LD_LIBRARY_PATH=$LD_LIBRARY_PATH +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH diff --git a/oam/install_scripts/performance_installer.sh b/oam/install_scripts/performance_installer.sh index 7b166eae..556436d3 100644 --- a/oam/install_scripts/performance_installer.sh +++ b/oam/install_scripts/performance_installer.sh @@ -379,6 +379,7 @@ if { $INSTALLTYPE == "initial"} { "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 } "FAILED" { send_user "ERROR: missing OS file\n" ; exit 1 } "closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No such file" { send_user "ERROR: File Not Found\n" ; exit 1 } } send_user "\n" } diff --git a/oam/install_scripts/post-install b/oam/install_scripts/post-install index 9a552747..8f2ecbdd 100755 --- a/oam/install_scripts/post-install +++ b/oam/install_scripts/post-install @@ -174,7 +174,7 @@ elif [ -z "$NO_NONROOT_SUDO" ]; then sudo rm -f /tmp/StopCalpont sed -i -e s@/usr/local/Calpont@$installdir@g $installdir/bin/infinidb.def - sudo $installdir/bin/infinidb.def /etc/default/infinidb + sudo cp $installdir/bin/infinidb.def /etc/default/infinidb fi #check if InfiniDB system logging was setup diff --git a/oam/install_scripts/startupTests.sh b/oam/install_scripts/startupTests.sh index 3875b9df..8f7e3787 100755 --- a/oam/install_scripts/startupTests.sh +++ b/oam/install_scripts/startupTests.sh @@ -13,7 +13,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR test -f $INFINIDB_INSTALL_DIR/post/functions && . $INFINIDB_INSTALL_DIR/post/functions diff --git a/oam/install_scripts/user_installer.sh b/oam/install_scripts/user_installer.sh index 79434ed1..1bcb020f 100644 --- a/oam/install_scripts/user_installer.sh +++ b/oam/install_scripts/user_installer.sh @@ -384,6 +384,7 @@ if { $INSTALLTYPE == "initial"} { "!!!Module" { send_user "DONE" } "FAILED" { send_user "ERROR: missing OS file\n" ; exit 1 } "closed" { send_user "ERROR: Connection closed\n" ; exit 1 } + "No such file" { send_user "ERROR: File Not Found\n" ; exit 1 } } send_user "\n" set timeout 30 diff --git a/oam/oamcpp/liboamcpp.rc b/oam/oamcpp/liboamcpp.rc index ab2f5035..0b5c7611 100644 --- a/oam/oamcpp/liboamcpp.rc +++ b/oam/oamcpp/liboamcpp.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB OAM API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "liboamcpp" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "liboamcpp.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/oam/post/functions b/oam/post/functions index 12fa68a7..ade49f60 100755 --- a/oam/post/functions +++ b/oam/post/functions @@ -10,7 +10,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR PATH=$INFINIDB_INSTALL_DIR/bin:$PATH export PATH diff --git a/oam/post/test-001.sh b/oam/post/test-001.sh index 30d211a2..1ba6f9bd 100755 --- a/oam/post/test-001.sh +++ b/oam/post/test-001.sh @@ -10,7 +10,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR test -f $INFINIDB_INSTALL_DIR/post/functions && . $INFINIDB_INSTALL_DIR/post/functions diff --git a/oam/post/test-002.sh b/oam/post/test-002.sh index ebcbe7e0..00c65a77 100755 --- a/oam/post/test-002.sh +++ b/oam/post/test-002.sh @@ -10,7 +10,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR test -f $INFINIDB_INSTALL_DIR/post/functions && . $INFINIDB_INSTALL_DIR/post/functions diff --git a/oam/post/test-003.sh b/oam/post/test-003.sh index fa16715d..16258b6f 100755 --- a/oam/post/test-003.sh +++ b/oam/post/test-003.sh @@ -10,7 +10,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR test -f $INFINIDB_INSTALL_DIR/post/functions && . $INFINIDB_INSTALL_DIR/post/functions diff --git a/oam/post/test-004.sh b/oam/post/test-004.sh index d3fdba78..0884cb5a 100644 --- a/oam/post/test-004.sh +++ b/oam/post/test-004.sh @@ -14,7 +14,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR test -f $INFINIDB_INSTALL_DIR/post/functions && . $INFINIDB_INSTALL_DIR/post/functions diff --git a/oamapps/calpontSupport/findStranded.sh b/oamapps/calpontSupport/findStranded.sh index 9499cdbb..0f45e326 100755 --- a/oamapps/calpontSupport/findStranded.sh +++ b/oamapps/calpontSupport/findStranded.sh @@ -14,7 +14,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR if [ $INFINIDB_INSTALL_DIR != "/usr/local/Calpont" ]; then export PATH=$INFINIDB_INSTALL_DIR/bin:$INFINIDB_INSTALL_DIR/mysql/bin:/bin:/usr/bin diff --git a/oamapps/calpontSupport/sqlLogs.sh b/oamapps/calpontSupport/sqlLogs.sh index 0a10dc87..fc867dea 100755 --- a/oamapps/calpontSupport/sqlLogs.sh +++ b/oamapps/calpontSupport/sqlLogs.sh @@ -10,7 +10,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR if [ $INFINIDB_INSTALL_DIR != "/usr/local/Calpont" ]; then export PATH=$INFINIDB_INSTALL_DIR/bin:$INFINIDB_INSTALL_DIR/mysql/bin:/bin:/usr/bin diff --git a/oamapps/postConfigure/helpers.cpp b/oamapps/postConfigure/helpers.cpp index 0914ce34..7d26204e 100644 --- a/oamapps/postConfigure/helpers.cpp +++ b/oamapps/postConfigure/helpers.cpp @@ -638,7 +638,7 @@ void checkMysqlPort( std::string& mysqlPort, Config* sysConfig ) while(true) { - string cmd = "netstat -na | grep '" + mysqlPort + "' | grep LISTEN > /tmp/mysqlport"; + string cmd = "netstat -na | grep ':" + mysqlPort + " ' | grep LISTEN > /tmp/mysqlport"; system(cmd.c_str()); string fileName = "/tmp/mysqlport"; @@ -698,8 +698,8 @@ void checkSystemMySQLPort(std::string& mysqlPort, Config* sysConfig, std::string while(true) { - string localnetstat = "netstat -na | grep :" + mysqlPort + " | grep LISTEN > /tmp/mysqlport"; - string remotenetstat = "netstat -na | grep :" + mysqlPort + " | grep LISTEN"; + string localnetstat = "netstat -na | grep ':" + mysqlPort + " ' | grep LISTEN > /tmp/mysqlport"; + string remotenetstat = "netstat -na | grep ':" + mysqlPort + " ' | grep LISTEN"; //first check local mysql, if needed if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) || diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index 3018ec42..1498c375 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -1662,10 +1662,15 @@ int main(int argc, char *argv[]) else { if (cloud != "amazon") { - //get IP Address - string IPAddress = oam.getIPAddress( newModuleHostName); - if ( !IPAddress.empty() ) - newModuleIPAddr = IPAddress; + if ( moduleIPAddr == oam::UnassignedIpAddr ) + { + //get IP Address + string IPAddress = oam.getIPAddress( newModuleHostName); + if ( !IPAddress.empty() ) + newModuleIPAddr = IPAddress; + else + newModuleIPAddr = oam::UnassignedIpAddr; + } else newModuleIPAddr = moduleIPAddr; @@ -3419,7 +3424,7 @@ int main(int argc, char *argv[]) cout << " DONE" << endl; if (hdfs) - cmd = ". " + installDir + "/bin/" + DataFileEnvFile + ";" + installDir + "/bin/dbbuilder 7 > /tmp/dbbuilder.log"; + cmd = "bash -c '. " + installDir + "/bin/" + DataFileEnvFile + ";" + installDir + "/bin/dbbuilder 7 > /tmp/dbbuilder.log'"; else cmd = installDir + "/bin/dbbuilder 7 > /tmp/dbbuilder.log"; @@ -4936,12 +4941,12 @@ bool updateBash() { string cmd = "echo . " + installDir + "/bin/" + DataFileEnvFile + " >> " + fileName; system(cmd.c_str()); - + if ( rootUser) cmd = "su - hdfs -c 'hadoop fs -mkdir -p " + installDir + ";hadoop fs -chown root:root " + installDir + "' >/dev/null 2>&1"; else cmd = "sudo su - hdfs -c 'hadoop fs -mkdir -p " + installDir + ";hadoop fs -chown " + USER + ":" + USER + " " + installDir + "' >/dev/null 2>&1"; - + system(cmd.c_str()); } diff --git a/primitives/primproc/PrimProc.rc b/primitives/primproc/PrimProc.rc index cf96d41b..c8bbaf56 100644 --- a/primitives/primproc/PrimProc.rc +++ b/primitives/primproc/PrimProc.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB Primitive Processor" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "PrimProc" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "PrimProc.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/tools/dbloadxml/colxml.rc b/tools/dbloadxml/colxml.rc index c474da03..773d8289 100644 --- a/tools/dbloadxml/colxml.rc +++ b/tools/dbloadxml/colxml.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB Bulk Load Utility" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "colxml" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "colxml.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/tools/setConfig/configxml.sh b/tools/setConfig/configxml.sh index 55dd5869..8375d58a 100755 --- a/tools/setConfig/configxml.sh +++ b/tools/setConfig/configxml.sh @@ -12,7 +12,7 @@ if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR InstallDir=$INFINIDB_INSTALL_DIR diff --git a/utils/autoconf/configure.ac b/utils/autoconf/configure.ac index a25d7d11..add45d2a 100644 --- a/utils/autoconf/configure.ac +++ b/utils/autoconf/configure.ac @@ -3,7 +3,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(infinidb, 4.5.1, support@infinidb.co) +AC_INIT(infinidb, 4.5.0, support@infinidb.co) ### we don't want the deault CXXFLAGS set by AC_INIT, but we do want to allow the user to set them SAVE_CXXFLAGS= if test -n "$CXXFLAGS"; then diff --git a/utils/configcpp/libconfigcpp.rc b/utils/configcpp/libconfigcpp.rc index 2dd3dca1..34f91200 100644 --- a/utils/configcpp/libconfigcpp.rc +++ b/utils/configcpp/libconfigcpp.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB Config API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "libconfigcpp" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "libconfigcpp.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/utils/configcpp/versionnumber.h b/utils/configcpp/versionnumber.h index 2afe1ccb..fec8bcc1 100644 --- a/utils/configcpp/versionnumber.h +++ b/utils/configcpp/versionnumber.h @@ -2,7 +2,7 @@ #ifndef VERSIONNUMBER_H_ #define VERSIONNUMBER_H_ #include -const std::string idb_version("4.5.1"); -const std::string idb_release("3"); +const std::string idb_version("4.5"); +const std::string idb_release("trunk"); #endif diff --git a/utils/dataconvert/dataconvert.cpp b/utils/dataconvert/dataconvert.cpp index 1cf8a57d..05f92921 100644 --- a/utils/dataconvert/dataconvert.cpp +++ b/utils/dataconvert/dataconvert.cpp @@ -1390,7 +1390,23 @@ int32_t DataConvert::convertColumnDate( return value; } - if ( dataOrgLen < 10) + // @bug 5787: allow for leading blanks + unsigned int dataLen = dataOrgLen; + if ((dataOrgLen > 0) && (dataOrg[0] == ' ')) + { + unsigned nblanks = 0; + for (unsigned nn=0; nn 0) && (dataOrg[0] == ' ')) + { + unsigned nblanks = 0; + for (unsigned nn=0; nn 12) + if (dataLen > 12) { // For backwards compatability we still allow leading blank - if ((!isdigit(dataOrg[11]) && (dataOrg[11] != ' ')) || - !isdigit(dataOrg[12])) + if ((!isdigit(p[11]) && (p[11] != ' ')) || + !isdigit(p[12])) { status = -1; return value; @@ -1501,9 +1531,9 @@ int64_t DataConvert::convertColumnDatetime( inHour = strtol(fld, 0, 10); - if (len > 15) + if (dataLen > 15) { - if (!isdigit(dataOrg[14]) || !isdigit(dataOrg[15])) + if (!isdigit(p[14]) || !isdigit(p[15])) { status = -1; return value; @@ -1514,9 +1544,9 @@ int64_t DataConvert::convertColumnDatetime( inMinute = strtol(fld, 0, 10); - if (len > 18) + if (dataLen > 18) { - if (!isdigit(dataOrg[17]) || !isdigit(dataOrg[18])) + if (!isdigit(p[17]) || !isdigit(p[18])) { status = -1; return value; @@ -1527,9 +1557,9 @@ int64_t DataConvert::convertColumnDatetime( inSecond = strtol(fld, 0, 10); - if (len > 20) + if (dataLen > 20) { - unsigned int microFldLen = len - 20; + unsigned int microFldLen = dataLen - 20; if (microFldLen > (sizeof(fld)-1)) microFldLen = sizeof(fld) - 1; memcpy( fld, p+20, microFldLen); diff --git a/utils/funcexp/func_date_add.cpp b/utils/funcexp/func_date_add.cpp index 102c7bc3..15127bca 100644 --- a/utils/funcexp/func_date_add.cpp +++ b/utils/funcexp/func_date_add.cpp @@ -31,6 +31,7 @@ using namespace boost::assign; #include "functor_dtm.h" #include "functioncolumn.h" #include "intervalcolumn.h" +#include "constantcolumn.h" #include "rowgroup.h" using namespace execplan; @@ -640,6 +641,7 @@ int64_t Func_date_add::getIntVal(rowgroup::Row& row, CalpontSystemCatalog::ColType& ct) { int64_t val = 0; + bool dateType = false; switch (parm[0]->data()->resultType().colDataType) { case execplan::CalpontSystemCatalog::BIGINT: @@ -665,7 +667,8 @@ int64_t Func_date_add::getIntVal(rowgroup::Row& row, } case execplan::CalpontSystemCatalog::DATE: { - val = parm[0]->data()->getDatetimeIntVal(row, isNull); + val = parm[0]->data()->getDateIntVal(row, isNull); + dateType = true; break; } case execplan::CalpontSystemCatalog::DATETIME: @@ -686,15 +689,25 @@ int64_t Func_date_add::getIntVal(rowgroup::Row& row, } IntervalColumn::interval_type unit = static_cast(parm[2]->data()->getIntVal(row, isNull)); - OpType funcType = static_cast(parm[3]->data()->getIntVal(row, isNull)); - - bool dateType = false; + OpType funcType = OP_ADD; + ConstantColumn* constCol = dynamic_cast(parm[3]->data()); + execplan::CalpontSystemCatalog::ColType ct3 = parm[3]->data()->resultType(); + if ((ct3.colDataType == execplan::CalpontSystemCatalog::CHAR || + ct3.colDataType == execplan::CalpontSystemCatalog::VARCHAR) && + constCol != NULL && constCol->constval().compare("SUB") == 0) + funcType = OP_SUB; + else + funcType = static_cast(parm[3]->data()->getIntVal(row, isNull)); - uint64_t value = helpers::dateAdd( val, parm[1]->data()->getStrVal(row, isNull), unit, dateType, funcType ); + uint64_t value = helpers::dateAdd( + val, parm[1]->data()->getStrVal(row, isNull), unit, dateType, funcType); if ( value == 0 ) isNull = true; +// if (dateType) +// value = (((value >> 32) & 0xFFFFFFC0) | 0x3E); + return value; } diff --git a/utils/funcexp/funcexp.cpp b/utils/funcexp/funcexp.cpp index 0d43a067..3f8304b9 100644 --- a/utils/funcexp/funcexp.cpp +++ b/utils/funcexp/funcexp.cpp @@ -246,6 +246,9 @@ void FuncExp::evaluate(rowgroup::Row& row, std::vector& expressi case CalpontSystemCatalog::DATE: { int64_t val = expression[i]->getIntVal(row, isNull); + // @bug6061, workaround date_add always return datetime for both date and datetime + if (val & 0xFFFFFFFF00000000) + val = (((val >> 32) & 0xFFFFFFC0) | 0x3E); if (isNull) row.setUintField<4>(DATENULL, expression[i]->outputIndex()); else diff --git a/utils/idbhdfs/hdfs-12/setenv-hdfs-12 b/utils/idbhdfs/hdfs-12/setenv-hdfs-12 index 5a056754..239f2150 100755 --- a/utils/idbhdfs/hdfs-12/setenv-hdfs-12 +++ b/utils/idbhdfs/hdfs-12/setenv-hdfs-12 @@ -1,8 +1,22 @@ +#!/bin/bash if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR + +# Returns 0 if the specified string contains the specified substring, +# otherwise returns 1. +strContains() { + str="$1" + sub="$2" + if test "${str#*$sub}" != "$str"; then + return 0 # $sub is in $str + else + return 1 # $sub is not in $str + fi +} + # Determine where Hadoop is installed hadoop=`which hadoop 2>/dev/null` @@ -23,7 +37,8 @@ while true; do tmppath=$path done -if [[ ! ("$hadooppath" == *bin/hadoop*) ]]; then +strContains "$hadooppath" "bin/hadoop" +if [ $? -eq 1 ]; then echo "Hadoop binary path not located in $hadooppath" echo "Please Contact InfiniDB Customer Support. " echo "Exiting" diff --git a/utils/idbhdfs/hdfs-20/setenv-hdfs-20 b/utils/idbhdfs/hdfs-20/setenv-hdfs-20 index ff648ffa..7353b69b 100755 --- a/utils/idbhdfs/hdfs-20/setenv-hdfs-20 +++ b/utils/idbhdfs/hdfs-20/setenv-hdfs-20 @@ -1,8 +1,21 @@ +#!/bin/bash if [ -z "$INFINIDB_INSTALL_DIR" ]; then INFINIDB_INSTALL_DIR=/usr/local/Calpont fi -declare -x INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR +export INFINIDB_INSTALL_DIR=$INFINIDB_INSTALL_DIR + +# Returns 0 if the specified string contains the specified substring, +# otherwise returns 1. +strContains() { + str="$1" + sub="$2" + if test "${str#*$sub}" != "$str"; then + return 0 # $sub is in $str + else + return 1 # $sub is not in $str + fi +} # Determine where Hadoop is installed hadoop=`which hadoop 2>/dev/null` @@ -23,7 +36,8 @@ while true; do tmppath=$path done -if [[ ! ("$hadooppath" == *bin/hadoop*) ]]; then +strContains "$hadooppath" "bin/hadoop" +if [ $? -eq 1 ]; then echo "Hadoop binary path not located in $hadooppath" echo "Please Contact InfiniDB Customer Support. " echo "Exiting" @@ -151,7 +165,8 @@ $INFINIDB_INSTALL_DIR/bin/setConfig -d Installation JavaPath $javalibpath # Add the jars from hadoop classpath to the CLASSPATH. hadoop classpath | tr : \\n > /tmp/hadoopClasspath.txt for f in `cat /tmp/hadoopClasspath.txt`; do - if [[ ("$f" == *.jar) ]]; then + strContains "$f" ".jar" + if [ $? -eq 0 ]; then CLASSPATH=${CLASSPATH}:$f; fi done diff --git a/utils/querytele/querytele_types.cpp b/utils/querytele/querytele_types.cpp index 536caf9f..6e3be5e6 100644 --- a/utils/querytele/querytele_types.cpp +++ b/utils/querytele/querytele_types.cpp @@ -45,7 +45,7 @@ int _kStepTypeValues[] = { StepType::T_CES, StepType::T_SQS, StepType::T_TAS, - StepType::T_TXS, + StepType::T_TNS, StepType::T_BPS, StepType::T_TCS, StepType::T_HVS, @@ -60,7 +60,7 @@ const char* _kStepTypeNames[] = { "T_CES", "T_SQS", "T_TAS", - "T_TXS", + "T_TNS", "T_BPS", "T_TCS", "T_HVS", diff --git a/utils/querytele/querytele_types.h b/utils/querytele/querytele_types.h index 75b9475a..56c8a433 100644 --- a/utils/querytele/querytele_types.h +++ b/utils/querytele/querytele_types.h @@ -47,7 +47,7 @@ struct StepType { T_CES = 3, T_SQS = 4, T_TAS = 5, - T_TXS = 6, + T_TNS = 6, T_BPS = 7, T_TCS = 8, T_HVS = 9, diff --git a/utils/querytele/queryteleclient.cpp b/utils/querytele/queryteleclient.cpp index 90e88a8b..2e60f004 100644 --- a/utils/querytele/queryteleclient.cpp +++ b/utils/querytele/queryteleclient.cpp @@ -231,7 +231,7 @@ void QueryTeleClient::postStepTele(const StepTeleStats& sts) QT_STYPE_CASE_(T_CES); QT_STYPE_CASE_(T_SQS); QT_STYPE_CASE_(T_TAS); - QT_STYPE_CASE_(T_TXS); + QT_STYPE_CASE_(T_TNS); QT_STYPE_CASE_(T_BPS); QT_STYPE_CASE_(T_TCS); QT_STYPE_CASE_(T_HVS); @@ -253,5 +253,11 @@ void QueryTeleClient::postImportTele(const ImportTeleStats& its) fProtoImpl->enqImportTele(itdata); } +void QueryTeleClient::waitForQueues() +{ + if (fProtoImpl) + fProtoImpl->waitForQueues(); +} + } diff --git a/utils/querytele/queryteleclient.h b/utils/querytele/queryteleclient.h index 45cfd1eb..00b74f3f 100644 --- a/utils/querytele/queryteleclient.h +++ b/utils/querytele/queryteleclient.h @@ -60,6 +60,8 @@ class QueryTeleClient inline const QueryStepParms& stepParms() const { return fStepParms; } inline QueryStepParms& stepParms() { return fStepParms; } + EXPORT void waitForQueues(); + EXPORT static boost::uuids::uuid genUUID(); EXPORT static int64_t timeNowms(); diff --git a/utils/querytele/queryteleprotoimpl.cpp b/utils/querytele/queryteleprotoimpl.cpp index 68e42d2b..f6cad803 100644 --- a/utils/querytele/queryteleprotoimpl.cpp +++ b/utils/querytele/queryteleprotoimpl.cpp @@ -16,6 +16,8 @@ MA 02110-1301, USA. */ #include +#include +#include using namespace std; #define BOOST_DISABLE_ASSERTS @@ -61,6 +63,122 @@ boost::shared_ptr fSocket; boost::shared_ptr fTransport; boost::shared_ptr fProtocol; +querytele::StepTele gLastStep; + +struct QStats +{ + int qtqueuedrops; + int stqueuedrops; + int stqueuedups; + int itqueuedrops; + QStats() : + qtqueuedrops(0), + stqueuedrops(0), + stqueuedups(0), + itqueuedrops(0) { ; } +}; + +QStats fQStats; + +string get_trace_file() +{ + ostringstream oss; + pid_t pid = getpid(); +#ifdef _MSC_VER + DWORD threadid = GetCurrentThreadId(); +#else + pthread_t threadid = pthread_self(); +#endif + oss << "/tmp/qt-consumer-" << pid << "-" << threadid; + + return oss.str(); +} + +void log_query(const querytele::QueryTele& qtdata) +{ + ofstream trace(get_trace_file().c_str(), ios::out | ios::app); + trace << "Query," + << qtdata.query_uuid << "," + << ","; // skip step uuid + if (qtdata.msg_type == querytele::QTType::QT_SUMMARY) + trace << "SUMMARY,"; + else if (qtdata.msg_type == querytele::QTType::QT_START) + trace << "START,"; + else + trace << "PROGRESS,"; + + trace << ","; // sktp step type + + trace << qtdata.start_time << ","; + trace << qtdata.end_time << ","; + + trace << qtdata.cache_io << ","; + trace << qtdata.msg_rcv_cnt << ","; + trace << qtdata.rows << ","; + trace << qtdata.max_mem_pct << ","; + + trace << qtdata.query_type << ","; + trace << qtdata.schema_name << ","; + trace << qtdata.query << ","; + trace << qtdata.system_name; + trace << endl; + trace.close(); +} + +const string st2str(enum querytele::StepType::type t) +{ + switch (t) + { + case querytele::StepType::T_HJS: return "HJS"; + case querytele::StepType::T_DSS: return "DSS"; + case querytele::StepType::T_CES: return "CES"; + case querytele::StepType::T_SQS: return "SQS"; + case querytele::StepType::T_TAS: return "TAS"; + case querytele::StepType::T_TNS: return "TNS"; + case querytele::StepType::T_BPS: return "BPS"; + case querytele::StepType::T_TCS: return "TCS"; + case querytele::StepType::T_HVS: return "HVS"; + case querytele::StepType::T_WFS: return "WFS"; + case querytele::StepType::T_SAS: return "SAS"; + case querytele::StepType::T_TUN: return "TUN"; + default: return "INV"; + } + return "INV"; +} + +void log_step(const querytele::StepTele& stdata) +{ + ofstream trace(get_trace_file().c_str(), ios::out | ios::app); + + trace << "Step," + << stdata.query_uuid << "," + << stdata.step_uuid << ","; + if (stdata.msg_type == querytele::STType::ST_SUMMARY) + trace << "SUMMARY,"; + else if (stdata.msg_type == querytele::STType::ST_START) + trace << "START,"; + else + trace << "PROGRESS,"; + trace << st2str(stdata.step_type) << ","; + + trace << stdata.start_time << ","; + trace << stdata.end_time << ","; + + trace << stdata.cache_io << ","; + trace << stdata.msg_rcv_cnt << ","; + trace << stdata.rows << ","; + + if (stdata.total_units_of_work > 0) + trace << stdata.units_of_work_completed*100/stdata.total_units_of_work << ","; + else + trace << "-1,"; + + trace << ",,,"; // skip qtype, schemo, etc. + trace << fQStats.stqueuedrops << "," << fQStats.stqueuedups << "," << stQueue.queue.size(); + trace << endl; + trace.close(); +} + void TeleConsumer() { bool didSomeWork=false; @@ -105,6 +223,9 @@ void TeleConsumer() qtlk.unlock(); try { fTransport->open(); +#ifdef QUERY_TELE_DEBUG + log_query(qtdata); +#endif client.postQuery(qtdata); fTransport->close(); } catch (...) { @@ -120,13 +241,18 @@ void TeleConsumer() stlk.lock(); // Finally empty the step queue... - while (!stQueue.queue.empty()) + // @bug6088 - Added check for query queue and import queue in while statment below to + // keep the step logs from starving the query and import logs. + while (!stQueue.queue.empty() && qtQueue.queue.empty() && itQueue.queue.empty()) { querytele::StepTele stdata = stQueue.queue.front(); stQueue.queue.pop(); stlk.unlock(); try { fTransport->open(); +#ifdef QUERY_TELE_DEBUG + log_step(stdata); +#endif client.postStep(stdata); fTransport->close(); } catch (...) { @@ -142,7 +268,7 @@ void TeleConsumer() if (!didSomeWork) { - usleep(100000); + usleep(50000); } } } catch (...) { @@ -181,9 +307,26 @@ int QueryTeleProtoImpl::enqStepTele(const StepTele& stdata) { try { boost::mutex::scoped_lock lk(stQueue.queueMtx); - if (stQueue.queue.size() >= MaxQueueElems) + // @bug6088 - Added conditions below to always log progress SUMMARY and START messages to avoid completed queries showing up with progress 0 + // and no steps. + if (stQueue.queue.size() >= MaxQueueElems && stdata.msg_type != querytele::STType::ST_SUMMARY && stdata.msg_type != querytele::STType::ST_START) + { + fQStats.stqueuedrops++; return -1; - stQueue.queue.push(stdata); + } + if( stdata.step_uuid != gLastStep.step_uuid || + stdata.msg_type != gLastStep.msg_type || + stdata.step_type != gLastStep.step_type || + stdata.total_units_of_work != gLastStep.total_units_of_work || + stdata.units_of_work_completed != gLastStep.units_of_work_completed ) + { + stQueue.queue.push(stdata); + gLastStep = stdata; + } + else + { + fQStats.stqueuedups++; + } } catch (...) { return -2; } @@ -196,7 +339,10 @@ int QueryTeleProtoImpl::enqQueryTele(const QueryTele& qtdata) try { boost::mutex::scoped_lock lk(qtQueue.queueMtx); if (qtQueue.queue.size() >= MaxQueueElems) + { + fQStats.qtqueuedrops++; return -1; + } qtQueue.queue.push(qtdata); } catch (...) { return -2; @@ -210,7 +356,10 @@ int QueryTeleProtoImpl::enqImportTele(const ImportTele& itdata) try { boost::mutex::scoped_lock lk(itQueue.queueMtx); if (itQueue.queue.size() >= MaxQueueElems) + { + fQStats.itqueuedrops++; return -1; + } itQueue.queue.push(itdata); } catch (...) { return -2; @@ -219,5 +368,22 @@ int QueryTeleProtoImpl::enqImportTele(const ImportTele& itdata) return 0; } +int QueryTeleProtoImpl::waitForQueues() +{ + try { + boost::mutex::scoped_lock lk(itQueue.queueMtx); + while (!itQueue.queue.empty()) + { + lk.unlock(); + usleep(100000); + lk.lock(); + } + } catch (...) { + return -1; + } + + return 0; +} + } //namespace querytele diff --git a/utils/querytele/queryteleprotoimpl.h b/utils/querytele/queryteleprotoimpl.h index 5eed9f2a..19cdb812 100644 --- a/utils/querytele/queryteleprotoimpl.h +++ b/utils/querytele/queryteleprotoimpl.h @@ -33,6 +33,11 @@ class QueryTeleProtoImpl int enqImportTele(const ImportTele&); int enqQueryTele(const QueryTele&); + /** + * Wait for the consumer thread to post all messages + **/ + int waitForQueues(); + protected: private: diff --git a/utils/querytele/serverdriver.cpp b/utils/querytele/serverdriver.cpp index f8ed24a8..322f9467 100644 --- a/utils/querytele/serverdriver.cpp +++ b/utils/querytele/serverdriver.cpp @@ -64,7 +64,7 @@ const string st2str(enum StepType::type t) case StepType::T_CES: return "CES"; case StepType::T_SQS: return "SQS"; case StepType::T_TAS: return "TAS"; - case StepType::T_TXS: return "TXS"; + case StepType::T_TNS: return "TNS"; case StepType::T_BPS: return "BPS"; case StepType::T_TCS: return "TCS"; case StepType::T_HVS: return "HVS"; @@ -179,7 +179,7 @@ int main(int argc, char **argv) { shared_ptr protocolFactory(new atp::TBinaryProtocolFactory()); shared_ptr handler(new QueryTeleServiceHandler()); shared_ptr processor(new QueryTeleServiceProcessor(handler)); - shared_ptr serverTransport(new att::TServerSocket(9090)); + shared_ptr serverTransport(new att::TServerSocket(9990)); shared_ptr transportFactory(new att::TBufferedTransportFactory()); ats::TSimpleServer server(processor, diff --git a/utils/querytele/telestats.h b/utils/querytele/telestats.h index ad761b7c..aa368330 100644 --- a/utils/querytele/telestats.h +++ b/utils/querytele/telestats.h @@ -108,7 +108,7 @@ struct StepTeleStats T_CES, //CrossEngineStep T_SQS, //SubQueryStep T_TAS, //TupleAggregateStep - T_TXS, //TupleAnnexStep + T_TNS, //TupleAnnexStep T_BPS, //TupleBPS T_TCS, //TupleConstantStep T_HVS, //TupleHavingStep diff --git a/utils/rowgroup/rowgroup.cpp b/utils/rowgroup/rowgroup.cpp index e83e2f70..fa48ae0a 100644 --- a/utils/rowgroup/rowgroup.cpp +++ b/utils/rowgroup/rowgroup.cpp @@ -53,7 +53,7 @@ using namespace execplan; namespace rowgroup { -StringStore::StringStore() : empty(true) { } +StringStore::StringStore() : empty(true), fUseStoreStringMutex(false) { } StringStore::StringStore(const StringStore &) { @@ -85,7 +85,7 @@ StringStore::~StringStore() uint32_t StringStore::storeString(const uint8_t *data, uint32_t len) { MemChunk *lastMC = NULL; - uint32_t ret; + uint32_t ret = 0; empty = false; // At least a NULL is being stored. @@ -97,6 +97,11 @@ uint32_t StringStore::storeString(const uint8_t *data, uint32_t len) *((uint64_t *) data) == *((uint64_t *) joblist::CPNULLSTRMARK.c_str())) return numeric_limits::max(); + //@bug6065, make StringStore::storeString() thread safe + boost::mutex::scoped_lock lk(fMutex, defer_lock); + if (fUseStoreStringMutex) + lk.lock(); + if (mem.size() > 0) lastMC = (MemChunk *) mem.back().get(); @@ -122,6 +127,7 @@ uint32_t StringStore::storeString(const uint8_t *data, uint32_t len) cout << "' at position " << lastMC->currentSize << " len " << len << dec << endl; */ lastMC->currentSize += len; + return ret; } @@ -365,11 +371,11 @@ string Row::toString() const break; } case CalpontSystemCatalog::FLOAT: - case CalpontSystemCatalog::UFLOAT: + case CalpontSystemCatalog::UFLOAT: os << getFloatField(i) << " "; break; case CalpontSystemCatalog::DOUBLE: - case CalpontSystemCatalog::UDOUBLE: + case CalpontSystemCatalog::UDOUBLE: os << getDoubleField(i) << " "; break; case CalpontSystemCatalog::LONGDOUBLE: @@ -413,11 +419,11 @@ string Row::toCSV() const os << getStringField(i).c_str(); break; case CalpontSystemCatalog::FLOAT: - case CalpontSystemCatalog::UFLOAT: + case CalpontSystemCatalog::UFLOAT: os << getFloatField(i); break; case CalpontSystemCatalog::DOUBLE: - case CalpontSystemCatalog::UDOUBLE: + case CalpontSystemCatalog::UDOUBLE: os << getDoubleField(i); break; case CalpontSystemCatalog::LONGDOUBLE: @@ -456,7 +462,7 @@ void Row::initToNull() case CalpontSystemCatalog::INT: *((int32_t *) &data[offsets[i]]) = static_cast(joblist::INTNULL); break; case CalpontSystemCatalog::FLOAT: - case CalpontSystemCatalog::UFLOAT: + case CalpontSystemCatalog::UFLOAT: *((int32_t *) &data[offsets[i]]) = static_cast(joblist::FLOATNULL); break; case CalpontSystemCatalog::DATE: *((int32_t *) &data[offsets[i]]) = static_cast(joblist::DATENULL); break; @@ -467,7 +473,7 @@ void Row::initToNull() *((uint64_t *) &data[offsets[i]]) = 0; break; case CalpontSystemCatalog::DOUBLE: - case CalpontSystemCatalog::UDOUBLE: + case CalpontSystemCatalog::UDOUBLE: *((uint64_t *) &data[offsets[i]]) = joblist::DOUBLENULL; break; case CalpontSystemCatalog::DATETIME: *((uint64_t *) &data[offsets[i]]) = joblist::DATETIMENULL; break; @@ -501,8 +507,8 @@ void Row::initToNull() case CalpontSystemCatalog::VARBINARY: *((uint16_t *) &data[offsets[i]]) = 0; break; case CalpontSystemCatalog::DECIMAL: - case CalpontSystemCatalog::UDECIMAL: - { + case CalpontSystemCatalog::UDECIMAL: + { uint32_t len = getColumnWidth(i); switch (len) { case 1 : data[offsets[i]] = joblist::TINYINTNULL; break; @@ -512,15 +518,15 @@ void Row::initToNull() } break; } - case CalpontSystemCatalog::UTINYINT: - data[offsets[i]] = joblist::UTINYINTNULL; break; - case CalpontSystemCatalog::USMALLINT: - *((uint16_t *) &data[offsets[i]]) = joblist::USMALLINTNULL; break; - case CalpontSystemCatalog::UMEDINT: - case CalpontSystemCatalog::UINT: - *((uint32_t *) &data[offsets[i]]) = joblist::UINTNULL; break; - case CalpontSystemCatalog::UBIGINT: - *((uint64_t *) &data[offsets[i]]) = joblist::UBIGINTNULL; break; + case CalpontSystemCatalog::UTINYINT: + data[offsets[i]] = joblist::UTINYINTNULL; break; + case CalpontSystemCatalog::USMALLINT: + *((uint16_t *) &data[offsets[i]]) = joblist::USMALLINTNULL; break; + case CalpontSystemCatalog::UMEDINT: + case CalpontSystemCatalog::UINT: + *((uint32_t *) &data[offsets[i]]) = joblist::UINTNULL; break; + case CalpontSystemCatalog::UBIGINT: + *((uint64_t *) &data[offsets[i]]) = joblist::UBIGINTNULL; break; case CalpontSystemCatalog::LONGDOUBLE: { // no NULL value for long double yet, this is a nan. memset(&data[offsets[i]], 0xFF, getColumnWidth(i)); @@ -547,14 +553,14 @@ bool Row::isNullValue(uint32_t colIndex) const case CalpontSystemCatalog::INT: return (*((int32_t *) &data[offsets[colIndex]]) == static_cast(joblist::INTNULL)); case CalpontSystemCatalog::FLOAT: - case CalpontSystemCatalog::UFLOAT: + case CalpontSystemCatalog::UFLOAT: return (*((int32_t *) &data[offsets[colIndex]]) == static_cast(joblist::FLOATNULL)); case CalpontSystemCatalog::DATE: return (*((int32_t *) &data[offsets[colIndex]]) == static_cast(joblist::DATENULL)); case CalpontSystemCatalog::BIGINT: return (*((int64_t *) &data[offsets[colIndex]]) == static_cast(joblist::BIGINTNULL)); case CalpontSystemCatalog::DOUBLE: - case CalpontSystemCatalog::UDOUBLE: + case CalpontSystemCatalog::UDOUBLE: return (*((uint64_t *) &data[offsets[colIndex]]) == joblist::DOUBLENULL); case CalpontSystemCatalog::DATETIME: return (*((uint64_t *) &data[offsets[colIndex]]) == joblist::DATETIMENULL); @@ -586,8 +592,8 @@ bool Row::isNullValue(uint32_t colIndex) const break; } case CalpontSystemCatalog::DECIMAL: - case CalpontSystemCatalog::UDECIMAL: - { + case CalpontSystemCatalog::UDECIMAL: + { uint32_t len = getColumnWidth(colIndex); switch (len) { case 1 : return (data[offsets[colIndex]] == joblist::TINYINTNULL); @@ -614,15 +620,15 @@ bool Row::isNullValue(uint32_t colIndex) const break; } - case CalpontSystemCatalog::UTINYINT: - return (data[offsets[colIndex]] == joblist::UTINYINTNULL); - case CalpontSystemCatalog::USMALLINT: - return (*((uint16_t *) &data[offsets[colIndex]]) == joblist::USMALLINTNULL); - case CalpontSystemCatalog::UMEDINT: - case CalpontSystemCatalog::UINT: - return (*((uint32_t *) &data[offsets[colIndex]]) == joblist::UINTNULL); - case CalpontSystemCatalog::UBIGINT: - return (*((uint64_t *) &data[offsets[colIndex]]) == joblist::UBIGINTNULL); + case CalpontSystemCatalog::UTINYINT: + return (data[offsets[colIndex]] == joblist::UTINYINTNULL); + case CalpontSystemCatalog::USMALLINT: + return (*((uint16_t *) &data[offsets[colIndex]]) == joblist::USMALLINTNULL); + case CalpontSystemCatalog::UMEDINT: + case CalpontSystemCatalog::UINT: + return (*((uint32_t *) &data[offsets[colIndex]]) == joblist::UINTNULL); + case CalpontSystemCatalog::UBIGINT: + return (*((uint64_t *) &data[offsets[colIndex]]) == joblist::UBIGINTNULL); case CalpontSystemCatalog::LONGDOUBLE: // return false; // no NULL value for long double yet break; @@ -640,7 +646,7 @@ bool Row::isNullValue(uint32_t colIndex) const uint64_t Row::getNullValue(uint32_t colIndex) const { - return utils::getNullValue(types[colIndex], getColumnWidth(colIndex)); + return utils::getNullValue(types[colIndex], getColumnWidth(colIndex)); #if 0 switch (types[colIndex]) { case CalpontSystemCatalog::TINYINT: @@ -651,14 +657,14 @@ uint64_t Row::getNullValue(uint32_t colIndex) const case CalpontSystemCatalog::INT: return joblist::INTNULL; case CalpontSystemCatalog::FLOAT: - case CalpontSystemCatalog::UFLOAT: + case CalpontSystemCatalog::UFLOAT: return joblist::FLOATNULL; case CalpontSystemCatalog::DATE: return joblist::DATENULL; case CalpontSystemCatalog::BIGINT: return joblist::BIGINTNULL; case CalpontSystemCatalog::DOUBLE: - case CalpontSystemCatalog::UDOUBLE: + case CalpontSystemCatalog::UDOUBLE: return joblist::DOUBLENULL; case CalpontSystemCatalog::DATETIME: return joblist::DATETIMENULL; @@ -681,8 +687,8 @@ uint64_t Row::getNullValue(uint32_t colIndex) const break; } case CalpontSystemCatalog::DECIMAL: - case CalpontSystemCatalog::UDECIMAL: - { + case CalpontSystemCatalog::UDECIMAL: + { uint32_t len = getColumnWidth(colIndex); switch (len) { case 1 : return joblist::TINYINTNULL; @@ -692,15 +698,15 @@ uint64_t Row::getNullValue(uint32_t colIndex) const } break; } - case CalpontSystemCatalog::UTINYINT: - return joblist::UTINYINTNULL; - case CalpontSystemCatalog::USMALLINT: - return joblist::USMALLINTNULL; - case CalpontSystemCatalog::UMEDINT: - case CalpontSystemCatalog::UINT: - return joblist::UINTNULL; - case CalpontSystemCatalog::UBIGINT: - return joblist::UBIGINTNULL; + case CalpontSystemCatalog::UTINYINT: + return joblist::UTINYINTNULL; + case CalpontSystemCatalog::USMALLINT: + return joblist::USMALLINTNULL; + case CalpontSystemCatalog::UMEDINT: + case CalpontSystemCatalog::UINT: + return joblist::UINTNULL; + case CalpontSystemCatalog::UBIGINT: + return joblist::UBIGINTNULL; case CalpontSystemCatalog::LONGDOUBLE: return -1; // no NULL value for long double yet, this is a nan. case CalpontSystemCatalog::VARBINARY: @@ -719,7 +725,7 @@ uint64_t Row::getNullValue(uint32_t colIndex) const */ int64_t Row::getSignedNullValue(uint32_t colIndex) const { - return utils::getSignedNullValue(types[colIndex], getColumnWidth(colIndex)); + return utils::getSignedNullValue(types[colIndex], getColumnWidth(colIndex)); #if 0 switch (types[colIndex]) { case CalpontSystemCatalog::TINYINT: @@ -730,14 +736,14 @@ int64_t Row::getSignedNullValue(uint32_t colIndex) const case CalpontSystemCatalog::INT: return (int64_t) ((int32_t) joblist::INTNULL); case CalpontSystemCatalog::FLOAT: - case CalpontSystemCatalog::UFLOAT: + case CalpontSystemCatalog::UFLOAT: return (int64_t) ((int32_t) joblist::FLOATNULL); case CalpontSystemCatalog::DATE: return (int64_t) ((int32_t) joblist::DATENULL); case CalpontSystemCatalog::BIGINT: return joblist::BIGINTNULL; case CalpontSystemCatalog::DOUBLE: - case CalpontSystemCatalog::UDOUBLE: + case CalpontSystemCatalog::UDOUBLE: return joblist::DOUBLENULL; case CalpontSystemCatalog::DATETIME: return joblist::DATETIMENULL; @@ -760,7 +766,7 @@ int64_t Row::getSignedNullValue(uint32_t colIndex) const break; } case CalpontSystemCatalog::DECIMAL: - case CalpontSystemCatalog::UDECIMAL: { + case CalpontSystemCatalog::UDECIMAL: { uint32_t len = getColumnWidth(colIndex); switch (len) { case 1 : return (int64_t) ((int8_t) joblist::TINYINTNULL); @@ -770,15 +776,15 @@ int64_t Row::getSignedNullValue(uint32_t colIndex) const } break; } - case CalpontSystemCatalog::UTINYINT: - return (int64_t) ((int8_t) joblist::UTINYINTNULL); - case CalpontSystemCatalog::USMALLINT: - return (int64_t) ((int16_t) joblist::USMALLINTNULL); - case CalpontSystemCatalog::UMEDINT: - case CalpontSystemCatalog::UINT: - return (int64_t) ((int32_t) joblist::UINTNULL); - case CalpontSystemCatalog::UBIGINT: - return (int64_t)joblist::UBIGINTNULL; + case CalpontSystemCatalog::UTINYINT: + return (int64_t) ((int8_t) joblist::UTINYINTNULL); + case CalpontSystemCatalog::USMALLINT: + return (int64_t) ((int16_t) joblist::USMALLINTNULL); + case CalpontSystemCatalog::UMEDINT: + case CalpontSystemCatalog::UINT: + return (int64_t) ((int32_t) joblist::UINTNULL); + case CalpontSystemCatalog::UBIGINT: + return (int64_t)joblist::UBIGINTNULL; case CalpontSystemCatalog::LONGDOUBLE: return -1; // no NULL value for long double yet, this is a nan. case CalpontSystemCatalog::VARBINARY: @@ -1091,8 +1097,8 @@ void applyMapping(const int *mapping, const Row &in, Row *out) out->setVarBinaryField(in.getVarBinaryField(i), in.getVarBinaryLength(i), mapping[i]); else if (UNLIKELY(in.getColTypes()[i] == execplan::CalpontSystemCatalog::LONGDOUBLE)) out->setLongDoubleField(in.getLongDoubleField(i), mapping[i]); - else if (in.isUnsigned(i)) - out->setUintField(in.getUintField(i), mapping[i]); + else if (in.isUnsigned(i)) + out->setUintField(in.getUintField(i), mapping[i]); else out->setIntField(in.getIntField(i), mapping[i]); } @@ -1197,7 +1203,7 @@ void RowGroup::addToSysDataList(execplan::CalpontSystemCatalog::NJLSysDataList& } case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::INT: - case CalpontSystemCatalog::UINT: + case CalpontSystemCatalog::UINT: cr->PutData(row.getIntField<4>(j)); break; case CalpontSystemCatalog::DATE: diff --git a/utils/rowgroup/rowgroup.h b/utils/rowgroup/rowgroup.h index fd8e3b51..93caf0c9 100644 --- a/utils/rowgroup/rowgroup.h +++ b/utils/rowgroup/rowgroup.h @@ -39,6 +39,7 @@ //#define NDEBUG #include #include +#include #include #include #ifdef __linux__ @@ -107,6 +108,10 @@ class StringStore void serialize(messageqcpp::ByteStream &) const; uint32_t deserialize(messageqcpp::ByteStream &); + //@bug6065, make StringStore::storeString() thread safe + void useStoreStringMutex(bool b) { fUseStoreStringMutex = b; } + bool useStoreStringMutex() const { return fUseStoreStringMutex; } + private: StringStore(const StringStore &); StringStore & operator=(const StringStore &); @@ -123,6 +128,9 @@ class StringStore std::vector > mem; bool empty; + bool fUseStoreStringMutex; //@bug6065, make StringStore::storeString() thread safe + boost::mutex fMutex; + }; #ifdef _MSC_VER @@ -163,6 +171,10 @@ class RGData // where it's inconvenient to instantiate one. inline void getRow(uint32_t num, Row *row); + //@bug6065, make StringStore::storeString() thread safe + void useStoreStringMutex(bool b) { if (strings) strings->useStoreStringMutex(b); } + bool useStoreStringMutex() const { return (strings ? (strings->useStoreStringMutex()) : false); } + boost::shared_array rowData; boost::shared_ptr strings; @@ -173,7 +185,7 @@ class RGData // Need sig to support backward compat. RGData can deserialize both forms. static const uint32_t RGDATA_SIG = 0xffffffff; //won't happen for 'old' Rowgroup data -friend class RowGroup; + friend class RowGroup; }; @@ -220,7 +232,7 @@ class Row // this returns true if the type is not CHAR or VARCHAR inline bool isCharType(uint32_t colIndex) const; - inline bool isUnsigned(uint32_t colIndex) const; + inline bool isUnsigned(uint32_t colIndex) const; inline bool isShortString(uint32_t colIndex) const; inline bool isLongString(uint32_t colIndex) const; @@ -420,12 +432,12 @@ inline const execplan::CalpontSystemCatalog::ColDataType* Row::getColTypes() con inline bool Row::isCharType(uint32_t colIndex) const { - return execplan::isCharType(types[colIndex]); + return execplan::isCharType(types[colIndex]); } inline bool Row::isUnsigned(uint32_t colIndex) const { - return execplan::isUnsigned(types[colIndex]); + return execplan::isUnsigned(types[colIndex]); } inline bool Row::isShortString(uint32_t colIndex) const @@ -996,7 +1008,7 @@ class RowGroup : public messageqcpp::Serializeable inline const std::vector & getOIDs() const; inline const std::vector & getKeys() const; inline const std::vector & getColWidths() const; - inline execplan::CalpontSystemCatalog::ColDataType getColType(uint32_t colIndex) const; + inline execplan::CalpontSystemCatalog::ColDataType getColType(uint32_t colIndex) const; inline const std::vector& getColTypes() const; inline std::vector& getColTypes(); inline boost::shared_array &getForceInline(); @@ -1004,7 +1016,7 @@ class RowGroup : public messageqcpp::Serializeable // this returns true if the type is CHAR or VARCHAR inline bool isCharType(uint32_t colIndex) const; - inline bool isUnsigned(uint32_t colIndex) const; + inline bool isUnsigned(uint32_t colIndex) const; inline bool isShortString(uint32_t colIndex) const; inline bool isLongString(uint32_t colIndex) const; @@ -1197,7 +1209,7 @@ void RowGroup::initRow(Row *r, bool forceInlineData) const { r->columnCount = columnCount; if (LIKELY(!types.empty())) { - r->colWidths = (uint32_t *) &colWidths[0]; + r->colWidths = (uint32_t *) &colWidths[0]; r->types = (execplan::CalpontSystemCatalog::ColDataType *) &(types[0]); r->scale = (uint32_t *) &(scale[0]); r->precision = (uint32_t *) &(precision[0]); @@ -1239,12 +1251,12 @@ inline uint64_t RowGroup::getSizeWithStrings() const inline bool RowGroup::isCharType(uint32_t colIndex) const { - return execplan::isCharType(types[colIndex]); + return execplan::isCharType(types[colIndex]); } inline bool RowGroup::isUnsigned(uint32_t colIndex) const { - return execplan::isUnsigned(types[colIndex]); + return execplan::isUnsigned(types[colIndex]); } inline bool RowGroup::isShortString(uint32_t colIndex) const @@ -1369,13 +1381,13 @@ inline void RowGroup::getLocation(uint32_t *partNum, uint16_t *segNum, // returns the first RID of the logical block identified by baseRid inline uint64_t getExtentRelativeRid(uint64_t baseRid) { - uint64_t blockNum = baseRid & 0x3ff; + uint64_t blockNum = baseRid & 0x3ff; return (blockNum << 13); } inline uint64_t Row::getExtentRelativeRid() const { - return rowgroup::getExtentRelativeRid(baseRid) | (getRelRid() & 0x1fff); + return rowgroup::getExtentRelativeRid(baseRid) | (getRelRid() & 0x1fff); } // returns the first RID of the logical block identified by baseRid @@ -1388,7 +1400,7 @@ inline uint64_t getFileRelativeRid(uint64_t baseRid) inline uint64_t Row::getFileRelativeRid() const { - return rowgroup::getFileRelativeRid(baseRid) | (getRelRid() & 0x1fff); + return rowgroup::getFileRelativeRid(baseRid) | (getRelRid() & 0x1fff); } inline void Row::getLocation(uint32_t *partNum, uint16_t *segNum, uint8_t *extentNum, diff --git a/utils/udfsdk/libudf_mysql.rc b/utils/udfsdk/libudf_mysql.rc index 963ebb7a..2dfddeba 100644 --- a/utils/udfsdk/libudf_mysql.rc +++ b/utils/udfsdk/libudf_mysql.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB UDF API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "libudfsdk" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "libudfsdk.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/utils/udfsdk/libudfsdk.rc b/utils/udfsdk/libudfsdk.rc index 963ebb7a..2dfddeba 100644 --- a/utils/udfsdk/libudfsdk.rc +++ b/utils/udfsdk/libudfsdk.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB UDF API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "libudfsdk" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "libudfsdk.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/utils/winport/idb_64_enterprise.nsi b/utils/winport/idb_64_enterprise.nsi index 11e6ecc0..ede05b2f 100644 --- a/utils/winport/idb_64_enterprise.nsi +++ b/utils/winport/idb_64_enterprise.nsi @@ -8,9 +8,9 @@ OutFile InfiniDB64-ent.exe !define DISPLAY_URL http://www.infinidb.co/ -!define DISPLAY_VERSION "4.5.1" -VIAddVersionKey "FileVersion" "4.5.1-3" -VIProductVersion "4.5.1.3" +!define DISPLAY_VERSION "4.5" +VIAddVersionKey "FileVersion" "4.5.0-0" +VIProductVersion "4.5.0.0" VIAddVersionKey "ProductVersion" "${DISPLAY_VERSION}" VIAddVersionKey "CompanyName" "InfiniDB, Inc." diff --git a/utils/winport/idb_64_standard.nsi b/utils/winport/idb_64_standard.nsi index 7ac03e95..1369f8cf 100644 --- a/utils/winport/idb_64_standard.nsi +++ b/utils/winport/idb_64_standard.nsi @@ -8,9 +8,9 @@ OutFile InfiniDB64.exe !define DISPLAY_URL http://www.infinidb.co/ -!define DISPLAY_VERSION "4.5.1" -VIAddVersionKey "FileVersion" "4.5.1-3" -VIProductVersion "4.5.1.3" +!define DISPLAY_VERSION "4.5" +VIAddVersionKey "FileVersion" "4.5.0-0" +VIProductVersion "4.5.0.0" VIAddVersionKey "ProductVersion" "${DISPLAY_VERSION}" VIAddVersionKey "CompanyName" "InfiniDB, Inc." diff --git a/utils/winport/libwinport.vcxproj b/utils/winport/libwinport.vcxproj index 2494ee30..f51f1cb7 100644 --- a/utils/winport/libwinport.vcxproj +++ b/utils/winport/libwinport.vcxproj @@ -113,6 +113,8 @@ $(SolutionDir)..\..\$(Platform)\$(Configuration)\ $(SolutionDir)..\..\obj\$(ProjectName)\$(Platform)\$(Configuration)\ + + @@ -201,6 +203,21 @@ 4267;4244;4996;%(DisableSpecificWarnings) false + + + + + + + + + + cd $(SolutionDir) +$(SolutionDir)BuildCalpontVersion.bat + + + BuildCalpontVersion.bat + diff --git a/utils/winport/winfinidb.rc b/utils/winport/winfinidb.rc index f048d278..32d7835e 100644 --- a/utils/winport/winfinidb.rc +++ b/utils/winport/winfinidb.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB Windows Service Manager" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "winfinidb" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "winfinidb.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/versioning/BRM/controllernode.rc b/versioning/BRM/controllernode.rc index 84479147..6a78ff4b 100644 --- a/versioning/BRM/controllernode.rc +++ b/versioning/BRM/controllernode.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB DBRM Controller Node" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "controllernode" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "controllernode.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/versioning/BRM/dbrm.cpp b/versioning/BRM/dbrm.cpp index b862b47f..f535bedd 100644 --- a/versioning/BRM/dbrm.cpp +++ b/versioning/BRM/dbrm.cpp @@ -2681,8 +2681,11 @@ void DBRM::rolledback(TxnID& txnid) logging::LOG_TYPE_ERROR); response >> tmp; if (tmp != ERR_OK) - log("DBRM: error: SessionManager::rolledback() failed (valid error code)", - logging::LOG_TYPE_ERROR); + { + if (getSystemReady() != 0 ) + log("DBRM: error: SessionManager::rolledback() failed (valid error code)", + logging::LOG_TYPE_ERROR); + } } int DBRM::getUnlockedLBIDs(BlockList_t *list) DBRM_THROW diff --git a/versioning/BRM/libbrm.rc b/versioning/BRM/libbrm.rc index d3375dac..915df1d7 100644 --- a/versioning/BRM/libbrm.rc +++ b/versioning/BRM/libbrm.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB BRM API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "libbrm" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "libbrm.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/versioning/BRM/oidserver.cpp b/versioning/BRM/oidserver.cpp index b1c26f8b..3e80fdde 100644 --- a/versioning/BRM/oidserver.cpp +++ b/versioning/BRM/oidserver.cpp @@ -33,21 +33,21 @@ * also requires file IO. Most functions throw an exception if a hard IO error * occurs more than MaxRetries times in a row. Right now the code makes * no attempt to back out changes that occured before the error although it - * may be possible to do so for certain errors. Probably the best course of + * may be possible to do so for certain errors. Probably the best course of * action would be to halt the system if an exception is thrown here - * to prevent database corruption resulting allocation of OIDs from a + * to prevent database corruption resulting allocation of OIDs from a * possibly corrupt OID bitmap. The OID bitmap can be rebuilt at system * startup if necessary (need to write a tool to do that still). * - * There are a few checks to verify the safety of allocations and - * deallocations & the correctness of this implementation in general. - * Those errors will throw logic_error. IO errors will throw + * There are a few checks to verify the safety of allocations and + * deallocations & the correctness of this implementation in general. + * Those errors will throw logic_error. IO errors will throw * ios_base::failure. * * There are probably oodles of optimizations possible given this implmementation. * For example: * - make fullScan() construct a freelist - * - sorting & coalescing free list entries will raise the hit rate + * - sorting & coalescing free list entries will raise the hit rate * (at what cost?) * - implement a bias for high numbered OIDs in the free list to reduce * the number of fullScans searching far in the bitmap @@ -334,6 +334,7 @@ OIDServer::OIDServer() : fFp(NULL), fFd(-1) { os << "Extent Map not empty and " << fFilename << " not found. Setting system to read-only"; cerr << os.str() << endl; + log(os.str()); em.setReadOnly(true); throw runtime_error(os.str()); } @@ -382,6 +383,7 @@ OIDServer::OIDServer() : fFp(NULL), fFd(-1) { os << "Extent Map not empty and " << fFilename << " not found. Setting system to read-only"; cerr << os.str() << endl; + log(os.str()); em.setReadOnly(true); throw runtime_error(os.str()); } diff --git a/versioning/BRM/tablelockserver.cpp b/versioning/BRM/tablelockserver.cpp index 82235282..b29972e2 100644 --- a/versioning/BRM/tablelockserver.cpp +++ b/versioning/BRM/tablelockserver.cpp @@ -122,6 +122,7 @@ void TableLockServer::load() ostringstream os; os << "TableLockServer::load(): could not load save file " << filename << " loaded " << i << "/" << size << " entries\n"; + log(os.str(), logging::LOG_TYPE_WARNING); throw; } } @@ -150,6 +151,7 @@ void TableLockServer::load() os << "TableLockServer::load(): could not load save file " << filename << " loaded " << i << "/" << size << " entries\n"; + log(os.str(), logging::LOG_TYPE_WARNING); throw; } } diff --git a/versioning/BRM/workernode.rc b/versioning/BRM/workernode.rc index 0a23bdf6..488cb349 100644 --- a/versioning/BRM/workernode.rc +++ b/versioning/BRM/workernode.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB DBRM Worker Node" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "workernode" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "workernode.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/writeengine/bulk/cpimport.cpp b/writeengine/bulk/cpimport.cpp index 21b70a6f..c73efec3 100644 --- a/writeengine/bulk/cpimport.cpp +++ b/writeengine/bulk/cpimport.cpp @@ -159,7 +159,6 @@ void printUsage() " -I Binary import; binaryOpt 1-import NULL values" << endl << " 2-saturate NULL values" << endl << " -S Treat string truncations as errors" << endl << - " -D Disable timeout when waiting for table lock" << endl << " -L send *.err and *.bad (reject) files here" << endl << endl; cout << " Example1:" << endl << diff --git a/writeengine/bulk/cpimport.rc b/writeengine/bulk/cpimport.rc index c075f5c0..a322f3a5 100644 --- a/writeengine/bulk/cpimport.rc +++ b/writeengine/bulk/cpimport.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -70,12 +70,12 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "InfiniDB Bulk Loader" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "cpimport" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "cpimport.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/writeengine/bulk/we_tableinfo.cpp b/writeengine/bulk/we_tableinfo.cpp index 6eaf50ba..1fc1b9bf 100644 --- a/writeengine/bulk/we_tableinfo.cpp +++ b/writeengine/bulk/we_tableinfo.cpp @@ -548,6 +548,7 @@ int TableInfo::readTableData( ) its.rows_so_far.pop_back(); its.rows_so_far.push_back(fTotalReadRows); fQtc.postImportTele(its); + fQtc.waitForQueues(); return NO_ERROR; } diff --git a/writeengine/libwriteengine.rc b/writeengine/libwriteengine.rc index 9f2f8ad5..e7407ed1 100644 --- a/writeengine/libwriteengine.rc +++ b/writeengine/libwriteengine.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB Write Engine API" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "libwriteengine" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "libwriteengine.dll" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/writeengine/server/WriteEngineServer.rc b/writeengine/server/WriteEngineServer.rc index f3c867f8..ca488b40 100644 --- a/writeengine/server/WriteEngineServer.rc +++ b/writeengine/server/WriteEngineServer.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -71,12 +71,12 @@ BEGIN BEGIN VALUE "CompanyName", "InfiniDB, Inc." VALUE "FileDescription", "InfiniDB Write Engine Server" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "WriteEngineServer" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "WriteEngineServer.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/writeengine/shared/we_bulkrollbackmgr.cpp b/writeengine/shared/we_bulkrollbackmgr.cpp index e9753c52..2c41734e 100644 --- a/writeengine/shared/we_bulkrollbackmgr.cpp +++ b/writeengine/shared/we_bulkrollbackmgr.cpp @@ -1028,17 +1028,49 @@ void BulkRollbackMgr::deleteColumn2ExtentsV4 ( const char* inBuf ) logAMessage( logging::LOG_TYPE_INFO, logging::M0073, columnOID, msg0073Text.str() ); + // @bug 5644 - If user dropped all partitions in a dbroot, partNumHwm will + // be 0, but we may start importing into part# > 0 (to line up with other + // DBRoots). Use extent map to find first partition added by this import. + std::vector extEntries; + int rc = BRMWrapper::getInstance()->getExtents_dbroot( columnOID, + extEntries, dbRootHwm ); + if (rc != NO_ERROR) + { + WErrorCodes ec; + std::ostringstream oss; + oss << "Error getting extent list from extent map for " << + columnOID << + "; dbRoot-" << dbRootHwm << + "; " << ec.errorString(rc); + + throw WeException( oss.str(), ERR_BRM_BULK_RB_COLUMN ); + } + uint32_t part1 = partNumHwm; // lowest part# for column and DBRoot + if (extEntries.size() > 0) + { + part1 = extEntries[0].partitionNum; + for (unsigned int kk=0; kk refBulkRollbackFile(fileRestorer); @@ -1046,7 +1078,7 @@ void BulkRollbackMgr::deleteColumn2ExtentsV4 ( const char* inBuf ) // DMC-We should probably change this to build up a list of BRM changes, // and wait to make the call(s) to rollback the BRM changes "after" we // have restored the db files, and purged PrimProc FD and block cache. - int rc = BRMWrapper::getInstance()->rollbackColumnExtents_DBroot ( + rc = BRMWrapper::getInstance()->rollbackColumnExtents_DBroot ( columnOID, true, // true -> delete all extents (restore to empty DBRoot) (uint16_t)dbRootHwm, @@ -1224,6 +1256,40 @@ void BulkRollbackMgr::deleteDctnryExtentsV4 ( ) hwms.push_back( fPendingDctnryExtents[i].fHwm ); } + // @bug 5644 - If user dropped all partitions in a dbroot, fPartNum will + // be 0, but we may start importing into part# > 0 (to line up with other + // DBRoots). Use extent map to find first partition added by this import. + uint32_t part1 = fPendingDctnryExtents[0].fPartNum; // lowest part# for + // OID and DBRoot + if (hwms.size() == 0) // empty DBRoot case + { + std::vector extEntries; + int rc = BRMWrapper::getInstance()->getExtents_dbroot( + fPendingDctnryStoreOID, + extEntries, + fPendingDctnryStoreDbRoot ); + if (rc != NO_ERROR) + { + WErrorCodes ec; + std::ostringstream oss; + oss << "Error getting extent list from extent map for " << + fPendingDctnryStoreOID << + "; dbRoot-" << fPendingDctnryStoreDbRoot << + "; " << ec.errorString(rc); + + throw WeException( oss.str(), ERR_BRM_BULK_RB_COLUMN ); + } + if (extEntries.size() > 0) + { + part1 = extEntries[0].partitionNum; + for (unsigned int kk=0; kkrollbackDictStoreExtents_DBroot ( fPendingDctnryStoreOID, (uint16_t)fPendingDctnryStoreDbRoot, - fPendingDctnryExtents[0].fPartNum, + partNum, segNums, hwms ); if (rc != NO_ERROR) @@ -1261,7 +1332,7 @@ void BulkRollbackMgr::deleteDctnryExtentsV4 ( ) std::ostringstream oss; oss<< "Error rolling back dictionary extents from extent map for "<< fPendingDctnryStoreOID << - "; partNum-" << fPendingDctnryExtents[0].fPartNum << + "; partNum-" << partNum << "; " << ec.errorString(rc); throw WeException( oss.str(), ERR_BRM_BULK_RB_DCTNRY ); @@ -1274,7 +1345,6 @@ void BulkRollbackMgr::deleteDctnryExtentsV4 ( ) (ROWS_PER_EXTENT * COL_WIDTH)/BYTE_PER_BLOCK; uint32_t dbRoot = fPendingDctnryStoreDbRoot; - uint32_t partNum = fPendingDctnryExtents[0].fPartNum; std::string segFileListErrMsg; // Delete extents from the database files. diff --git a/writeengine/splitter/splitter.rc b/writeengine/splitter/splitter.rc index c48961a2..01784f0b 100644 --- a/writeengine/splitter/splitter.rc +++ b/writeengine/splitter/splitter.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,5,1,0 - PRODUCTVERSION 4,5,1,0 + FILEVERSION 4, 5, 0, 0 + PRODUCTVERSION 4, 5, 0, 0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -70,12 +70,12 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "InfiniDB Bulk Loader" - VALUE "FileVersion", "4.5.1-3" + VALUE "FileVersion", "4.5.0-0" VALUE "InternalName", "splitter" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "cpimport.exe" VALUE "ProductName", "InfiniDB" - VALUE "ProductVersion", "4.5.1-3 GA" + VALUE "ProductVersion", "4.5 Alpha" END END BLOCK "VarFileInfo" diff --git a/writeengine/splitter/we_brmupdater.cpp b/writeengine/splitter/we_brmupdater.cpp index ecb56c6f..818a8ebd 100644 --- a/writeengine/splitter/we_brmupdater.cpp +++ b/writeengine/splitter/we_brmupdater.cpp @@ -433,7 +433,7 @@ bool WEBrmUpdater::prepareHighWaterMarkInfo() //#ROWS: numRowsRead numRowsInserted bool WEBrmUpdater::prepareRowsInsertedInfo(std::string Entry, - int& TotRows, int& InsRows) + int64_t& TotRows, int64_t& InsRows) { bool aFound=false; //ROWS: 3 1 @@ -454,7 +454,7 @@ bool WEBrmUpdater::prepareRowsInsertedInfo(std::string Entry, pTok = strtok(NULL, " "); if (pTok) - TotRows = atoi(pTok); + TotRows = strtol(pTok, NULL, 10); else { //cout << "HWM Entry : " << aEntry << endl; throw(runtime_error("Bad Tot ROWS entry string")); @@ -462,7 +462,7 @@ bool WEBrmUpdater::prepareRowsInsertedInfo(std::string Entry, pTok = strtok(NULL, " "); if (pTok) - InsRows = atoi(pTok); + InsRows = strtol(pTok, NULL, 10); else { //cout << "HWM Entry : " << aEntry << endl; throw(runtime_error("Bad inserted ROWS in entry string")); diff --git a/writeengine/splitter/we_brmupdater.h b/writeengine/splitter/we_brmupdater.h index bec76ee3..a980a517 100644 --- a/writeengine/splitter/we_brmupdater.h +++ b/writeengine/splitter/we_brmupdater.h @@ -65,7 +65,8 @@ class WEBrmUpdater public: - static bool prepareRowsInsertedInfo(std::string Entry, int& TotRows, int& InsRows); + static bool prepareRowsInsertedInfo(std::string Entry, int64_t& TotRows, + int64_t& InsRows); static bool prepareColumnOutOfRangeInfo(std::string Entry, int& ColNum, CalpontSystemCatalog::ColDataType& ColType, std::string& ColName, int& OorValues); diff --git a/writeengine/splitter/we_sdhandler.cpp b/writeengine/splitter/we_sdhandler.cpp index a78d96fc..02e97ec8 100644 --- a/writeengine/splitter/we_sdhandler.cpp +++ b/writeengine/splitter/we_sdhandler.cpp @@ -1178,8 +1178,8 @@ void WESDHandler::onBrmReport(int PmId, messageqcpp::SBS& Sbs) { fWeSplClients[PmId]->setBrmRptRcvd(true); std::string aStr; - int aTotRows = 0; - int aInsRows = 0; + int64_t aTotRows = 0; + int64_t aInsRows = 0; int aColNum = 0; CalpontSystemCatalog::ColDataType aColType = CalpontSystemCatalog::INT; int aOorVal = 0; @@ -2357,6 +2357,7 @@ void WESDHandler::onHandlingSignal() fRef.fSignaled = false; bool aTblLockReleased = false; + bool aRollbackSuccess = false; onCpimportFail(0, true); usleep(2000000*fPmCount); @@ -2371,6 +2372,7 @@ void WESDHandler::onHandlingSignal() if(1==aStatus) { if (getDebugLvl()) cout << "Rollback Successful... " << endl; + aRollbackSuccess = true; break; } else if(-1 == aStatus) @@ -2381,6 +2383,15 @@ void WESDHandler::onHandlingSignal() usleep(2000000*fPmCount); } + //Bug 5774 - if rollback failed, leave the tablelock + if(!aRollbackSuccess) + { + std::stringstream aStrStr2a; + aStrStr2a << "Rollback Failed; Leaving Tablelock ... "; + fLog.logMsg( aStrStr2a.str(), MSGLVL_INFO1 ); + return; + } + std::stringstream aStrStr3; aStrStr3 << "Cleaning up .........."; fLog.logMsg( aStrStr3.str(), MSGLVL_INFO1 ); @@ -2397,7 +2408,7 @@ void WESDHandler::onHandlingSignal() usleep(2000000*fPmCount); } - if(!aTblLockReleased) + if((!aTblLockReleased) && (aRollbackSuccess)) { releaseTableLocks(); } diff --git a/writeengine/splitter/we_sdhandler.h b/writeengine/splitter/we_sdhandler.h index e2b87562..a5e22c1d 100644 --- a/writeengine/splitter/we_sdhandler.h +++ b/writeengine/splitter/we_sdhandler.h @@ -173,7 +173,7 @@ class WESDHandler { fWeSplClients[CIdx]->updateRowTx(RowCnt); } void resetRowTx(){ for (int aCnt = 1; aCnt <= fPmCount; aCnt++) {if (fWeSplClients[aCnt] != 0) {fWeSplClients[aCnt]->resetRowTx(); } } } - void setRowsUploadInfo(int PmId, int RowsRead, int RowsInserted) + void setRowsUploadInfo(int PmId, int64_t RowsRead, int64_t RowsInserted) { fWeSplClients[PmId]->setRowsUploadInfo(RowsRead, RowsInserted); } void add2ColOutOfRangeInfo(int PmId, int ColNum, CalpontSystemCatalog::ColDataType ColType, @@ -246,8 +246,8 @@ class WESDHandler ~WEImportRslt(){} public: void reset(){fRowsPro=0; fRowsIns=0; fTotTime=0; fColOorVec.clear();} - void updateRowsProcessed(int Rows){ fRowsPro+=Rows; } - void updateRowsInserted(int Rows){ fRowsIns+=Rows; } + void updateRowsProcessed(int64_t Rows){ fRowsPro+=Rows; } + void updateRowsInserted(int64_t Rows){ fRowsIns+=Rows; } void updateColOutOfRangeInfo(int aColNum, CalpontSystemCatalog::ColDataType aColType, std::string aColName, int aNoOfOors) { @@ -298,8 +298,8 @@ class WESDHandler } public: - int fRowsPro; //Rows processed - int fRowsIns; //Rows inserted + int64_t fRowsPro; //Rows processed + int64_t fRowsIns; //Rows inserted timeval fStartTime; //StartTime timeval fEndTime; //EndTime float fTotTime; //TotalTime diff --git a/writeengine/splitter/we_splclient.cpp b/writeengine/splitter/we_splclient.cpp index c788fbc2..57b6cbf0 100644 --- a/writeengine/splitter/we_splclient.cpp +++ b/writeengine/splitter/we_splclient.cpp @@ -420,7 +420,7 @@ void WESplClient::onDisconnect() //------------------------------------------------------------------------------ -void WESplClient::setRowsUploadInfo(int RowsRead, int RowsInserted) +void WESplClient::setRowsUploadInfo(int64_t RowsRead, int64_t RowsInserted) { fRowsUploadInfo.fRowsRead = RowsRead; fRowsUploadInfo.fRowsInserted = RowsInserted; diff --git a/writeengine/splitter/we_splclient.h b/writeengine/splitter/we_splclient.h index ccf32ce3..c096d572 100644 --- a/writeengine/splitter/we_splclient.h +++ b/writeengine/splitter/we_splclient.h @@ -269,15 +269,15 @@ class WESplClient WERowsUploadInfo():fRowsRead(0),fRowsInserted(0){} ~WERowsUploadInfo(){} public: - int fRowsRead; - int fRowsInserted; + int64_t fRowsRead; + int64_t fRowsInserted; }; WERowsUploadInfo fRowsUploadInfo; WEColOorVec fColOorVec; std::string fBadDataFile; std::string fErrInfoFile; - void setRowsUploadInfo(int RowsRead, int RowsInserted); + void setRowsUploadInfo(int64_t RowsRead, int64_t RowsInserted); void add2ColOutOfRangeInfo(int ColNum, CalpontSystemCatalog::ColDataType ColType, std::string& ColName, int NoOfOors); From 6c1475114020ecc006654ea329a126eb9a06f76c Mon Sep 17 00:00:00 2001 From: Bob Dempsey Date: Mon, 15 Sep 2014 14:59:54 -0500 Subject: [PATCH 2/3] 4.5.3-1 release --- README.md | 14 +- build/releasenum | 2 +- dbcon/ddlpackage/ddlpkg.h | 180 ++-- dbcon/ddlpackageproc/ddlpackageprocessor.cpp | 863 +----------------- dbcon/execplan/calpontselectexecutionplan.cpp | 78 +- dbcon/execplan/calpontselectexecutionplan.h | 29 +- dbcon/joblist/jlf_execplantojoblist.cpp | 318 +++++-- dbcon/joblist/jlf_execplantojoblist.h | 14 +- dbcon/joblist/jlf_subquery.cpp | 155 ++-- dbcon/joblist/jlf_subquery.h | 4 +- dbcon/joblist/jlf_tuplejoblist.cpp | 47 +- dbcon/joblist/joblistfactory.cpp | 8 +- dbcon/mysql/ha_from_sub.cpp | 16 +- ddlproc/DDLProc.vcxproj | 4 +- ddlproc/ddlprocessor.cpp | 159 +++- ddlproc/ddlprocessor.h | 6 +- exemgr/main.cpp | 64 +- tools/dbloadxml/colxml.cpp | 56 ++ utils/querytele/libquerytele.vcxproj | 4 + utils/rowgroup/rowaggregation.cpp | 4 +- utils/rowgroup/rowgroup.cpp | 2 +- versioning/BRM/vbbm.cpp | 100 +- versioning/BRM/vbbm.h | 48 +- versioning/BRM/vss.cpp | 302 +++--- versioning/BRM/vss.h | 52 +- writeengine/bulk/we_bulkloadbuffer.cpp | 47 +- writeengine/splitter/we_cmdargs.cpp | 62 +- writeengine/splitter/we_cmdargs.h | 6 +- 28 files changed, 1208 insertions(+), 1436 deletions(-) diff --git a/README.md b/README.md index cdd161ef..89c337a1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# This is InfiniDB 4.5.2 +# This is InfiniDB 4.5.3 ## Build prerequisites To build InfiniDB from source you will need: @@ -22,9 +22,9 @@ Along with a working C++ compiler and GNU software development tools you will ne ### InfiniDB MySQL - wget -Omysql-4.5.2-1.tar.gz https://github.com/infinidb/mysql/archive/4.5.2-1.tar.gz - tar -zxf mysql-4.5.2-1.tar.gz - ln -s mysql-4.5.2-1 mysql + wget -Omysql-4.5.3-1.tar.gz https://github.com/infinidb/mysql/archive/4.5.3-1.tar.gz + tar -zxf mysql-4.5.3-1.tar.gz + ln -s mysql-4.5.3-1 mysql cd mysql ./configure --prefix=$HOME/infinidb/mysql make @@ -33,9 +33,9 @@ Along with a working C++ compiler and GNU software development tools you will ne ### InfiniDB cd .. - wget -Oinfinidb-4.5.2-1.tar.gz https://github.com/infinidb/infinidb/archive/4.5.2-1.tar.gz - tar -zxf infinidb-4.5.2-1.tar.gz - ln -s infinidb-4.5.2-1 infinidb + wget -Oinfinidb-4.5.3-1.tar.gz https://github.com/infinidb/infinidb/archive/4.5.3-1.tar.gz + tar -zxf infinidb-4.5.3-1.tar.gz + ln -s infinidb-4.5.3-1 infinidb cd infinidb ./configure --prefix=$HOME/infinidb make diff --git a/build/releasenum b/build/releasenum index 90bb05b1..e43b061a 100644 --- a/build/releasenum +++ b/build/releasenum @@ -1,5 +1,5 @@ # $Id: releasenum 1851 2013-03-22 20:48:04Z dhill $ -version=4.5.2 +version=4.5.3 release=1 diff --git a/dbcon/ddlpackage/ddlpkg.h b/dbcon/ddlpackage/ddlpkg.h index 7381245d..56a804b5 100644 --- a/dbcon/ddlpackage/ddlpkg.h +++ b/dbcon/ddlpackage/ddlpkg.h @@ -65,7 +65,6 @@ struct ColumnDef; struct ColumnDefaultValue; struct ColumnType; struct QualifiedName; -struct TableDef; struct CreateTableStatement; struct SqlStatementList; struct SqlStatement; @@ -73,6 +72,7 @@ struct ColumnConstraintDef; struct TableConstraintDef; struct SchemaObject; struct ReferentialAction; +struct TableDef; typedef SqlStatement DDLPkg; @@ -475,6 +475,78 @@ struct SqlStatementList +/** @brief Stores catalog, schema, object names. + * + * ddl.y does not yet support catalog. So, expect catalog + * qualified names to fail parsing for the moment. + */ +struct QualifiedName +{ + /** @brief Deserialize from ByteStream */ + EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); + + /** @brief Serialize to ByteStream */ + EXPORT virtual int serialize(messageqcpp::ByteStream& bs); + + + QualifiedName() + {} + + EXPORT QualifiedName(const char* name); + EXPORT QualifiedName(const char* name, const char* schema); + EXPORT QualifiedName(const char* name, const char* schema, const char* catalog); + + virtual ~QualifiedName() + {} + + std::string fCatalog; + std::string fName; + std::string fSchema; +}; + + + +/** TableDef represents a table definition. + */ +struct TableDef : public SchemaObject +{ + /** @brief Deserialize from ByteStream */ + EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); + + /** @brief Serialize to ByteStream */ + EXPORT virtual int serialize(messageqcpp::ByteStream& bs); + + + TableDef() : fQualifiedName(0) + {} + + EXPORT TableDef(QualifiedName* name, TableElementList* elements, TableOptionMap* options); + + /** @brief TableDef ctor. + * ctor + */ + TableDef( QualifiedName *name, + ColumnDefList columns, + TableConstraintDefList constraints, int tableWithAutoinc) : + fQualifiedName (name), + fColumns (columns), + fConstraints (constraints) + + + {} + + EXPORT virtual ~TableDef(); + + QualifiedName* fQualifiedName; + + ColumnDefList fColumns; + TableConstraintDefList fConstraints; + + TableOptionMap fOptions; +}; + + + /** @brief Represents the create table statement * * @note It takes possession of the TableDef given to it. @@ -499,6 +571,12 @@ struct CreateTableStatement : public SqlStatement /** @brief Dump to stdout. */ EXPORT virtual std::ostream& put(std::ostream& os) const; + std::string schemaName() const + { + if (!fTableDef || !fTableDef->fQualifiedName) return "UNKNOWN"; + return fTableDef->fQualifiedName->fSchema; + } + TableDef* fTableDef; ///< The table defintion. }; @@ -899,11 +977,6 @@ struct ColumnType EXPORT ColumnType(int type); - /** @brief This constructor is used by Dharma interface to - create a ColumnType object easily */ - - //EXPORT ColumnType(int type, int length, int precision, int scale, int compressiontype, const char* autoIncrement, int64_t nextValue, bool withTimezone = false); - virtual ~ColumnType() {} @@ -1029,7 +1102,7 @@ struct ColumnDef : public SchemaObject ColumnDefaultValue *defaultValue, const char * comment=NULL); /** @brief ColumnDef ctor. - * Convenient ctor for Dharma use */ + * ctor */ ColumnDef(const char *name, ColumnType* type, ColumnConstraintList constraints, @@ -1249,78 +1322,6 @@ struct TableCheckConstraintDef : public TableConstraintDef -/** TableDef represents a table definition. - */ -struct TableDef : public SchemaObject -{ - /** @brief Deserialize from ByteStream */ - EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); - - /** @brief Serialize to ByteStream */ - EXPORT virtual int serialize(messageqcpp::ByteStream& bs); - - - TableDef() : fQualifiedName(0) - {} - - EXPORT TableDef(QualifiedName* name, TableElementList* elements, TableOptionMap* options); - - /** @brief TableDef ctor. - * Convenient ctor for Dharma use - */ - TableDef( QualifiedName *name, - ColumnDefList columns, - TableConstraintDefList constraints, int tableWithAutoinc) : - fQualifiedName (name), - fColumns (columns), - fConstraints (constraints) - - - {} - - EXPORT virtual ~TableDef(); - - QualifiedName* fQualifiedName; - - ColumnDefList fColumns; - TableConstraintDefList fConstraints; - - TableOptionMap fOptions; -}; - - - -/** @brief Stores catalog, schema, object names. - * - * ddl.y does not yet support catalog. So, expect catalog - * qualified names to fail parsing for the moment. - */ -struct QualifiedName -{ - /** @brief Deserialize from ByteStream */ - EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); - - /** @brief Serialize to ByteStream */ - EXPORT virtual int serialize(messageqcpp::ByteStream& bs); - - - QualifiedName() - {} - - EXPORT QualifiedName(const char* name); - EXPORT QualifiedName(const char* name, const char* schema); - EXPORT QualifiedName(const char* name, const char* schema, const char* catalog); - - virtual ~QualifiedName() - {} - - std::string fCatalog; - std::string fName; - std::string fSchema; -}; - - - /** @brief Represents the alter table command. * * All forms of alter_table_statements are represented as @@ -1347,6 +1348,12 @@ struct AlterTableStatement : public SqlStatement /** @brief Delete members. */ EXPORT virtual ~AlterTableStatement(); + std::string schemaName() const + { + if (!fTableName) return "UNKNOWN"; + return fTableName->fSchema; + } + QualifiedName* fTableName; AlterTableActionList fActions; }; @@ -1457,6 +1464,13 @@ struct DropTableStatement : public SqlStatement { delete fTableName; } + + std::string schemaName() const + { + if (!fTableName) return "UNKNOWN"; + return fTableName->fSchema; + } + QualifiedName *fTableName; bool fCascade; }; @@ -1483,8 +1497,16 @@ struct TruncTableStatement : public SqlStatement { delete fTableName; } + + std::string schemaName() const + { + if (!fTableName) return "UNKNOWN"; + return fTableName->fSchema; + } + QualifiedName *fTableName; }; + /** @brief Represents the mark partition out of service statement * */ diff --git a/dbcon/ddlpackageproc/ddlpackageprocessor.cpp b/dbcon/ddlpackageproc/ddlpackageprocessor.cpp index 5d64ad47..8e95fd22 100644 --- a/dbcon/ddlpackageproc/ddlpackageprocessor.cpp +++ b/dbcon/ddlpackageproc/ddlpackageprocessor.cpp @@ -702,861 +702,6 @@ boost::any DDLPackageProcessor::tokenizeData(execplan::CalpontSystemCatalog::SCN return value; } -#if 0 -void DDLPackageProcessor::writeSysTableMetaData(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, const DDLResult& result, - ddlpackage::TableDef& tableDef, uint32_t tableWithAutoi) -{ - std::string err("DDLPackageProcessor::writeSysTableMetaData "); - SUMMARY_INFO(err); - - if (result.result != NO_ERROR) - return; - - WriteEngine::ColTuple colTuple; - WriteEngine::ColStruct colStruct; - WriteEngine::ColStructList colStructs; - WriteEngine::ColTupleList colTuples; - WriteEngine::dictStr dctColTuples; - WriteEngine::DctnryStruct dctnryStruct; - WriteEngine::ColValueList colValuesList; - WriteEngine::DctnryStructList dctnryStructList; - WriteEngine::DictStrList dctnryValueList; - WriteEngine::RIDList ridList; - CalpontSystemCatalog::TableName tableName; - CalpontSystemCatalog::ROPair sysTableROPair; - boost::shared_ptr systemCatalogPtr; - ColumnList columns; - ColumnList::const_iterator column_iterator; - DDLColumn column; - int error = 0; - - tableName.schema = CALPONT_SCHEMA; - tableName.table = SYSTABLE_TABLE; - - systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID); - - try - { - sysTableROPair = systemCatalogPtr->tableRID(tableName); - - getColumnsForTable(sessionID, tableName.schema,tableName.table, columns); - - column_iterator = columns.begin(); - std::string tmpStr(""); - while (column_iterator != columns.end()) - { - - column = *column_iterator; - boost::to_lower(column.tableColName.column); - - if (TABLENAME_COL == column.tableColName.column) - { - std::string tablename = tableDef.fQualifiedName->fName; - boost::to_lower(tablename); - colTuple.data = tablename; - tmpStr = tablename; - } - else if (SCHEMA_COL == column.tableColName.column) - { - std::string schema = tableDef.fQualifiedName->fSchema; - boost::to_lower(schema); - colTuple.data = schema; - tmpStr = schema; - } - else if (OBJECTID_COL == column.tableColName.column) - { - colTuple.data = fTableOID; - } - else if (CREATEDATE_COL == column.tableColName.column) - { - date d(day_clock::universal_day()); - std::string date = to_iso_string(d); - Date aDay; - int intvalue; - std::string s = date.substr(0, 4); - if (from_string(intvalue, s, std::dec)) - { - aDay.year = intvalue; - } - s = date.substr(4, 2); - if (from_string(intvalue, s, std::dec)) - { - aDay.month = intvalue; - } - s = date.substr(6, 2); - if (from_string(intvalue, s, std::dec)) - { - aDay.day = intvalue; - } - - colTuple.data = *(reinterpret_cast (&aDay)); - - } - else if (INIT_COL == column.tableColName.column) - { - TableOptionMap::const_iterator options_iter = tableDef.fOptions.find("initial"); - if (options_iter != tableDef.fOptions.end()) - { - colTuple.data = options_iter->second; - } - else - { - colTuple.data = getNullValueForType(column.colType); - } - } - else if (NEXT_COL == column.tableColName.column) - { - TableOptionMap::const_iterator options_iter = tableDef.fOptions.find("next"); - if (options_iter != tableDef.fOptions.end()) - { - colTuple.data = options_iter->second; - } - else - { - colTuple.data = getNullValueForType(column.colType); - } - } - else if (AUTOINC_COL == column.tableColName.column) - { - colTuple.data = tableWithAutoi; - } - else - { - colTuple.data = getNullValueForType(column.colType); - } - - colStruct.dataOid = column.oid; - colStruct.colWidth = column.colType.colWidth > 8 ? 8 : column.colType.colWidth; - colStruct.tokenFlag = false; - colStruct.tokenFlag = column.colType.colWidth > 8 ? true : false; - colStruct.colDataType = column.colType.colDataType; - if (colStruct.tokenFlag) - { - dctnryStruct.dctnryOid = column.colType.ddn.dictOID; - dctnryStruct.columnOid = column.oid; - } - else - { - dctnryStruct.dctnryOid = 0; - dctnryStruct.columnOid = column.oid; - } - - colStructs.push_back(colStruct); - - colTuples.push_back(colTuple); - - dctColTuples.push_back (tmpStr); - - colValuesList.push_back(colTuples); - - dctnryStructList.push_back (dctnryStruct); - - dctnryValueList.push_back (dctColTuples); - - - colTuples.pop_back(); - dctColTuples.pop_back(); - - ++column_iterator; - } - //fWriteEngine.setDebugLevel(WriteEngine::DEBUG_3); - if (0 != colStructs.size()) - { - error = fWriteEngine.insertColumnRec_SYS(txnID, colStructs, colValuesList, - dctnryStructList, dctnryValueList); - - if (error != WriteEngine::NO_ERROR) - { - if (error == ERR_BRM_WR_VB_ENTRY) - { - throw std::runtime_error("WE: Error writing to BRM."); - } - else - { - WErrorCodes ec; - throw std::runtime_error("WE: Error updating calpont.systable:" + ec.errorString(error)); - } - } - } - } - catch (std::exception& ex) - { - err += ex.what(); - throw std::runtime_error(err); - } - catch (...) - { - err += "Unknown exception caught"; - throw std::runtime_error(err); - } -} - -void DDLPackageProcessor::writeSysColumnMetaData(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, const DDLResult& result, - ColumnDefList& tableDefCols, ddlpackage::QualifiedName& qualifiedName, - int colpos, bool alterFlag) -{ - std::string err("DDLPackageProcessor::writeSysColumnMetaData "); - SUMMARY_INFO(err); - - if (result.result != NO_ERROR) - return; - - WriteEngine::ColStruct colStruct; - WriteEngine::ColTuple colTuple; - WriteEngine::ColStructList colStructs; - WriteEngine::ColTupleList colTuples; - WriteEngine::DctColTupleList dctColTuples; - WriteEngine::ColValueList colValuesList; - WriteEngine::RIDList ridList; - WriteEngine::DctnryStruct dctnryStruct; - WriteEngine::dictStr dctnryTuple; - WriteEngine::DctnryStructList dctnryStructList; - WriteEngine::DictStrList dctnryValueList; - - CalpontSystemCatalog::TableName tableName; - - ColumnList columns; - ColumnList::const_iterator column_iterator; - ColumnDef* colDefPtr = 0; - ColumnDefList::const_iterator iter; - DDLColumn column; - int error = 0; - int startPos = colpos; - - tableName.schema = CALPONT_SCHEMA; - tableName.table = SYSCOLUMN_TABLE; - - getColumnsForTable(sessionID, tableName.schema,tableName.table, columns); - unsigned int numCols = columns.size(); - //WriteEngine::ColTupleList colList[numCols]; - //ColTupleList is NOT POD, so let's try this: - std::vector colList; - //WriteEngine::dictStr dctColList[numCols]; - std::vector dctColList; - iter = tableDefCols.begin(); - //colpos = 0; - std::string tmpStr(""); - for (unsigned int ii = 0; ii < numCols; ii++) - { - colList.push_back(WriteEngine::ColTupleList()); - dctColList.push_back(WriteEngine::dictStr()); - } - try - { - while (iter != tableDefCols.end()) - { - colDefPtr = *iter; - - DictOID dictOID; - - - CalpontSystemCatalog::ColDataType dataType; - dataType = convertDataType(colDefPtr->fType->fType); - if (dataType == CalpontSystemCatalog::DECIMAL || - dataType == CalpontSystemCatalog::UDECIMAL) - { - if (colDefPtr->fType->fPrecision < colDefPtr->fType->fScale) - { - ostringstream os; - os << "Syntax error: scale should be less than precision, precision: " << colDefPtr->fType->fPrecision << " scale: " << colDefPtr->fType->fScale; - throw std::runtime_error(os.str()); - -/* logging::Message::Args args; - logging::Message message(9); - result.result = CREATE_ERROR; - - args.add("Syntax error: "); - args.add("scale should be less than precision"); - message.format(args); - result.message = message; - return;*/ - } - } - if (dataType == CalpontSystemCatalog::DECIMAL || - dataType == CalpontSystemCatalog::UDECIMAL) - { - colDefPtr->convertDecimal(); - } - - bool hasDict = false; - if ( (dataType == CalpontSystemCatalog::CHAR && colDefPtr->fType->fLength > 8) || - (dataType == CalpontSystemCatalog::VARCHAR && colDefPtr->fType->fLength > 7) || - (dataType == CalpontSystemCatalog::VARBINARY && colDefPtr->fType->fLength > 7) ) - { - hasDict = true; - dictOID.compressionType = colDefPtr->fType->fCompressiontype; - dictOID.colWidth = colDefPtr->fType->fLength; - - //@Bug 2534. Take away the limit of 255 and set the limit to 8000. - if (colDefPtr->fType->fLength > 8000) - { - ostringstream os; - os << "char, varchar and varbinary length may not exceed 8000"; - throw std::runtime_error(os.str()); - } - } - else if (dataType == CalpontSystemCatalog::VARBINARY && colDefPtr->fType->fLength <= 7) - { - ostringstream os; - os << "varbinary length may not be less than 8"; - throw std::runtime_error(os.str()); - } - - - if (hasDict) - { - execplan::ObjectIDManager fObjectIDManager; - int startOID = fObjectIDManager.allocOIDs(1); - dictOID.dictOID = startOID; - dictOID.listOID = 0; - dictOID.treeOID = 0; - - fDictionaryOIDList.push_back(dictOID); - } - unsigned int i = 0; - column_iterator = columns.begin(); - while (column_iterator != columns.end()) - { - column = *column_iterator; - boost::to_lower(column.tableColName.column); - - if (SCHEMA_COL == column.tableColName.column) - { - boost::to_lower(qualifiedName.fSchema); - colTuple.data = qualifiedName.fSchema; - tmpStr = qualifiedName.fSchema; - } - else if (TABLENAME_COL == column.tableColName.column) - { - boost::to_lower(qualifiedName.fName); - colTuple.data = qualifiedName.fName; - tmpStr = qualifiedName.fName; - } - else if (COLNAME_COL == column.tableColName.column) - { - boost::to_lower(colDefPtr->fName); - colTuple.data = colDefPtr->fName; - tmpStr = colDefPtr->fName; - } - else if (OBJECTID_COL == column.tableColName.column) - { - if (alterFlag) - colTuple.data = fStartingColOID; - else - colTuple.data = fStartingColOID + colpos; - } - else if (DATATYPE_COL == column.tableColName.column) - { - colTuple.data = dataType; - } - else if (COLUMNLEN_COL == column.tableColName.column) - { - //@Bug 2089 Disallow zero length char and varch column to be created - if (dataType == CalpontSystemCatalog::CHAR || - dataType == CalpontSystemCatalog::VARCHAR || - dataType == CalpontSystemCatalog::VARBINARY) - { - if (colDefPtr->fType->fLength <= 0) - { - ostringstream os; - os << "char, varchar and varbinary length must be greater than zero"; - throw std::runtime_error(os.str()); - } - } - colTuple.data = colDefPtr->fType->fLength; - } - else if (COLUMNPOS_COL == column.tableColName.column) - { - colTuple.data = colpos; - } - else if (DEFAULTVAL_COL == column.tableColName.column) - { - if (colDefPtr->fDefaultValue) - { - colTuple.data = colDefPtr->fDefaultValue->fValue; - tmpStr = colDefPtr->fDefaultValue->fValue; - } - else - { - tmpStr=""; - //colTuple.data = getNullValueForType(column.colType); - } - - } - else if (NULLABLE_COL == column.tableColName.column) - { - int nullable = 1; - ColumnConstraintList& colConstraints = colDefPtr->fConstraints; - ColumnConstraintList::const_iterator constraint_iter = colConstraints.begin(); - while (constraint_iter != colConstraints.end()) - { - ColumnConstraintDef* consDefPtr = *constraint_iter; - if (consDefPtr->fConstraintType == ddlpackage::DDL_NOT_NULL) - { - nullable = 0; - break; - } - ++constraint_iter; - } - colTuple.data = nullable; - } - else if (SCALE_COL == column.tableColName.column) - { - colTuple.data = colDefPtr->fType->fScale; - } - else if (PRECISION_COL == column.tableColName.column) - { - colTuple.data = colDefPtr->fType->fPrecision; - } - else if (DICTOID_COL == column.tableColName.column) - { - if (hasDict) - { - colTuple.data = dictOID.dictOID; - } - else - { - colTuple.data = getNullValueForType(column.colType); - } - } - else if (LISTOBJID_COL == column.tableColName.column) - { - colTuple.data = getNullValueForType(column.colType); - } - else if (TREEOBJID_COL == column.tableColName.column) - { - colTuple.data = getNullValueForType(column.colType); - } - else if (MINVAL_COL == column.tableColName.column) - { - tmpStr=""; - } - else if (MAXVAL_COL == column.tableColName.column) - { - tmpStr=""; - } - else if (COMPRESSIONTYPE_COL == column.tableColName.column) - { - colTuple.data = colDefPtr->fType->fCompressiontype; - } - else if (AUTOINC_COL == column.tableColName.column) - { - //cout << "autoincrement= " << colDefPtr->fType->fAutoincrement << endl; - colTuple.data = colDefPtr->fType->fAutoincrement; - - } - else if (NEXTVALUE_COL == column.tableColName.column) - { - colTuple.data = colDefPtr->fType->fNextvalue; - } - else - { - colTuple.data = getNullValueForType(column.colType); - } - - colStruct.dataOid = column.oid; - colStruct.colWidth = column.colType.colWidth > 8 ? 8 : column.colType.colWidth; - colStruct.tokenFlag = false; - colStruct.tokenFlag = column.colType.colWidth > 8 ? true : false; - colStruct.colDataType = column.colType.colDataType; - - if (colStruct.tokenFlag) - { - dctnryStruct.dctnryOid = column.colType.ddn.dictOID; - dctnryStruct.columnOid = column.oid; - } - else - { - dctnryStruct.dctnryOid = 0; - dctnryStruct.columnOid = column.oid; - } - - - if (colpos == startPos) - { - colStructs.push_back(colStruct); - dctnryStructList.push_back (dctnryStruct); - } - colList[i].push_back(colTuple); - //colList.push_back(WriteEngine::ColTupleList()); - //colList.back().push_back(colTuple); - dctColList[i].push_back(tmpStr); - //dctColList.push_back(WriteEngine::dictStr()); - //dctColList.back().push_back(tmpStr); - ++i; - ++column_iterator; - } - - ++colpos; - ++iter; - } - - idbassert(colList.size() >= numCols); - idbassert(dctColList.size() >= numCols); - - if (0 != colStructs.size()) - { - //FIXME: Is there a cleaner way to do this? Isn't colValuesList the same as colList after this? - for (unsigned int n = 0; n < numCols; n++) - { - colValuesList.push_back(colList[n]); - dctnryValueList.push_back(dctColList[n]); - } - //fWriteEngine.setDebugLevel(WriteEngine::DEBUG_3); - error = fWriteEngine.insertColumnRec_SYS(txnID, colStructs, colValuesList, - dctnryStructList, dctnryValueList); - - if (error != WriteEngine::NO_ERROR) - { - if (error == ERR_BRM_WR_VB_ENTRY) - { - throw std::runtime_error( - "writeSysColumnMetaData WE: Error writing to BRM."); - } - else - { - WErrorCodes ec; - throw std::runtime_error( - "WE: Error updating calpontsys.syscolumn. " + ec.errorString(error)); - } - } - } - - } - catch (std::exception& ex) - { - err += ex.what(); - throw std::runtime_error(err); - } - catch (...) - { - err += "Unknown exception caught"; - throw std::runtime_error(err); - } -} - -void DDLPackageProcessor::removeSysTableMetaData(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, - ddlpackage::QualifiedName& tableName) -{ - - SUMMARY_INFO("DDLPackageProcessor::removeSysTableMetaData"); - - if (result.result != NO_ERROR) - return; - std::string err; - ddlpackage::QualifiedName sysCatalogTableName; - sysCatalogTableName.fSchema = CALPONT_SCHEMA; - sysCatalogTableName.fName = SYSTABLE_TABLE; - - CalpontSystemCatalog::TableName userTableName; - userTableName.schema = tableName.fSchema; - userTableName.table = tableName.fName; - - boost::shared_ptr systemCatalogPtr; - systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID); - systemCatalogPtr->identity(CalpontSystemCatalog::EC); - try - { - CalpontSystemCatalog::ROPair userTableROPair = systemCatalogPtr->tableRID(userTableName); - if (userTableROPair.rid == std::numeric_limits::max()) - { - err = "RowID is not valid "; - throw std::runtime_error(err); - } - // cout << "RID for table " << userTableName.schema << "." << userTableName.table << " = " << userTableROPair.rid << endl; - removeRowFromSysCatalog(sessionID, txnID, result, sysCatalogTableName, userTableROPair.rid); - } - catch (std::exception& ex) - { - err = ex.what(); - throw std::runtime_error(err); - } - catch (...) - { - err = "Unknown exception caught"; - throw std::runtime_error(err); - } -} - -void DDLPackageProcessor::removeSysColMetaData(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, - ddlpackage::QualifiedName& tableName) -{ - SUMMARY_INFO("DDLPackageProcessor::removeSysColMetaData"); - - if (result.result != NO_ERROR) - return; - - ddlpackage::QualifiedName sysCatalogTableName; - sysCatalogTableName.fSchema = CALPONT_SCHEMA; - sysCatalogTableName.fName = SYSCOLUMN_TABLE; - - CalpontSystemCatalog::TableName userTableName; - userTableName.schema = tableName.fSchema; - userTableName.table = tableName.fName; - - boost::shared_ptr systemCatalogPtr; - systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID); - systemCatalogPtr->identity(CalpontSystemCatalog::EC); - std::string err; - try - { - execplan::CalpontSystemCatalog::RIDList colRidList = systemCatalogPtr->columnRIDs(userTableName); - - removeRowsFromSysCatalog(sessionID, txnID, result, sysCatalogTableName, colRidList); - } - catch (std::exception& ex) - { - err = ex.what(); - throw std::runtime_error(err); - } - catch (...) - { - err = "Unknown exception caught"; - throw std::runtime_error(err); - } - -} - -void DDLPackageProcessor::removeColSysColMetaData(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - DDLResult& result, - ddlpackage::QualifiedName& columnInfo) -{ - SUMMARY_INFO("DDLPackageProcessor::removeColSysColMetaData"); - - if (result.result != NO_ERROR) - return; - - ddlpackage::QualifiedName sysCatalogTableName; - sysCatalogTableName.fSchema = CALPONT_SCHEMA; - sysCatalogTableName.fName = SYSCOLUMN_TABLE; - - CalpontSystemCatalog::TableColName userColName; - userColName.schema = columnInfo.fSchema; - userColName.table = columnInfo.fCatalog; - userColName.column = columnInfo.fName; - - boost::shared_ptr systemCatalogPtr; - systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID); - systemCatalogPtr->identity(CalpontSystemCatalog::EC); - std::string err; - try - { - execplan::CalpontSystemCatalog::ROPair colRO = systemCatalogPtr->columnRID(userColName); - execplan::CalpontSystemCatalog::RIDList colRidList; - colRidList.push_back(colRO); - removeRowsFromSysCatalog(sessionID, txnID, result, sysCatalogTableName, colRidList); - } - catch (std::exception& ex) - { - err = ex.what(); - throw std::runtime_error(err); - } - catch (...) - { - err = "Unknown exception caught"; - throw std::runtime_error(err); - } -} - -void DDLPackageProcessor::removeRowFromSysCatalog(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - const DDLResult& result, - ddlpackage::QualifiedName& sysCatalogTableName, - WriteEngine::RID& rid) -{ - - SUMMARY_INFO("DDLPackageProcessor::removeRowFromSysCatalog"); - - if (result.result != NO_ERROR) - return; - - CalpontSystemCatalog::RIDList colRidList; - CalpontSystemCatalog::ROPair roPair; - std::string err; - roPair.objnum = 0; - roPair.rid = rid; - colRidList.push_back(roPair); - try - { - removeRowsFromSysCatalog(sessionID, txnID, result,sysCatalogTableName,colRidList); - } - catch (std::exception& ex) - { - err = ex.what(); - throw std::runtime_error(err); - } - catch (...) - { - err = "Unknown exception caught"; - throw std::runtime_error(err); - } - -} - -void DDLPackageProcessor::removeRowsFromSysCatalog(uint32_t sessionID, execplan::CalpontSystemCatalog::SCN txnID, - const DDLResult& result, - ddlpackage::QualifiedName& sysCatalogTableName, - execplan::CalpontSystemCatalog::RIDList& colRidList) -{ - - SUMMARY_INFO("DDLPackageProcessor::removeRowsFromSysCatalog"); - - if (result.result != NO_ERROR) - return; - - WriteEngine::ColStruct colStruct; - WriteEngine::ColStructList colStructs; - std::vector colExtentsStruct; - std::vector colValuesList; - WriteEngine::RIDList ridList; - std::vector ridLists; - DDLColumn column; - - execplan::CalpontSystemCatalog::RIDList::const_iterator colrid_iterator = colRidList.begin(); - while (colrid_iterator != colRidList.end()) - { - WriteEngine::RID rid = (*colrid_iterator).rid; - ridList.push_back(rid); - ++colrid_iterator; - } - - ColumnList columns; - getColumnsForTable(sessionID, sysCatalogTableName.fSchema, sysCatalogTableName.fName, columns); - - ColumnList::const_iterator column_iterator = columns.begin(); - while (column_iterator != columns.end()) - { - column = *column_iterator; - colStruct.dataOid = column.oid; - colStruct.colWidth = column.colType.colWidth > 8 ? 8 : column.colType.colWidth; - colStruct.colDataType = column.colType.colDataType; - - colStructs.push_back(colStruct); - - ++column_iterator; - } - colExtentsStruct.push_back(colStructs); - ridLists.push_back(ridList); - std::string err; - try - { - if (0 != colStructs.size() && 0 != ridLists[0].size()) - { - int error = fWriteEngine.deleteRow(txnID, colExtentsStruct, colValuesList, ridLists); - if (error != WriteEngine::NO_ERROR) - { - err = "WE:Error removing rows from " + sysCatalogTableName.fName ; - throw std::runtime_error(err); - } - } - } - catch (std::exception& ex) - { - err = ex.what(); - throw std::runtime_error(err); - } - catch (...) - { - err = "Unknown exception caught"; - throw std::runtime_error(err); - } - -} - -void DDLPackageProcessor::createDictionaryFiles(execplan::CalpontSystemCatalog::SCN txnID, const DDLResult& result, const int useDBRoot) -{ - std::string err("DDLPackageProcessor::createDictionaryFiles "); - SUMMARY_INFO(err); - - if (result.result != NO_ERROR) - return; - - int error = NO_ERROR; - - DictionaryOIDList::const_iterator iter = fDictionaryOIDList.begin(); - try - { - while (iter != fDictionaryOIDList.end()) - { - DictOID dictOID = *iter; - error = fWriteEngine.createDctnry(txnID, dictOID.dictOID, - dictOID.colWidth, useDBRoot, 0, 0, dictOID.compressionType); - if (error != WriteEngine::NO_ERROR) - { - WErrorCodes ec; - ostringstream oss; - oss << "WE: Error creating dictionary file for oid " << dictOID.dictOID - << "; " << ec.errorString(error) << endl; - throw std::runtime_error (oss.str()); - } - ++iter; - } - } - catch (std::exception& ex) - { - err += ex.what(); - throw std::runtime_error(err); - } - catch (...) - { - err += "Unknown exception caught"; - throw std::runtime_error(err); - } - -} - - -void DDLPackageProcessor::createColumnFiles(execplan::CalpontSystemCatalog::SCN txnID, - const DDLResult& result, - ddlpackage::ColumnDefList& tableDefCols, - const int useDBRoot, const uint32_t partitionNum) -{ - std::string err("DDLPackageProcessor::createColumnFiles "); - SUMMARY_INFO(err); - - if (result.result != NO_ERROR) - return; - - //ColumnDefList& tableDefCols = tableDef.fColumns; - ColumnDefList::const_iterator iter = tableDefCols.begin(); - int colpos = 0, error = NO_ERROR; - ColumnDef* colDefPtr; - try - { - while (iter != tableDefCols.end()) - { - colDefPtr = *iter; - - CalpontSystemCatalog::ColDataType dataType = convertDataType(colDefPtr->fType->fType); - - error = fWriteEngine.createColumn(txnID, fStartingColOID + colpos, dataType, - colDefPtr->fType->fLength, useDBRoot, partitionNum, - colDefPtr->fType->fCompressiontype); - - if (error != WriteEngine::NO_ERROR) - { - WErrorCodes ec; - ostringstream oss; - oss << "WE: Error creating column file for oid " << (fStartingColOID + colpos) << "; " << ec.errorString(error) << endl; - throw std::runtime_error (oss.str()); - } - ++colpos; - ++iter; - } - } - catch (std::exception& ex) - { - err += ex.what(); - throw std::runtime_error(err); - } - catch (...) - { - err += "Unknown exception caught"; - throw std::runtime_error(err); - } -} -#endif void DDLPackageProcessor::flushPrimprocCache(std::vector& oidList) { SUMMARY_INFO("DDLPackageProcessor::flushPrimprocCache"); @@ -1598,12 +743,8 @@ void DDLPackageProcessor::flushPrimprocCache(std::vectorSELECT " ; - if (cep.distinct()) + if (distinct()) output << "DISTINCT "; - output << "limit: " << cep.limitStart() << " - " << cep.limitNum() << endl; + output << "limit: " << limitStart() << " - " << limitNum() << endl; - switch (cep.location()) + switch (location()) { case CalpontSelectExecutionPlan::MAIN: output << "MAIN" << endl; @@ -212,7 +214,7 @@ ostream &operator<< (ostream &output, const CalpontSelectExecutionPlan &cep) } // Returned Column - CalpontSelectExecutionPlan::ReturnedColumnList retCols = cep.returnedCols(); + CalpontSelectExecutionPlan::ReturnedColumnList retCols = returnedCols(); output << ">>Returned Columns" << endl; uint32_t seq = 0; for (unsigned int i = 0; i < retCols.size(); i++) @@ -221,14 +223,14 @@ ostream &operator<< (ostream &output, const CalpontSelectExecutionPlan &cep) if (retCols[i]->colSource() & SELECT_SUB) { output << "select sub -- " << endl; - CalpontSelectExecutionPlan *plan = dynamic_cast(cep.fSelectSubList[seq++].get()); + CalpontSelectExecutionPlan *plan = dynamic_cast(fSelectSubList[seq++].get()); if (plan) output << "{" << *plan << "}" << endl; } } // From Clause - CalpontSelectExecutionPlan::TableList tables = cep.tableList(); + CalpontSelectExecutionPlan::TableList tables = tableList(); output << ">>From Tables" << endl; seq = 0; for (unsigned int i = 0; i < tables.size(); i++) @@ -237,7 +239,7 @@ ostream &operator<< (ostream &output, const CalpontSelectExecutionPlan &cep) if (tables[i].schema.length() == 0 && tables[i].table.length() == 0) { output << "derived table - " << tables[i].alias << endl; - CalpontSelectExecutionPlan *plan = dynamic_cast(cep.fDerivedTableList[seq++].get()); + CalpontSelectExecutionPlan *plan = dynamic_cast(fDerivedTableList[seq++].get()); if (plan) output << "{" << *plan << "}" << endl; } @@ -249,69 +251,65 @@ ostream &operator<< (ostream &output, const CalpontSelectExecutionPlan &cep) // Filters output << ">>Filters" << endl; - if (cep.filters() != 0) - cep.filters()->walk (ParseTree::print, output); + if (filters() != 0) + filters()->walk (ParseTree::print, output); else output << "empty filter tree" << endl; // Group by columns - CalpontSelectExecutionPlan::GroupByColumnList groupByCols = cep.groupByCols(); - if (groupByCols.size() > 0) + const CalpontSelectExecutionPlan::GroupByColumnList& gbc = groupByCols(); + if (gbc.size() > 0) { output << ">>Group By Columns" << endl; - for (unsigned int i = 0; i < groupByCols.size(); i++) - output << *groupByCols[i] << endl; + for (unsigned int i = 0; i < gbc.size(); i++) + output << *gbc[i] << endl; } // Having - if (cep.having() != 0) + if (having() != 0) { output << ">>Having" << endl; - cep.having()->walk (ParseTree::print, output); + having()->walk (ParseTree::print, output); } // Order by columns - CalpontSelectExecutionPlan::OrderByColumnList orderByCols = cep.orderByCols(); - if (orderByCols.size() > 0) + const CalpontSelectExecutionPlan::OrderByColumnList& obc = orderByCols(); + if (obc.size() > 0) { output << ">>Order By Columns" << endl; - for (unsigned int i = 0; i < orderByCols.size(); i++) - output << *orderByCols[i] << endl; + for (unsigned int i = 0; i < obc.size(); i++) + output << *obc[i] << endl; } - output << "SessionID: " << cep.fSessionID << endl; - output << "TxnID: " << cep.fTxnID << endl; - output << "VerID: " << cep.fVerID << endl; - output << "TraceFlags: " << cep.fTraceFlags << endl; - output << "StatementID: " << cep.fStatementID << endl; - output << "DistUnionNum: " << (int)cep.fDistinctUnionNum << endl; - output << "Limit: " << cep.fLimitStart << " - " << cep.fLimitNum << endl; - output << "String table threshold: " << cep.fStringTableThreshold << endl; + output << "SessionID: " << fSessionID << endl; + output << "TxnID: " << fTxnID << endl; + output << "VerID: " << fVerID << endl; + output << "TraceFlags: " << fTraceFlags << endl; + output << "StatementID: " << fStatementID << endl; + output << "DistUnionNum: " << (int)fDistinctUnionNum << endl; + output << "Limit: " << fLimitStart << " - " << fLimitNum << endl; + output << "String table threshold: " << fStringTableThreshold << endl; output << "--- Column Map ---" << endl; CalpontSelectExecutionPlan::ColumnMap::const_iterator iter; - for (iter = cep.columnMap().begin(); iter != cep.columnMap().end(); iter++) + for (iter = columnMap().begin(); iter != columnMap().end(); iter++) output << (*iter).first << " : " << (*iter).second << endl; - output << "UUID: " << cep.fUuid << endl; + output << "UUID: " << fUuid << endl; + output << "QueryType: " << queryType() << endl; - if (!cep.unionVec().empty()) + if (!unionVec().empty()) output << "\n--- Union Unit ---" << endl; - for (unsigned i = 0; i < cep.unionVec().size(); i++) + for (unsigned i = 0; i < unionVec().size(); i++) { CalpontSelectExecutionPlan *plan = - dynamic_cast(cep.unionVec()[i].get()); + dynamic_cast(unionVec()[i].get()); if (plan) output << "{" << *plan << "}\n" << endl; } - return output; -} - -const std::string CalpontSelectExecutionPlan::queryType() const -{ - return queryTypeToString(fQueryType); + return output.str(); } -std::string CalpontSelectExecutionPlan::queryTypeToString(const uint32_t queryType) +string CalpontSelectExecutionPlan::queryTypeToString(const uint32_t queryType) { switch (queryType) { diff --git a/dbcon/execplan/calpontselectexecutionplan.h b/dbcon/execplan/calpontselectexecutionplan.h index b1bb10ef..84e496c1 100644 --- a/dbcon/execplan/calpontselectexecutionplan.h +++ b/dbcon/execplan/calpontselectexecutionplan.h @@ -74,11 +74,6 @@ typedef boost::shared_ptr SCSEP; */ class CalpontSelectExecutionPlan : public CalpontExecutionPlan { -/** - * Overloaded stream operator - */ -friend std::ostream &operator<< (std::ostream &, const CalpontSelectExecutionPlan &); - /** * Public stuff */ @@ -379,7 +374,7 @@ friend std::ostream &operator<< (std::ostream &, const CalpontSelectExecutionPla // query type. return string for easy stats insert void queryType(const uint32_t queryType) { fQueryType = queryType; } - const std::string queryType() const; + const std::string queryType() const { return queryTypeToString(fQueryType); } static std::string queryTypeToString(const uint32_t queryType); void priority(uint32_t p) { fPriority = p; } @@ -428,6 +423,21 @@ friend std::ostream &operator<< (std::ostream &, const CalpontSelectExecutionPla */ virtual bool operator!=(const CalpontSelectExecutionPlan& t) const; + /** @brief Return a string rep of the CSEP + * + * Return a string rep of the CSEP + * @return a string + */ + virtual std::string toString() const; + + /** @brief Is this an internal query? + * + * Is this an internal query (a syscat query performed on behalf of another query) + * FIXME: add a setter and make this work for really big session ids + * @return true/false + */ + virtual bool isInternal() const { return ((fSessionID & 0x80000000) != 0); } + /** * Protected stuff */ @@ -566,6 +576,13 @@ friend std::ostream &operator<< (std::ostream &, const CalpontSelectExecutionPla boost::uuids::uuid fUuid; }; +/** + * Output stream operator + */ + +inline std::ostream& operator<<(std::ostream& os, const CalpontSelectExecutionPlan& rhs) + { os << rhs.toString(); return os; } + } #endif //CALPONTSELECTEXECUTIONPLAN_H // vim:ts=4 sw=4: diff --git a/dbcon/joblist/jlf_execplantojoblist.cpp b/dbcon/joblist/jlf_execplantojoblist.cpp index a7da458a..eaf62b7c 100644 --- a/dbcon/joblist/jlf_execplantojoblist.cpp +++ b/dbcon/joblist/jlf_execplantojoblist.cpp @@ -3084,6 +3084,7 @@ const JobStepVector doFunctionFilter(const ParseTree* n, JobInfo& jobInfo) } +#if 0 void doAND(JobStepVector& jsv, JobInfo& jobInfo) { // idbassert(jobInfo.stack.size() >= 2); @@ -3146,6 +3147,163 @@ void doOR(const ParseTree* n, JobStepVector& jsv, JobInfo& jobInfo, bool tryComb jsv = doExpressionFilter(n, jobInfo); jobInfo.stack.push(jsv); } +#endif + + +void doOR(ParseTree* n, JobInfo& jobInfo, bool tryCombine) +{ + JobStepVector jsv; + + // convert simple scalar filter sub to parse tree to be evaluated by expression + { + // travering in post-order because a node may be expanded + ParseTree* node = n; + stack nodeStack; + ParseTree* lastVisit = NULL; + while ((node || !nodeStack.empty())) + { + if (node) + { + nodeStack.push(node); + node = node->left(); + } + else + { + ParseTree* top = nodeStack.top(); + ParseTree* right = top->right(); + if (right && lastVisit != right) + { + node = right; + } + else + { + nodeStack.pop(); + + TreeNode* tn = top->data(); + if (TreeNode2Type(tn) == SIMPLESCALARFILTER) + { + SimpleScalarFilter* sf = dynamic_cast(tn); + ParseTree* parseTree = NULL; + if (simpleScalarFilterToParseTree(sf, parseTree, jobInfo)) + { + ParseTree* ccp = node; + delete ccp->data(); + ccp->left(parseTree->left()); + ccp->right(parseTree->right()); + ccp->data(parseTree->data()); + } + } + + lastVisit = top; + } + } + } + } + + if (tryCombine) + { + // travering OR branch n in post-order iteratively + ParseTree* node = n; + stack nodeStack; + ParseTree* lastVisit = NULL; + bool okToCombine = true; + while ((node || !nodeStack.empty()) && okToCombine) + { + if (node) + { + nodeStack.push(node); + node = node->left(); + } + else + { + ParseTree* top = nodeStack.top(); + ParseTree* right = top->right(); + if (right && lastVisit != right) + { + node = right; + } + else + { + nodeStack.pop(); + lastVisit = top; + + TreeNode* tn = top->data(); + JobStepVector nsv; + switch (TreeNode2Type(tn)) + { + case SIMPLEFILTER: + { + nsv = doSimpleFilter(dynamic_cast(tn), jobInfo); + break; + } + case OPERATOR: + { + const Operator* op = static_cast(tn); + if (*op == opAND || *op == opand || *op == opXOR || *op == opxor) + okToCombine = false; + else if (*op != opOR && *op != opor) + throw logic_error("doOR: unknow operator type."); + break; + } + case CONSTANTFILTER: + { + nsv = doConstantFilter(dynamic_cast(tn), jobInfo); + break; + } + case SIMPLESCALARFILTER: + { + // not possible, should be converted in the block above + break; + } + case OUTERJOINONFILTER: + case FUNCTIONCOLUMN: + case ARITHMETICCOLUMN: + case SIMPLECOLUMN: + case CONSTANTCOLUMN: + case EXISTSFILTER: + case SELECTFILTER: + { + okToCombine = false; + break; + } + case UNKNOWN: + { + cerr << boldStart << "doOR: Unknown" << boldStop << endl; + throw logic_error("doOR: unknow type."); + break; + } + default: + { + cerr << boldStart << "doOR: Not handled: " << TreeNode2Type(tn) + << boldStop << endl; + throw logic_error("doOR: Not handled treeNode type."); + break; + } + } + + if (nsv.size() > 0 && okToCombine) + { + if (jsv.empty()) + jsv = nsv; + else + okToCombine = tryCombineFilters(jsv, nsv, BOP_OR); + } + } + } + } + + if (!okToCombine) + jsv.clear(); + } + + if (jsv.empty()) + { + // OR is processed as an expression + jsv = doExpressionFilter(n, jobInfo); + } + + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); +} } // end of unnamed namespace @@ -3156,96 +3314,122 @@ namespace joblist // This method is the entry point into the execution plan to joblist // conversion performed by the functions in this file. +// @bug6131, pre-order traversing /* static */ void -JLF_ExecPlanToJobList::walkTree(ParseTree* n, void* obj) +JLF_ExecPlanToJobList::walkTree(ParseTree* n, JobInfo& jobInfo) { - JobInfo* jobInfo = reinterpret_cast(obj); TreeNode* tn = n->data(); JobStepVector jsv; - const Operator* op = 0; - switch (TreeNode2Type(tn)) + TreeNodeType tnType = TreeNode2Type(tn); + switch (tnType) { - case SIMPLEFILTER: - jsv = doSimpleFilter(dynamic_cast(tn), *jobInfo); - jobInfo->stack.push(jsv); - break; - case OUTERJOINONFILTER: - jsv = doOuterJoinOnFilter(dynamic_cast(tn), *jobInfo); - jobInfo->stack.push(jsv); - break; - case OPERATOR: - op = static_cast(tn); + case SIMPLEFILTER: + jsv = doSimpleFilter(dynamic_cast(tn), jobInfo); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, true); + break; + case OUTERJOINONFILTER: + jsv = doOuterJoinOnFilter(dynamic_cast(tn), jobInfo); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, true); + break; + case OPERATOR: + break; + case CONSTANTFILTER: + //cout << "ConstantFilter" << endl; + jsv = doConstantFilter(dynamic_cast(tn), jobInfo); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); + break; + case FUNCTIONCOLUMN: + jsv = doFunctionFilter(n, jobInfo); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); + break; + case ARITHMETICCOLUMN: + jsv = doExpressionFilter(n, jobInfo); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); + break; + case SIMPLECOLUMN: + jsv = doExpressionFilter(n, jobInfo); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); + break; + case CONSTANTCOLUMN: + jsv = doConstantBooleanFilter(n, jobInfo); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); + break; + case SIMPLESCALARFILTER: + doSimpleScalarFilter(n, jobInfo); + break; + case EXISTSFILTER: + doExistsFilter(n, jobInfo); + break; + case SELECTFILTER: + doSelectFilter(n, jobInfo); + break; + case UNKNOWN: + cerr << boldStart << "walkTree: Unknown" << boldStop << endl; + throw logic_error("walkTree: unknow type."); + break; + default: +/* + TREENODE, + FILTER, + RETURNEDCOLUMN, + AGGREGATECOLUMN, + TREENODEIMPL, +*/ + cerr << boldStart << "walkTree: Not handled: " << TreeNode2Type(tn) << boldStop << endl; + throw logic_error("walkTree: Not handled treeNode type."); + break; + } + //cout << *tn << endl; + + + if (tnType == OPERATOR) + { + const Operator* op = static_cast(tn); if (*op == opAND || *op == opand) { - doAND(jsv, *jobInfo); + /*doAND(jsv, jobInfo)*/; + if (n->left()) + walkTree(n->left(), jobInfo); + + if (n->right()) + walkTree(n->right(), jobInfo); } else if (*op == opOR || *op == opor) { - doOR(n, jsv, *jobInfo, true); + doOR(n, jobInfo, true); } else if (*op == opXOR || *op == opxor) { - doOR(n, jsv, *jobInfo, false); + doOR(n, jobInfo, false); } else { cerr << boldStart << "walkTree: only know how to handle 'and' and 'or' right now, got: " << *op << boldStop << endl; + throw logic_error("walkTree: unknow operator type."); } - break; - case CONSTANTFILTER: - //cout << "ConstantFilter" << endl; - jsv = doConstantFilter(dynamic_cast(tn), *jobInfo); - jobInfo->stack.push(jsv); - break; - case FUNCTIONCOLUMN: - jsv = doFunctionFilter(n, *jobInfo); - jobInfo->stack.push(jsv); - break; - case ARITHMETICCOLUMN: - jsv = doExpressionFilter(n, *jobInfo); - jobInfo->stack.push(jsv); - break; - case SIMPLECOLUMN: - jsv = doExpressionFilter(n, *jobInfo); - jobInfo->stack.push(jsv); - break; - case CONSTANTCOLUMN: - jsv = doConstantBooleanFilter(n, *jobInfo); - jobInfo->stack.push(jsv); - break; - case SIMPLESCALARFILTER: - doSimpleScalarFilter(n, *jobInfo); - break; - case EXISTSFILTER: - doExistsFilter(n, *jobInfo); - break; - case SELECTFILTER: - doSelectFilter(n, *jobInfo); - break; - case UNKNOWN: - cerr << boldStart << "walkTree: Unknown" << boldStop << endl; - throw logic_error("walkTree: unknow type."); - break; - default: -/* - TREENODE, - FILTER, - RETURNEDCOLUMN, - AGGREGATECOLUMN, - ARITHMETICCOLUMN, - SIMPLECOLUMN, - CONSTANTCOLUMN, - TREENODEIMPL, -*/ - cerr << boldStart << "walkTree: Not handled: " << TreeNode2Type(tn) << boldStop << endl; - throw logic_error("walkTree: Not handled treeNode type."); - break; } - //cout << *tn << endl; } + +void JLF_ExecPlanToJobList::addJobSteps(JobStepVector& nsv, JobInfo& jobInfo, bool tryCombine) +{ + idbassert(jobInfo.stack.size() < 2); + + if (jobInfo.stack.size() > 0) + { + JobStepVector& jsv = jobInfo.stack.top(); + if (tryCombine == false || tryCombineFilters(jsv, nsv, BOP_AND) == false) + jsv.insert(jsv.end(), nsv.begin(), nsv.end()); + } + else + { + jobInfo.stack.push(nsv); + } +} + + } // end of joblist namespace // vim:ts=4 sw=4: diff --git a/dbcon/joblist/jlf_execplantojoblist.h b/dbcon/joblist/jlf_execplantojoblist.h index 3b6b1938..2c9c42b5 100644 --- a/dbcon/joblist/jlf_execplantojoblist.h +++ b/dbcon/joblist/jlf_execplantojoblist.h @@ -32,6 +32,8 @@ #include "calpontsystemcatalog.h" using namespace execplan; +#include "jlf_common.h" + namespace joblist { @@ -46,9 +48,17 @@ class JLF_ExecPlanToJobList /** @brief This function is the entry point into CEP to joblist conversion * * @param ParseTree (in) is CEP to be translated to a joblist - * @param void* (in/out)is the JobInfo pointer that is loaded + * @param JobInfo& (in/out) is the JobInfo reference that is loaded + */ + static void walkTree(ParseTree* n, JobInfo& jobInfo); + + /** @brief This function add new job steps to the job step vector in JobInfo + * + * @param JobStepVector& (in) is a vector of new job steps + * @param JobInfo& (in/out) is the JobInfo reference that is loaded + * @param bool (in) is combine job step possible */ - static void walkTree(ParseTree* n, void* obj); + static void addJobSteps(JobStepVector& nsv, JobInfo& jobInfo, bool tryCombine); private: // Disable constructor since this class only contains a static method diff --git a/dbcon/joblist/jlf_subquery.cpp b/dbcon/joblist/jlf_subquery.cpp index 3d81e9fe..009a7722 100644 --- a/dbcon/joblist/jlf_subquery.cpp +++ b/dbcon/joblist/jlf_subquery.cpp @@ -144,78 +144,6 @@ void getColumnValue(ConstantColumn** cc, uint64_t i, const Row& row) } -bool simpleScalarFilterToParseTree(SimpleScalarFilter* sf, ParseTree*& pt, JobInfo& jobInfo) -{ - const vector& cols = sf->cols(); - CalpontSelectExecutionPlan* csep = sf->sub().get(); - SOP sop = sf->op(); - - // For row construct, supports only =, <> in Release 1.1. - // Other operators are errored out by connector. - string lop("and"); - if ((cols.size() > 1) && (sop->data() == "<>")) - lop = "or"; - - // Transformer sub to a scalar result. - SErrorInfo errorInfo(jobInfo.errorInfo); - SimpleScalarTransformer transformer(&jobInfo, errorInfo, false); - transformer.makeSubQueryStep(csep); - - // Do not catch exceptions here, let caller handle them. - transformer.run(); - - // if subquery errored out - if (errorInfo->errCode) - { - ostringstream oss; - oss << "Sub-query failed: "; - if (errorInfo->errMsg.empty()) - { - oss << "error code " << errorInfo->errCode; - errorInfo->errMsg = oss.str(); - } - throw runtime_error(errorInfo->errMsg); - } - - // Construct simple filters based on the scalar result. - bool isScalar = false; - if (transformer.emptyResultSet() == false) - { - const Row& row = transformer.resultRow(); - uint64_t i = 0; - for (; i < cols.size(); i++) - { - // = null is always false - if (row.isNullValue(i) == true) - break; - - // set fResult for cc - ConstantColumn* cc = NULL; - getColumnValue(&cc, i, row); - sop->setOpType(cols[i]->resultType(), cc->resultType()); - - SimpleFilter* sf = new SimpleFilter(sop, cols[i]->clone(), cc); - if (i == 0) - { - pt = new ParseTree(sf); - } - else - { - ParseTree* left = pt; - pt = new ParseTree(new LogicOperator(lop)); - pt->left(left); - pt->right(new ParseTree(sf)); - } - } - - if (i >= cols.size()) - isScalar = true; - } - - return isScalar; -} - - void sfInHaving(ParseTree* pt, void*) { SelectFilter* sf = dynamic_cast(pt->data()); @@ -423,7 +351,7 @@ void doCorrelatedExists(const ExistsFilter* ef, JobInfo& jobInfo) transformer.updateCorrelateInfo(); jsv.push_back(subQueryStep); - jobInfo.stack.push(jsv); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); } @@ -490,7 +418,7 @@ void doNonCorrelatedExists(const ExistsFilter* ef, JobInfo& jobInfo) JobStepVector jsv; SJSTEP tcs(new TupleConstantBooleanStep(jobInfo, exists)); jsv.push_back(tcs); - jobInfo.stack.push(jsv); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); } @@ -556,6 +484,78 @@ const SRCP doSelectSubquery(CalpontExecutionPlan* ep, SRCP& sc, JobInfo& jobInfo namespace joblist { +bool simpleScalarFilterToParseTree(SimpleScalarFilter* sf, ParseTree*& pt, JobInfo& jobInfo) +{ + const vector& cols = sf->cols(); + CalpontSelectExecutionPlan* csep = sf->sub().get(); + SOP sop = sf->op(); + + // For row construct, supports only =, <> in Release 1.1. + // Other operators are errored out by connector. + string lop("and"); + if ((cols.size() > 1) && (sop->data() == "<>")) + lop = "or"; + + // Transformer sub to a scalar result. + SErrorInfo errorInfo(jobInfo.errorInfo); + SimpleScalarTransformer transformer(&jobInfo, errorInfo, false); + transformer.makeSubQueryStep(csep); + + // Do not catch exceptions here, let caller handle them. + transformer.run(); + + // if subquery errored out + if (errorInfo->errCode) + { + ostringstream oss; + oss << "Sub-query failed: "; + if (errorInfo->errMsg.empty()) + { + oss << "error code " << errorInfo->errCode; + errorInfo->errMsg = oss.str(); + } + throw runtime_error(errorInfo->errMsg); + } + + // Construct simple filters based on the scalar result. + bool isScalar = false; + if (transformer.emptyResultSet() == false) + { + const Row& row = transformer.resultRow(); + uint64_t i = 0; + for (; i < cols.size(); i++) + { + // = null is always false + if (row.isNullValue(i) == true) + break; + + // set fResult for cc + ConstantColumn* cc = NULL; + getColumnValue(&cc, i, row); + sop->setOpType(cols[i]->resultType(), cc->resultType()); + + SimpleFilter* sf = new SimpleFilter(sop, cols[i]->clone(), cc); + if (i == 0) + { + pt = new ParseTree(sf); + } + else + { + ParseTree* left = pt; + pt = new ParseTree(new LogicOperator(lop)); + pt->left(left); + pt->right(new ParseTree(sf)); + } + } + + if (i >= cols.size()) + isScalar = true; + } + + return isScalar; +} + + void doSimpleScalarFilter(ParseTree* p, JobInfo& jobInfo) { SimpleScalarFilter* sf = dynamic_cast(p->data()); @@ -573,7 +573,7 @@ void doSimpleScalarFilter(ParseTree* p, JobInfo& jobInfo) ccp->data(parseTree->data()); // create job steps for each simple filter - parseTree->walk(JLF_ExecPlanToJobList::walkTree, &jobInfo); + JLF_ExecPlanToJobList::walkTree(parseTree, jobInfo); // don't delete the parseTree, it has been placed in the plan. // delete parseTree; @@ -585,7 +585,7 @@ void doSimpleScalarFilter(ParseTree* p, JobInfo& jobInfo) JobStepVector jsv; SJSTEP tcs(new TupleConstantBooleanStep(jobInfo, false)); jsv.push_back(tcs); - jobInfo.stack.push(jsv); + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); } } @@ -657,8 +657,7 @@ void doSelectFilter(const ParseTree* p, JobInfo& jobInfo) jsv.push_back(SJSTEP(es)); } - jobInfo.stack.push(jsv); - + JLF_ExecPlanToJobList::addJobSteps(jsv, jobInfo, false); } diff --git a/dbcon/joblist/jlf_subquery.h b/dbcon/joblist/jlf_subquery.h index ef9500ad..d5c9d8ba 100644 --- a/dbcon/joblist/jlf_subquery.h +++ b/dbcon/joblist/jlf_subquery.h @@ -29,13 +29,15 @@ namespace execplan { class ParseTree; - +class SimpleScalarFilter; } namespace joblist { +bool simpleScalarFilterToParseTree(SimpleScalarFilter* sf, ParseTree*& pt, JobInfo& jobInfo); + void addOrderByAndLimit(execplan::CalpontSelectExecutionPlan*, JobInfo&); void doExistsFilter(const execplan::ParseTree*, JobInfo&); diff --git a/dbcon/joblist/jlf_tuplejoblist.cpp b/dbcon/joblist/jlf_tuplejoblist.cpp index d57b96b5..a6bd6e1d 100644 --- a/dbcon/joblist/jlf_tuplejoblist.cpp +++ b/dbcon/joblist/jlf_tuplejoblist.cpp @@ -1614,12 +1614,15 @@ SP_JoinInfo joinToLargeTable(uint32_t large, TableInfoMap& tableInfoMap, vector& adjList = tableInfoMap[large].fAdjacentList; uint32_t prevLarge = (uint32_t) getPrevLarge(large, tableInfoMap); bool root = (prevLarge == (uint32_t) -1) ? true : false; + uint32_t link = large; + uint32_t cId = -1; // Get small sides ready. for (vector::iterator i = adjList.begin(); i != adjList.end(); i++) { if (tableInfoMap[*i].fVisited == false) { + cId = *i; smallSides.push_back(joinToLargeTable(*i, tableInfoMap, jobInfo, joinOrder)); tableSet.insert(tableInfoMap[*i].fJoinedTables.begin(), @@ -1635,6 +1638,41 @@ SP_JoinInfo joinToLargeTable(uint32_t large, TableInfoMap& tableInfoMap, BatchPrimitive* bps = dynamic_cast(spjs.get()); SubAdapterStep* tsas = dynamic_cast(spjs.get()); TupleHashJoinStep* thjs = dynamic_cast(spjs.get()); + + // @bug6158, try to put BPS on large side if possible + if (tsas && smallSides.size() == 1) + { + SJSTEP sspjs = tableInfoMap[cId].fQuerySteps.back(),get(); + BatchPrimitive* sbps = dynamic_cast(sspjs.get()); + TupleHashJoinStep* sthjs = dynamic_cast(sspjs.get()); + if (sbps || (sthjs && sthjs->tokenJoin() == cId)) + { + SP_JoinInfo largeJoinInfo(new JoinInfo); + largeJoinInfo->fTableOid = tableInfoMap[large].fTableOid; + largeJoinInfo->fAlias = tableInfoMap[large].fAlias; + largeJoinInfo->fView = tableInfoMap[large].fView; + largeJoinInfo->fSchema = tableInfoMap[large].fSchema; + + largeJoinInfo->fDl = tableInfoMap[large].fDl; + largeJoinInfo->fRowGroup = tableInfoMap[large].fRowGroup; + + TableJoinMap::iterator mit = jobInfo.tableJoinMap.find(make_pair(large, cId)); + if (mit == jobInfo.tableJoinMap.end()) + throw runtime_error("Join step not found."); + largeJoinInfo->fJoinData = mit->second; + + // switch large and small sides + joinOrder.back() = large; + large = cId; + smallSides[0] = largeJoinInfo; + tableInfoMap[large].fJoinedTables = tableSet; + + bps = sbps; + thjs = sthjs; + tsas = NULL; + } + } + if (!bps && !thjs && !tsas) { if (dynamic_cast(spjs.get())) @@ -1788,7 +1826,7 @@ SP_JoinInfo joinToLargeTable(uint32_t large, TableInfoMap& tableInfoMap, } RowGroup rg; - constructJoinedRowGroup(rg, large, prevLarge, root, tableSet, tableInfoMap, jobInfo); + constructJoinedRowGroup(rg, link, prevLarge, root, tableSet, tableInfoMap, jobInfo); thjs->setOutputRowGroup(rg); tableInfoMap[large].fRowGroup = rg; if (jobInfo.trace) @@ -1812,8 +1850,7 @@ SP_JoinInfo joinToLargeTable(uint32_t large, TableInfoMap& tableInfoMap, uint64_t i = 0; for (; i < tables.size(); i++) { - if (tableInfoMap[large].fJoinedTables.find(tables[i]) == - tableInfoMap[large].fJoinedTables.end()) + if (tableSet.find(tables[i]) == tableSet.end()) break; } @@ -1965,7 +2002,7 @@ SP_JoinInfo joinToLargeTable(uint32_t large, TableInfoMap& tableInfoMap, // update the fColsInExp2 and construct the output RG updateExp2Cols(readyExpSteps, tableInfoMap, jobInfo); - constructJoinedRowGroup(rg, large, prevLarge, root, tableSet, tableInfoMap, jobInfo); + constructJoinedRowGroup(rg, link, prevLarge, root, tableSet, tableInfoMap, jobInfo); if (thjs->hasFcnExpGroup2()) thjs->setFE23Output(rg); else @@ -1992,7 +2029,7 @@ SP_JoinInfo joinToLargeTable(uint32_t large, TableInfoMap& tableInfoMap, if (root == false) // not root { - TableJoinMap::iterator mit = jobInfo.tableJoinMap.find(make_pair(large, prevLarge)); + TableJoinMap::iterator mit = jobInfo.tableJoinMap.find(make_pair(link, prevLarge)); if (mit == jobInfo.tableJoinMap.end()) throw runtime_error("Join step not found."); diff --git a/dbcon/joblist/joblistfactory.cpp b/dbcon/joblist/joblistfactory.cpp index 7d65cb3a..8bf8d909 100644 --- a/dbcon/joblist/joblistfactory.cpp +++ b/dbcon/joblist/joblistfactory.cpp @@ -418,10 +418,10 @@ void checkHavingClause(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo) jobInfo.havingStep.reset(); // parse the having expression - const ParseTree* filters = csep->having(); + ParseTree* filters = csep->having(); if (filters != 0) { - filters->walk(JLF_ExecPlanToJobList::walkTree, &jobInfo); + JLF_ExecPlanToJobList::walkTree(filters, jobInfo); } if (!jobInfo.stack.empty()) @@ -1271,11 +1271,11 @@ void exceptionHandler(JobList* joblist, const JobInfo& jobInfo, const string& lo void parseExecutionPlan(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo, JobStepVector& querySteps, JobStepVector& projectSteps, DeliveredTableMap& deliverySteps) { - const ParseTree* filters = csep->filters(); + ParseTree* filters = csep->filters(); jobInfo.deliveredCols = csep->returnedCols(); if (filters != 0) { - filters->walk(JLF_ExecPlanToJobList::walkTree, &jobInfo); + JLF_ExecPlanToJobList::walkTree(filters, jobInfo); } if (jobInfo.trace) diff --git a/dbcon/mysql/ha_from_sub.cpp b/dbcon/mysql/ha_from_sub.cpp index d6a242e5..66611ced 100644 --- a/dbcon/mysql/ha_from_sub.cpp +++ b/dbcon/mysql/ha_from_sub.cpp @@ -49,6 +49,9 @@ void derivedTableOptimization(SCSEP& csep) // subquery may carry main query derived table list for column reference, those // derived tables are not checked for optimization in this scope. CalpontSelectExecutionPlan::SelectList derivedTbList = csep->derivedTableList(); + + // @bug6156. Skip horizontal optimization for no table union. + bool horizontalOptimization = true; for (uint i = 0; i < derivedTbList.size(); i++) { CalpontSelectExecutionPlan *plan = dynamic_cast(derivedTbList[i].get()); @@ -69,6 +72,17 @@ void derivedTableOptimization(SCSEP& csep) } } + if (plan->tableList().empty()) + horizontalOptimization = false; + for (uint j = 0; j < plan->unionVec().size(); j++) + { + if (dynamic_cast(plan->unionVec()[j].get())->tableList().empty()) + { + horizontalOptimization = false; + break; + } + } + if (verticalOptimization) { int64_t val = 1; @@ -108,7 +122,7 @@ void derivedTableOptimization(SCSEP& csep) */ ParseTree* pt = csep->filters(); map derivedTbFilterMap; - if (pt) + if (horizontalOptimization && pt) { pt->walk(setDerivedTable); setDerivedFilter(pt, derivedTbFilterMap, derivedTbList); diff --git a/ddlproc/DDLProc.vcxproj b/ddlproc/DDLProc.vcxproj index eef5cd0d..395a05ff 100644 --- a/ddlproc/DDLProc.vcxproj +++ b/ddlproc/DDLProc.vcxproj @@ -141,7 +141,7 @@ Disabled - $(SolutionDir)..\..\boost_1_54_0;$(SolutionDir)..\..\libxml2-2.7.8\libxml2\include;$(SolutionDir)..\utils\loggingcpp;$(SolutionDir)..\utils\configcpp;$(SolutionDir)..\oam\oamcpp;$(SolutionDir)..\snmpd\snmpmanager;$(SolutionDir)..\dbcon\joblist;$(SolutionDir)..\utils\messageqcpp;$(SolutionDir)..\utils\threadpool;$(SolutionDir)..\dbcon\ddlpackageproc;$(SolutionDir)..\dbcon\execplan;$(SolutionDir)..\writeengine\shared;$(SolutionDir)..\versioning\BRM;$(SolutionDir)..\dbcon\ddlpackage;$(SolutionDir)..\writeengine\wrapper;$(SolutionDir)..\dmlib;$(SolutionDir)..\writeengine\index;$(SolutionDir)..\writeengine\dictionary;$(SolutionDir)..\utils\rwlock;$(SolutionDir)..\utils\dataconvert;$(SolutionDir)..\utils\cacheutils;$(SolutionDir)..\utils\winport;$(SolutionDir)..\writeengine\client;$(SolutionDir)..\writeengine\server;$(SolutionDir)..\utils\compress;$(SolutionDir)..\utils\common;$(SolutionDir)..\utils\funcexp;$(SolutionDir)..\utils\idbdatafile;$(SolutionDir)..\..\libiconv-1.14\libiconv\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\boost_1_54_0;$(SolutionDir)..\..\libxml2-2.7.8\libxml2\include;$(SolutionDir)..\utils\loggingcpp;$(SolutionDir)..\utils\configcpp;$(SolutionDir)..\oam\oamcpp;$(SolutionDir)..\snmpd\snmpmanager;$(SolutionDir)..\dbcon\joblist;$(SolutionDir)..\utils\messageqcpp;$(SolutionDir)..\utils\threadpool;$(SolutionDir)..\dbcon\ddlpackageproc;$(SolutionDir)..\dbcon\execplan;$(SolutionDir)..\writeengine\shared;$(SolutionDir)..\versioning\BRM;$(SolutionDir)..\dbcon\ddlpackage;$(SolutionDir)..\writeengine\wrapper;$(SolutionDir)..\dmlib;$(SolutionDir)..\writeengine\index;$(SolutionDir)..\writeengine\dictionary;$(SolutionDir)..\utils\rwlock;$(SolutionDir)..\utils\dataconvert;$(SolutionDir)..\utils\cacheutils;$(SolutionDir)..\utils\winport;$(SolutionDir)..\writeengine\client;$(SolutionDir)..\writeengine\server;$(SolutionDir)..\utils\compress;$(SolutionDir)..\utils\common;$(SolutionDir)..\utils\funcexp;$(SolutionDir)..\utils\idbdatafile;$(SolutionDir)..\..\libiconv-1.14\libiconv\include;$(SolutionDir)..\utils\querytele;%(AdditionalIncludeDirectories) SKIP_SNMP;%(PreprocessorDefinitions) true EnableFastChecks @@ -238,7 +238,7 @@ MaxSpeed true - $(SolutionDir)..\..\boost_1_54_0;$(SolutionDir)..\..\libxml2-2.7.8\libxml2\include;$(SolutionDir)..\utils\loggingcpp;$(SolutionDir)..\utils\configcpp;$(SolutionDir)..\oam\oamcpp;$(SolutionDir)..\snmpd\snmpmanager;$(SolutionDir)..\dbcon\joblist;$(SolutionDir)..\utils\messageqcpp;$(SolutionDir)..\utils\threadpool;$(SolutionDir)..\dbcon\ddlpackageproc;$(SolutionDir)..\dbcon\execplan;$(SolutionDir)..\writeengine\shared;$(SolutionDir)..\versioning\BRM;$(SolutionDir)..\dbcon\ddlpackage;$(SolutionDir)..\writeengine\wrapper;$(SolutionDir)..\dmlib;$(SolutionDir)..\writeengine\index;$(SolutionDir)..\writeengine\dictionary;$(SolutionDir)..\utils\rwlock;$(SolutionDir)..\utils\dataconvert;$(SolutionDir)..\utils\cacheutils;$(SolutionDir)..\utils\winport;$(SolutionDir)..\writeengine\client;$(SolutionDir)..\writeengine\server;$(SolutionDir)..\utils\compress;$(SolutionDir)..\utils\common;$(SolutionDir)..\utils\funcexp;$(SolutionDir)..\utils\idbdatafile;$(SolutionDir)..\..\libiconv-1.14\libiconv\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\boost_1_54_0;$(SolutionDir)..\..\libxml2-2.7.8\libxml2\include;$(SolutionDir)..\utils\loggingcpp;$(SolutionDir)..\utils\configcpp;$(SolutionDir)..\oam\oamcpp;$(SolutionDir)..\snmpd\snmpmanager;$(SolutionDir)..\dbcon\joblist;$(SolutionDir)..\utils\messageqcpp;$(SolutionDir)..\utils\threadpool;$(SolutionDir)..\dbcon\ddlpackageproc;$(SolutionDir)..\dbcon\execplan;$(SolutionDir)..\writeengine\shared;$(SolutionDir)..\versioning\BRM;$(SolutionDir)..\dbcon\ddlpackage;$(SolutionDir)..\writeengine\wrapper;$(SolutionDir)..\dmlib;$(SolutionDir)..\writeengine\index;$(SolutionDir)..\writeengine\dictionary;$(SolutionDir)..\utils\rwlock;$(SolutionDir)..\utils\dataconvert;$(SolutionDir)..\utils\cacheutils;$(SolutionDir)..\utils\winport;$(SolutionDir)..\writeengine\client;$(SolutionDir)..\writeengine\server;$(SolutionDir)..\utils\compress;$(SolutionDir)..\utils\common;$(SolutionDir)..\utils\funcexp;$(SolutionDir)..\utils\idbdatafile;$(SolutionDir)..\..\libiconv-1.14\libiconv\include;$(SolutionDir)..\utils\querytele;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;SKIP_SNMP;%(PreprocessorDefinitions) MultiThreadedDLL true diff --git a/ddlproc/ddlprocessor.cpp b/ddlproc/ddlprocessor.cpp index 4c819393..28d234b1 100644 --- a/ddlproc/ddlprocessor.cpp +++ b/ddlproc/ddlprocessor.cpp @@ -54,6 +54,11 @@ using namespace execplan; using namespace logging; using namespace WriteEngine; +#include "querytele.h" +using namespace querytele; + +#include "oamcache.h" + namespace { typedef messageqcpp::ByteStream::quadbyte quadbyte; @@ -88,45 +93,66 @@ struct PackageHandler { CreateTableStatement createTableStmt; createTableStmt.unserialize(fByteStream); - boost::shared_ptr systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(createTableStmt.fSessionID ); + boost::shared_ptr systemCatalogPtr = + CalpontSystemCatalog::makeCalpontSystemCatalog(createTableStmt.fSessionID ); boost::scoped_ptr processor(new CreateTableProcessor(fDbrm)); processor->fTxnid.id = fTxnid.id; processor->fTxnid.valid = true; //cout << "create table using txnid " << fTxnid.id << endl; + + QueryTeleStats qts; + qts.query_uuid = QueryTeleClient::genUUID(); + qts.msg_type = QueryTeleStats::QT_START; + qts.start_time = QueryTeleClient::timeNowms(); + qts.session_id = createTableStmt.fSessionID; + qts.query_type = "CREATE"; + qts.query = createTableStmt.fSql; + qts.system_name = fOamCache->getSystemName(); + qts.module_name = fOamCache->getModuleName(); + qts.schema_name = createTableStmt.schemaName(); + fQtc.postQueryTele(qts); + result = processor->processPackage(createTableStmt); systemCatalogPtr->removeCalpontSystemCatalog( createTableStmt.fSessionID ); systemCatalogPtr->removeCalpontSystemCatalog( createTableStmt.fSessionID | 0x80000000); + + qts.msg_type = QueryTeleStats::QT_SUMMARY; + qts.end_time = QueryTeleClient::timeNowms(); + fQtc.postQueryTele(qts); } break; -#if 0 - case ddlpackage::DDL_CREATE_INDEX: - { - CreateIndexStatement createIndexStmt; - createIndexStmt.unserialize(fByteStream); - boost::shared_ptr systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(createIndexStmt.fSessionID ); - CreateIndexProcessor processor; - processor.fTxnid.id = fTxnid.id; - processor.fTxnid..valid = true; - result = processor.processPackage(createIndexStmt); - //pkNameMap.insert(PKNameMap::value_type(createIndexStmt.fSessionID, processor.PKName())); - systemCatalogPtr->removeCalpontSystemCatalog( createIndexStmt.fSessionID ); - systemCatalogPtr->removeCalpontSystemCatalog( createIndexStmt.fSessionID | 0x80000000); - } - break; -#endif + case ddlpackage::DDL_ALTER_TABLE_STATEMENT: { AlterTableStatement alterTableStmt; alterTableStmt.unserialize(fByteStream); - boost::shared_ptr systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(alterTableStmt.fSessionID ); + boost::shared_ptr systemCatalogPtr = + CalpontSystemCatalog::makeCalpontSystemCatalog(alterTableStmt.fSessionID ); boost::scoped_ptr processor(new AlterTableProcessor(fDbrm)); processor->fTxnid.id = fTxnid.id; processor->fTxnid.valid = true; + + QueryTeleStats qts; + qts.query_uuid = QueryTeleClient::genUUID(); + qts.msg_type = QueryTeleStats::QT_START; + qts.start_time = QueryTeleClient::timeNowms(); + qts.session_id = alterTableStmt.fSessionID; + qts.query_type = "ALTER"; + qts.query = alterTableStmt.fSql; + qts.system_name = fOamCache->getSystemName(); + qts.module_name = fOamCache->getModuleName(); + qts.schema_name = alterTableStmt.schemaName(); + fQtc.postQueryTele(qts); + result = processor->processPackage(alterTableStmt); systemCatalogPtr->removeCalpontSystemCatalog( alterTableStmt.fSessionID ); systemCatalogPtr->removeCalpontSystemCatalog( alterTableStmt.fSessionID | 0x80000000); + + qts.msg_type = QueryTeleStats::QT_SUMMARY; + qts.end_time = QueryTeleClient::timeNowms(); + fQtc.postQueryTele(qts); } break; @@ -134,16 +160,37 @@ struct PackageHandler { DropTableStatement dropTableStmt; dropTableStmt.unserialize(fByteStream); - boost::shared_ptr systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(dropTableStmt.fSessionID ); + boost::shared_ptr systemCatalogPtr = + CalpontSystemCatalog::makeCalpontSystemCatalog(dropTableStmt.fSessionID ); boost::scoped_ptr processor(new DropTableProcessor(fDbrm)); - (processor->fTxnid).id = fTxnid.id; - (processor->fTxnid).valid = true; + + processor->fTxnid.id = fTxnid.id; + processor->fTxnid.valid = true; + + QueryTeleStats qts; + qts.query_uuid = QueryTeleClient::genUUID(); + qts.msg_type = QueryTeleStats::QT_START; + qts.start_time = QueryTeleClient::timeNowms(); + qts.session_id = dropTableStmt.fSessionID; + qts.query_type = "DROP"; + qts.query = dropTableStmt.fSql; + qts.system_name = fOamCache->getSystemName(); + qts.module_name = fOamCache->getModuleName(); + qts.schema_name = dropTableStmt.schemaName(); + fQtc.postQueryTele(qts); + //cout << "Drop table using txnid " << fTxnid.id << endl; result = processor->processPackage(dropTableStmt); + systemCatalogPtr->removeCalpontSystemCatalog( dropTableStmt.fSessionID ); systemCatalogPtr->removeCalpontSystemCatalog( dropTableStmt.fSessionID | 0x80000000); + + qts.msg_type = QueryTeleStats::QT_SUMMARY; + qts.end_time = QueryTeleClient::timeNowms(); + fQtc.postQueryTele(qts); } break; + case ddlpackage::DDL_TRUNC_TABLE_STATEMENT: { TruncTableStatement truncTableStmt; @@ -151,13 +198,33 @@ struct PackageHandler boost::shared_ptr systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(truncTableStmt.fSessionID); boost::scoped_ptr processor(new TruncTableProcessor(fDbrm)); - (processor->fTxnid).id = fTxnid.id; - (processor->fTxnid).valid = true; + + processor->fTxnid.id = fTxnid.id; + processor->fTxnid.valid = true; + + QueryTeleStats qts; + qts.query_uuid = QueryTeleClient::genUUID(); + qts.msg_type = QueryTeleStats::QT_START; + qts.start_time = QueryTeleClient::timeNowms(); + qts.session_id = truncTableStmt.fSessionID; + qts.query_type = "TRUNCATE"; + qts.query = truncTableStmt.fSql; + qts.system_name = fOamCache->getSystemName(); + qts.module_name = fOamCache->getModuleName(); + qts.schema_name = truncTableStmt.schemaName(); + fQtc.postQueryTele(qts); + result = processor->processPackage(truncTableStmt); + systemCatalogPtr->removeCalpontSystemCatalog(truncTableStmt.fSessionID ); systemCatalogPtr->removeCalpontSystemCatalog(truncTableStmt.fSessionID | 0x80000000); + + qts.msg_type = QueryTeleStats::QT_SUMMARY; + qts.end_time = QueryTeleClient::timeNowms(); + fQtc.postQueryTele(qts); } break; + case ddlpackage::DDL_MARK_PARTITION_STATEMENT: { MarkPartitionStatement markPartitionStmt; @@ -172,6 +239,7 @@ struct PackageHandler systemCatalogPtr->removeCalpontSystemCatalog(markPartitionStmt.fSessionID | 0x80000000); } break; + case ddlpackage::DDL_RESTORE_PARTITION_STATEMENT: { RestorePartitionStatement restorePartitionStmt; @@ -186,6 +254,7 @@ struct PackageHandler systemCatalogPtr->removeCalpontSystemCatalog(restorePartitionStmt.fSessionID | 0x80000000); } break; + case ddlpackage::DDL_DROP_PARTITION_STATEMENT: { DropPartitionStatement dropPartitionStmt; @@ -200,21 +269,10 @@ struct PackageHandler systemCatalogPtr->removeCalpontSystemCatalog(dropPartitionStmt.fSessionID | 0x80000000); } break; -#if 0 - case ddlpackage::DDL_DROP_INDEX_STATEMENT: - { - DropIndexStatement dropIndexStmt; - dropIndexStmt.unserialize(fByteStream); - boost::shared_ptr systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(dropIndexStmt.fSessionID ); - DropIndexProcessor processor; - result = processor.processPackage(dropIndexStmt); - systemCatalogPtr->CalpontSystemCatalog::makeCalpontSystemCatalog(dropIndexStmt.fSessionID ); - systemCatalogPtr->CalpontSystemCatalog::makeCalpontSystemCatalog(dropIndexStmt.fSessionID | 0x80000000); - } - break; -#endif + default: - throw(UNRECOGNIZED_PACKAGE_TYPE); + throw UNRECOGNIZED_PACKAGE_TYPE; + break; } //@Bug 3427. No need to log user rror, just return the message to user. @@ -226,7 +284,9 @@ struct PackageHandler ml.logErrorMessage( result.message ); } - cleanPMSysCache(); + string hdfstest = config::Config::makeConfig()->getConfig("Installation", "DBRootStorageType"); + if (hdfstest == "hdfs" || hdfstest == "HDFS") + cleanPMSysCache(); messageqcpp::ByteStream results; messageqcpp::ByteStream::byte status = result.result; results << status; @@ -263,16 +323,17 @@ struct PackageHandler messageqcpp::IOSocket fIos; messageqcpp::ByteStream fByteStream; messageqcpp::ByteStream::quadbyte fPackageType; - BRM::TxnID fTxnid; - BRM::DBRM* fDbrm; - - + BRM::TxnID fTxnid; + BRM::DBRM* fDbrm; + QueryTeleClient fQtc; + oam::OamCache* fOamCache; }; } namespace ddlprocessor { + DDLProcessor::DDLProcessor( int packageMaxThreads, int packageWorkQueueSize ) :fPackageMaxThreads(packageMaxThreads), fPackageWorkQueueSize(packageWorkQueueSize), fMqServer(DDLProcName) @@ -281,7 +342,17 @@ DDLProcessor::DDLProcessor( int packageMaxThreads, int packageWorkQueueSize ) fDdlPackagepool.setQueueSize(fPackageWorkQueueSize); csc = CalpontSystemCatalog::makeCalpontSystemCatalog(); csc->identity(CalpontSystemCatalog::EC); + string teleServerHost(config::Config::makeConfig()->getConfig("QueryTele", "Host")); + if (!teleServerHost.empty()) + { + int teleServerPort = config::Config::fromText(config::Config::makeConfig()->getConfig("QueryTele", "Port")); + if (teleServerPort > 0) + { + fQtc.serverParms(QueryTeleServerParms(teleServerHost, teleServerPort)); + } + } } + DDLProcessor::~DDLProcessor() { @@ -567,6 +638,8 @@ void DDLProcessor::process() handler.fPackageType = packageType; handler.fTxnid = txnid; handler.fDbrm = &dbrm; + handler.fQtc = fQtc; + handler.fOamCache = oam::OamCache::makeOamCache(); fDdlPackagepool.invoke(handler); } @@ -614,6 +687,8 @@ void DDLProcessor::process() handler.fPackageType = packageType; handler.fTxnid = txnid; handler.fDbrm = &dbrm; + handler.fQtc = fQtc; + handler.fOamCache = oam::OamCache::makeOamCache(); fDdlPackagepool.invoke(handler); } } diff --git a/ddlproc/ddlprocessor.h b/ddlproc/ddlprocessor.h index 65135f94..f822ad78 100644 --- a/ddlproc/ddlprocessor.h +++ b/ddlproc/ddlprocessor.h @@ -27,6 +27,7 @@ #include "ddlproc.h" #include "threadpool.h" #include "calpontsystemcatalog.h" +#include "querytele.h" namespace ddlprocessor { @@ -80,8 +81,9 @@ class DDLProcessor messageqcpp::MessageQueueServer fMqServer; boost::shared_ptr csc; - WriteEngine::WEClients* fWEClient; - uint32_t fPMCount; + WriteEngine::WEClients* fWEClient; + uint32_t fPMCount; + querytele::QueryTeleClient fQtc; }; diff --git a/exemgr/main.cpp b/exemgr/main.cpp index 04b8c072..8c65f20e 100644 --- a/exemgr/main.cpp +++ b/exemgr/main.cpp @@ -528,7 +528,7 @@ class SessionThread bs = fIos.read(); if (bs.length() == 0) { - if (gDebug > 1 || (gDebug && (csep.sessionID()&0x80000000)==0)) + if (gDebug > 1 || (gDebug && !csep.isInternal())) cout << "### Got a close(1) for session id " << csep.sessionID() << endl; // connection closed by client fIos.close(); @@ -577,7 +577,8 @@ class SessionThread csep.unserialize(bs); QueryTeleStats qts; - if ((csep.sessionID()&0x80000000) == 0 && csep.queryType().compare("SELECT") == 0) + if ( !csep.isInternal() && + (csep.queryType() == "SELECT" || csep.queryType() == "INSERT_SELECT") ) { qts.query_uuid = csep.uuid(); qts.msg_type = QueryTeleStats::QT_START; @@ -592,13 +593,13 @@ class SessionThread fTeleClient.postQueryTele(qts); } - if (gDebug > 1 || (gDebug && (csep.sessionID()&0x80000000)==0)) + if (gDebug > 1 || (gDebug && !csep.isInternal())) cout << "### For session id " << csep.sessionID() << ", got a CSEP" << endl; setRMParms(csep.rmParms()); // @bug 1021. try to get schema cache for a come in query. // skip system catalog queries. - if ((csep.sessionID()&0x80000000)==0) + if (!csep.isInternal()) { boost::shared_ptr csc = CalpontSystemCatalog::makeCalpontSystemCatalog(csep.sessionID()); @@ -753,7 +754,7 @@ class SessionThread bs = fIos.read(); if (bs.length() == 0) { - if (gDebug > 1 || (gDebug && (csep.sessionID()&0x80000000)==0)) + if (gDebug > 1 || (gDebug && !csep.isInternal())) cout << "### Got a close(2) for session id " << csep.sessionID() << endl; break; } @@ -777,7 +778,7 @@ class SessionThread try // @bug2244: try/catch around fIos.write() calls responding to qb command { bs >> qb; - if (gDebug > 1 || (gDebug && (csep.sessionID()&0x80000000)==0)) + if (gDebug > 1 || (gDebug && !csep.isInternal())) cout << "### For session id " << csep.sessionID() << ", got a command = " << qb << endl; if (qb == 0) { @@ -799,7 +800,7 @@ class SessionThread DeliveredTableMap::iterator iter = tm.begin(); if (iter == tm.end()) { - if (gDebug > 1 || (gDebug && (csep.sessionID()&0x80000000)==0)) + if (gDebug > 1 || (gDebug && !csep.isInternal())) cout << "### For session id " << csep.sessionID() << ", returning end flag" << endl; bs.restart(); bs << (ByteStream::byte)1; @@ -1051,36 +1052,27 @@ class SessionThread statementsRunningCount->decr(stmtCounted); + if ( !csep.isInternal() && + (csep.queryType() == "SELECT" || csep.queryType() == "INSERT_SELECT") ) { - //QueryTeleStats qts; - //qts.query_uuid = csep.uuid(); - if ((csep.sessionID()&0x80000000) == 0 && csep.queryType().compare("SELECT") == 0) - { - qts.msg_type = QueryTeleStats::QT_SUMMARY; - qts.max_mem_pct = fStats.fMaxMemPct; - qts.num_files = fStats.fNumFiles; - qts.phy_io = fStats.fPhyIO; - qts.cache_io = fStats.fCacheIO; - qts.msg_rcv_cnt = fStats.fMsgRcvCnt; - qts.cp_blocks_skipped = fStats.fCPBlocksSkipped; - qts.msg_bytes_in = fStats.fMsgBytesIn; - qts.msg_bytes_out = fStats.fMsgBytesOut; - qts.rows = totalRowCount; - //qts.start_time = - qts.end_time = QueryTeleClient::timeNowms(); - //qts.error_no = - //qts.blocks_changed = - qts.session_id = csep.sessionID(); - qts.query_type = csep.queryType(); - qts.query = csep.data(); - qts.system_name = fOamCachePtr->getSystemName(); - qts.module_name = fOamCachePtr->getModuleName(); - qts.local_query = csep.localQuery(); - //qts.user = - //qts.host = - //qts.priority = - fTeleClient.postQueryTele(qts); - } + qts.msg_type = QueryTeleStats::QT_SUMMARY; + qts.max_mem_pct = fStats.fMaxMemPct; + qts.num_files = fStats.fNumFiles; + qts.phy_io = fStats.fPhyIO; + qts.cache_io = fStats.fCacheIO; + qts.msg_rcv_cnt = fStats.fMsgRcvCnt; + qts.cp_blocks_skipped = fStats.fCPBlocksSkipped; + qts.msg_bytes_in = fStats.fMsgBytesIn; + qts.msg_bytes_out = fStats.fMsgBytesOut; + qts.rows = totalRowCount; + qts.end_time = QueryTeleClient::timeNowms(); + qts.session_id = csep.sessionID(); + qts.query_type = csep.queryType(); + qts.query = csep.data(); + qts.system_name = fOamCachePtr->getSystemName(); + qts.module_name = fOamCachePtr->getModuleName(); + qts.local_query = csep.localQuery(); + fTeleClient.postQueryTele(qts); } } diff --git a/tools/dbloadxml/colxml.cpp b/tools/dbloadxml/colxml.cpp index 386a973d..65a9ed1c 100644 --- a/tools/dbloadxml/colxml.cpp +++ b/tools/dbloadxml/colxml.cpp @@ -24,6 +24,8 @@ #include +#include + #include #include #include @@ -49,6 +51,60 @@ int main(int argc, char **argv) setlocale(LC_ALL, ""); WriteEngine::Config::initConfigCache(); // load Calpont.xml config settings + //Bug 6137 + std::string aBulkRoot = WriteEngine::Config::getBulkRoot(); + if (!aBulkRoot.empty()) + { + if (!boost::filesystem::exists(aBulkRoot.c_str())) + { + cout << "Creating directory : " << aBulkRoot < $(SolutionDir)..\..\$(Platform)\$(Configuration)\ + $(SolutionDir)..\..\obj\$(ProjectName)\$(Platform)\$(Configuration)\ $(SolutionDir)..\..\$(Platform)\$(Configuration)\ $(SolutionDir)..\..\$(Platform)\$(Configuration)\ + $(SolutionDir)..\..\obj\$(ProjectName)\$(Platform)\$(Configuration)\ @@ -131,6 +133,7 @@ $(SolutionDir)..\..\boost_1_54_0;$(SolutionDir)..\utils\winport;$(SolutionDir)..\utils\thrift;$(SolutionDir)..\utils\common;%(AdditionalIncludeDirectories) %(PreprocessorDefinitions) 4996 + true true @@ -193,6 +196,7 @@ true $(SolutionDir)..\..\boost_1_54_0;$(SolutionDir)..\utils\winport;$(SolutionDir)..\utils\thrift;$(SolutionDir)..\utils\common;%(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + false true diff --git a/utils/rowgroup/rowaggregation.cpp b/utils/rowgroup/rowaggregation.cpp index 0fcf4694..a647f713 100644 --- a/utils/rowgroup/rowaggregation.cpp +++ b/utils/rowgroup/rowaggregation.cpp @@ -387,9 +387,9 @@ inline void RowAggregation::updateIntSum(int64_t val1, int64_t val2, int64_t col ostringstream oss; oss << overflowMsg << ": " << val2 << "+" << val1; if (val2 > 0) - oss << " > " << numeric_limits::max(); + oss << " > " << numeric_limits::max(); else - oss << " < " << numeric_limits::min(); + oss << " < " << numeric_limits::min(); throw logging::QueryDataExcept(oss.str(), logging::aggregateDataErr); #else /* PROMOTE_AGGR_OVRFLW_TO_DBL */ double* dp2 = (double*)&val2; diff --git a/utils/rowgroup/rowgroup.cpp b/utils/rowgroup/rowgroup.cpp index fa48ae0a..2a048def 100644 --- a/utils/rowgroup/rowgroup.cpp +++ b/utils/rowgroup/rowgroup.cpp @@ -263,7 +263,7 @@ void RGData::serialize(ByteStream &bs, uint32_t amount) const bs << (uint32_t) RGDATA_SIG; bs << (uint32_t) amount; bs.append(rowData.get(), amount); - if (strings && !strings->isEmpty()) { + if (strings) { bs << (uint8_t) 1; strings->serialize(bs); } diff --git a/versioning/BRM/vbbm.cpp b/versioning/BRM/vbbm.cpp index 6b9b6c39..ef0f32d0 100644 --- a/versioning/BRM/vbbm.cpp +++ b/versioning/BRM/vbbm.cpp @@ -305,6 +305,63 @@ void VBBM::growVBBM(bool addAFile) vbbm->numHashBuckets*sizeof(int)]); } +void VBBM::growForLoad(int count) +{ + int allocSize; + int nFiles; + key_t newshmkey; + char *newshmseg; + int i; + + if (vbbm) + nFiles = vbbm->nFiles; + else + nFiles = 0; + + if (count < VBSTORAGE_INITIAL_COUNT) + count = VBSTORAGE_INITIAL_COUNT; + // round up to next normal increment point out of paranoia. + if (count % VBSTORAGE_INCREMENT_COUNT) + count = ((count/VBSTORAGE_INCREMENT_COUNT) + 1) * VBSTORAGE_INCREMENT_COUNT; + allocSize = VBBM_SIZE(nFiles, count); + + newshmkey = chooseShmkey(); + if (fPVBBMImpl) { + BRMShmImpl newShm(newshmkey, allocSize); + newshmseg = static_cast(newShm.fMapreg.get_address()); + // copy the file meta to the new segment + memcpy((char *) &newshmseg[sizeof(VBShmsegHeader)], files, sizeof(VBFileMetadata)*nFiles); + fPVBBMImpl->swapout(newShm); + } + else { + fPVBBMImpl = VBBMImpl::makeVBBMImpl(newshmkey, allocSize); + } + + vbbm = fPVBBMImpl->get(); + vbbm->nFiles = nFiles; + vbbm->vbCapacity = count; + vbbm->vbLWM = 0; + vbbm->numHashBuckets = count/4; + + vbbmShminfo->tableShmkey = currentVBBMShmkey = newshmkey; + vbbmShminfo->allocdSize = allocSize; + newshmseg = (char *) vbbm; + files = reinterpret_cast + (&newshmseg[sizeof(VBShmsegHeader)]); + hashBuckets = reinterpret_cast + (&newshmseg[sizeof(VBShmsegHeader) + + vbbm->nFiles*sizeof(VBFileMetadata)]); + storage = reinterpret_cast(&newshmseg[sizeof(VBShmsegHeader) + + vbbm->nFiles*sizeof(VBFileMetadata) + + vbbm->numHashBuckets*sizeof(int)]); + + for (i = 0; i < vbbm->numHashBuckets; i++) + hashBuckets[i] = -1; + for (i = 0; i < vbbm->vbCapacity; i++) + storage[i].lbid = -1; + undoRecords.clear(); +} + //assumes write lock is held and the src is vbbm //and that dest->{numHashBuckets, vbCapacity, vbLWM} have been set. void VBBM::copyVBBM(VBShmsegHeader *dest) @@ -338,8 +395,8 @@ void VBBM::copyVBBM(VBShmsegHeader *dest) //walk the storage & re-hash all entries; for (i = 0; i < vbbm->vbCurrentSize; i++) if (storage[i].lbid != -1) { - _insert(storage[i], dest, newHashtable, newStorage); - confirmChanges(); + _insert(storage[i], dest, newHashtable, newStorage, true); + //confirmChanges(); } } @@ -359,7 +416,7 @@ key_t VBBM::chooseShmkey() const } //write lock -void VBBM::insert(LBID_t lbid, VER_t verID, OID_t vbOID, uint32_t vbFBO) +void VBBM::insert(LBID_t lbid, VER_t verID, OID_t vbOID, uint32_t vbFBO, bool loading) { VBBMEntry entry; @@ -398,16 +455,16 @@ void VBBM::insert(LBID_t lbid, VER_t verID, OID_t vbOID, uint32_t vbFBO) if (vbbm->vbCurrentSize == vbbm->vbCapacity) growVBBM(); - _insert(entry, vbbm, hashBuckets, storage); - makeUndoRecord(&vbbm->vbCurrentSize, sizeof(vbbm->vbCurrentSize)); + _insert(entry, vbbm, hashBuckets, storage, loading); + if (!loading) + makeUndoRecord(&vbbm->vbCurrentSize, sizeof(vbbm->vbCurrentSize)); vbbm->vbCurrentSize++; } //assumes write lock is held and that it is properly sized already void VBBM::_insert(VBBMEntry& e, VBShmsegHeader *dest, int *destHash, - VBBMEntry *destStorage) + VBBMEntry *destStorage, bool loading) { - int hashIndex, cHashlen = sizeof(LBID_t) + sizeof(VER_t), insertIndex; char* cHash = (char*)alloca(cHashlen); utils::Hasher hasher; @@ -428,9 +485,11 @@ void VBBM::_insert(VBBMEntry& e, VBShmsegHeader *dest, int *destHash, #endif } - makeUndoRecord(dest, sizeof(VBShmsegHeader)); - makeUndoRecord(&destStorage[insertIndex], sizeof(VBBMEntry)); - makeUndoRecord(&destHash[hashIndex], sizeof(int)); + if (!loading) { + makeUndoRecord(dest, sizeof(VBShmsegHeader)); + makeUndoRecord(&destStorage[insertIndex], sizeof(VBBMEntry)); + makeUndoRecord(&destHash[hashIndex], sizeof(int)); + } dest->vbLWM = insertIndex; @@ -832,8 +891,8 @@ void VBBM::loadVersion1(IDBDataFile* in) log_errno("VBBM::load()"); throw runtime_error("VBBM::load(): Failed to load entry"); } - insert(entry.lbid, entry.verID, entry.vbOID, entry.vbFBO); - confirmChanges(); + insert(entry.lbid, entry.verID, entry.vbOID, entry.vbFBO, true); + //confirmChanges(); addVBFileIfNotExists(entry.vbOID); } @@ -881,6 +940,8 @@ void VBBM::loadVersion2(IDBDataFile* in) while (vbbm->nFiles < nFiles) growVBBM(true); // this allocates one file, doesn't grow the main storage + growForLoad(vbbmEntries); + const int nfileSize = sizeof(VBFileMetadata) * nFiles; if (in->read((char *)files, nfileSize) != nfileSize) { log_errno("VBBM::load()"); @@ -892,11 +953,14 @@ void VBBM::loadVersion2(IDBDataFile* in) log_errno("VBBM::load()"); throw runtime_error("VBBM::load(): Failed to load entry"); } - insert(entry.lbid, entry.verID, entry.vbOID, entry.vbFBO); - confirmChanges(); + insert(entry.lbid, entry.verID, entry.vbOID, entry.vbFBO, true); } + } +//#include "boost/date_time/posix_time/posix_time.hpp" +//using namespace boost::posix_time; + void VBBM::load(string filename) { int magic; @@ -904,6 +968,11 @@ void VBBM::load(string filename) scoped_ptr in(IDBDataFile::open( IDBPolicy::getType(filename_p, IDBPolicy::WRITEENG), filename_p, "rb", 0)); + //ptime time1, time2; + + //time1 = microsec_clock::local_time(); + //cout << "loading the VBBM " << time1 << endl; + if (!in) { log_errno("VBBM::load()"); throw runtime_error("VBBM::load(): Failed to open the file"); @@ -922,6 +991,9 @@ void VBBM::load(string filename) log("VBBM::load(): Bad magic. Not a VBBM file?"); throw runtime_error("VBBM::load(): Bad magic. Not a VBBM file?"); } + + //time2 = microsec_clock::local_time(); + //cout << "done loading " << time2 << " duration: " << time2-time1 << endl; } // read lock diff --git a/versioning/BRM/vbbm.h b/versioning/BRM/vbbm.h index c65c1d36..83b92e65 100644 --- a/versioning/BRM/vbbm.h +++ b/versioning/BRM/vbbm.h @@ -20,7 +20,7 @@ * *****************************************************************************/ -/** @file +/** @file * class XXX interface */ @@ -42,15 +42,22 @@ // These config parameters need to be loaded //will get a small hash function performance boost by using powers of 2 -#define VBSTORAGE_INITIAL_SIZE (100000*sizeof(VBBMEntry)) -#define VBSTORAGE_INCREMENT (10000*sizeof(VBBMEntry)) +#define VBSTORAGE_INITIAL_COUNT 100000 +#define VBSTORAGE_INITIAL_SIZE (VBSTORAGE_INITIAL_COUNT*sizeof(VBBMEntry)) +#define VBSTORAGE_INCREMENT_COUNT 10000 +#define VBSTORAGE_INCREMENT (VBSTORAGE_INCREMENT_COUNT*sizeof(VBBMEntry)) // (average list length = 4) -#define VBTABLE_INITIAL_SIZE (25000*sizeof(int)) +#define VBTABLE_INITIAL_SIZE (25000*sizeof(int)) #define VBTABLE_INCREMENT (2500*sizeof(int)) - + #define VBBM_INCREMENT (VBTABLE_INCREMENT + VBSTORAGE_INCREMENT) +#define VBBM_SIZE(files, entries) \ + ((entries * sizeof(VBBMEntry)) + (entries/4 * sizeof(int)) \ + + (files * sizeof(VBFileMetadata)) + sizeof(VBShmsegHeader)) + + #if defined(_MSC_VER) && defined(xxxVBBM_DLLEXPORT) #define EXPORT __declspec(dllexport) #else @@ -87,7 +94,7 @@ struct VBShmsegHeader { int vbCurrentSize; int vbLWM; int numHashBuckets; - + // the rest of the overlay looks like this // VBFileMetadata files[nFiles]; // int hashBuckets[numHashBuckets]; @@ -128,23 +135,23 @@ class VBBMImpl * * At a high level, the VBBM maintains a table describing the contents of * the Version Buffer. For every entry in the Version Buffer, it associates its - * identifier with the OID and offset it is stored at. + * identifier with the OID and offset it is stored at. * * As implemented, it is a hash table and a set of lists that exist in * shared memory. The hash table is keyed by , and * each valid entry points to the head of a unique list. Each list element * contains the LBID, VerID, VB OID, and VB offset that encapsulate "an entry in the * VBBM table". Every list contains all elements that collide on that hash table - * entry that points to it, "load factor" has no bearing on performance, + * entry that points to it, "load factor" has no bearing on performance, * and lists can grow arbitrarily large. * Technically lookups are O(n), but in normal circumstances it'll - * be constant time. As things are right now, we expect there to be about + * be constant time. As things are right now, we expect there to be about * 100k VBBM entries. The hash table is sized such that on average there will be 4 * entries per list when it's at capacity. * * The memory management & structure manipulation code is nearly identical * to that in the VSS, so any bugs found here are likely there as well. - * + * * Shared memory is managed using code similar to the ExtentMap & VSS. When * the shared memory segment needs to grow, it is write-locked, a new one * is created, the contents are reinserted to the new one, the key is @@ -159,19 +166,19 @@ class VBBM : public Undoable { READ, WRITE }; - - + + EXPORT VBBM(); EXPORT ~VBBM(); - + EXPORT void lock(OPS op); EXPORT void release(OPS op); EXPORT int lookup(LBID_t lbid, VER_t ver, OID_t &oid, uint32_t &fbo) const; - EXPORT void insert(LBID_t lbid, VER_t ver, OID_t oid, uint32_t fbo); + EXPORT void insert(LBID_t lbid, VER_t ver, OID_t oid, uint32_t fbo, bool loading = false); EXPORT void getBlocks(int num, OID_t vbOID, std::vector &vbRanges, VSS& vss, bool flushPMCache); EXPORT void removeEntry(LBID_t, VER_t ver); - + EXPORT int size() const; EXPORT bool hashEmpty() const; EXPORT int checkConsistency() const; @@ -186,16 +193,16 @@ class VBBM : public Undoable { #ifdef BRM_DEBUG EXPORT int getShmid() const; #endif - + private: VBBM(const VBBM &); VBBM& operator=(const VBBM &); - + VBShmsegHeader *vbbm; VBFileMetadata *files; int *hashBuckets; VBBMEntry *storage; - + key_t currentVBBMShmkey; int vbbmShmid; bool r_only; @@ -206,11 +213,12 @@ class VBBM : public Undoable { key_t chooseShmkey() const; void growVBBM(bool addAFile = false); + void growForLoad(int count); void copyVBBM(VBShmsegHeader *dest); void initShmseg(int nFiles); - + void _insert(VBBMEntry& e, VBShmsegHeader* dest, int* destTable, VBBMEntry* - destStorage); + destStorage, bool loading = false); int getIndex(LBID_t lbid, VER_t verID, int& prev, int& bucket) const; ShmKeys fShmKeys; VBBMImpl* fPVBBMImpl; diff --git a/versioning/BRM/vss.cpp b/versioning/BRM/vss.cpp index e74422d5..99b7e890 100644 --- a/versioning/BRM/vss.cpp +++ b/versioning/BRM/vss.cpp @@ -25,7 +25,7 @@ #include //#define NDEBUG #include - + #include #include #include @@ -59,7 +59,7 @@ using namespace idbdatafile; namespace BRM { -VSSEntry::VSSEntry() +VSSEntry::VSSEntry() { lbid = -1; verID = 0; @@ -101,7 +101,7 @@ VSSImpl::VSSImpl(unsigned key, off_t size, bool readOnly) : { } -VSS::VSS() +VSS::VSS() { vss = 0; hashBuckets = 0; @@ -113,7 +113,7 @@ VSS::VSS() fPVSSImpl = 0; } -VSS::~VSS() +VSS::~VSS() { } @@ -126,9 +126,9 @@ void VSS::lock(OPS op) vssShminfo = mst.getTable_read(MasterSegmentTable::VSSSegment); mutex.lock(); } - else + else vssShminfo = mst.getTable_write(MasterSegmentTable::VSSSegment); - + // this means that either the VSS isn't attached or that it was resized if (!fPVSSImpl || fPVSSImpl->key() != (unsigned)vssShminfo->tableShmkey) { if (vssShminfo->allocdSize == 0) @@ -164,7 +164,7 @@ void VSS::lock(OPS op) shmseg = reinterpret_cast(vss); hashBuckets = reinterpret_cast (&shmseg[sizeof(VSSShmsegHeader)]); - storage = reinterpret_cast(&shmseg[sizeof(VSSShmsegHeader) + + storage = reinterpret_cast(&shmseg[sizeof(VSSShmsegHeader) + vss->numHashBuckets*sizeof(int)]); if (op == READ) @@ -177,7 +177,7 @@ void VSS::lock(OPS op) shmseg = reinterpret_cast(vss); hashBuckets = reinterpret_cast (&shmseg[sizeof(VSSShmsegHeader)]); - storage = reinterpret_cast(&shmseg[sizeof(VSSShmsegHeader) + + storage = reinterpret_cast(&shmseg[sizeof(VSSShmsegHeader) + vss->numHashBuckets*sizeof(int)]); if (op == READ) mutex.unlock(); @@ -193,25 +193,25 @@ void VSS::release(OPS op) mst.releaseTable_write(MasterSegmentTable::VSSSegment); } -void VSS::initShmseg() +void VSS::initShmseg() { int i; char *newshmseg; int *buckets; VSSEntry *stor; - + vss->capacity = VSSSTORAGE_INITIAL_SIZE/sizeof(VSSEntry); vss->currentSize = 0; vss->lockedEntryCount = 0; vss->LWM = 0; vss->numHashBuckets = VSSTABLE_INITIAL_SIZE/sizeof(int); newshmseg = reinterpret_cast(vss); - + buckets = reinterpret_cast (&newshmseg[sizeof(VSSShmsegHeader)]); - stor = reinterpret_cast(&newshmseg[sizeof(VSSShmsegHeader) + - vss->numHashBuckets*sizeof(int)]); - + stor = reinterpret_cast(&newshmseg[sizeof(VSSShmsegHeader) + + vss->numHashBuckets*sizeof(int)]); + for (i = 0; i < vss->numHashBuckets; i++) buckets[i] = -1; for (i = 0; i < vss->capacity; i++) @@ -224,12 +224,12 @@ void VSS::growVSS() int allocSize; key_t newshmkey; char *newshmseg; - + if (vssShminfo->allocdSize == 0) allocSize = VSS_INITIAL_SIZE; else allocSize = vssShminfo->allocdSize + VSS_INCREMENT; - + newshmkey = chooseShmkey(); idbassert((allocSize == VSS_INITIAL_SIZE && !fPVSSImpl) || fPVSSImpl); if (fPVSSImpl) @@ -265,10 +265,58 @@ void VSS::growVSS() newshmseg = reinterpret_cast(vss); hashBuckets = reinterpret_cast (&newshmseg[sizeof(VSSShmsegHeader)]); - storage = reinterpret_cast(&newshmseg[sizeof(VSSShmsegHeader) + + storage = reinterpret_cast(&newshmseg[sizeof(VSSShmsegHeader) + vss->numHashBuckets*sizeof(int)]); } +//assumes write lock is held +void VSS::growForLoad(int elementCount) +{ + int allocSize; + key_t newshmkey; + char *newshmseg; + int i; + + if (elementCount < VSSSTORAGE_INITIAL_COUNT) + elementCount = VSSSTORAGE_INITIAL_COUNT; + /* round up to the next normal increment out of paranoia */ + if (elementCount % VSSSTORAGE_INCREMENT_COUNT) + elementCount = ((elementCount/VSSSTORAGE_INCREMENT_COUNT) + 1) * VSSSTORAGE_INCREMENT_COUNT; + allocSize = VSS_SIZE(elementCount); + + newshmkey = chooseShmkey(); + if (fPVSSImpl) + { + // isn't this the same as makeVSSImpl()? + BRMShmImpl newShm(newshmkey, allocSize); + fPVSSImpl->swapout(newShm); + } + else + { + fPVSSImpl = VSSImpl::makeVSSImpl(newshmkey, allocSize); + } + + vss = fPVSSImpl->get(); + vss->capacity = elementCount; + vss->currentSize = 0; + vss->LWM = 0; + vss->numHashBuckets = elementCount/4; + vss->lockedEntryCount = 0; + undoRecords.clear(); + newshmseg = reinterpret_cast(vss); + hashBuckets = reinterpret_cast + (&newshmseg[sizeof(VSSShmsegHeader)]); + storage = reinterpret_cast(&newshmseg[sizeof(VSSShmsegHeader) + + vss->numHashBuckets*sizeof(int)]); + for (i = 0; i < vss->capacity; i++) + storage[i].lbid = -1; + for (i = 0; i < vss->numHashBuckets; i++) + hashBuckets[i] = -1; + + vssShminfo->tableShmkey = newshmkey; + vssShminfo->allocdSize = allocSize; +} + //assumes write lock is held and the src is vbbm //and that dest->{numHashBuckets, capacity, LWM} have been set. void VSS::copyVSS(VSSShmsegHeader *dest) @@ -277,7 +325,7 @@ void VSS::copyVSS(VSSShmsegHeader *dest) int *newHashtable; VSSEntry *newStorage; char *cDest = reinterpret_cast(dest); - + // copy metadata dest->currentSize = vss->currentSize; dest->lockedEntryCount = vss->lockedEntryCount; @@ -285,19 +333,19 @@ void VSS::copyVSS(VSSShmsegHeader *dest) newHashtable = reinterpret_cast(&cDest[sizeof(VSSShmsegHeader)]); newStorage = reinterpret_cast(&cDest[sizeof(VSSShmsegHeader) + dest->numHashBuckets*sizeof(int)]); - + //initialize new storage & hash for (i = 0; i < dest->numHashBuckets; i++) newHashtable[i] = -1; - + for (i = 0; i < dest->capacity; i++) newStorage[i].lbid = -1; - + //walk the storage & re-hash all entries; for (i = 0; i < vss->currentSize; i++) if (storage[i].lbid != -1) { - _insert(storage[i], dest, newHashtable, newStorage); - confirmChanges(); + _insert(storage[i], dest, newHashtable, newStorage, true); + //confirmChanges(); } } @@ -305,20 +353,20 @@ key_t VSS::chooseShmkey() const { int fixedKeys = 1; key_t ret; - - if (vssShminfo->tableShmkey + 1 == (key_t) (fShmKeys.KEYRANGE_VSS_BASE + + + if (vssShminfo->tableShmkey + 1 == (key_t) (fShmKeys.KEYRANGE_VSS_BASE + fShmKeys.KEYRANGE_SIZE - 1) || (unsigned)vssShminfo->tableShmkey < fShmKeys.KEYRANGE_VSS_BASE) ret = fShmKeys.KEYRANGE_VSS_BASE + fixedKeys; - else + else ret = vssShminfo->tableShmkey + 1; return ret; -} +} -void VSS::insert(LBID_t lbid, VER_t verID, bool vbFlag, bool locked) +void VSS::insert(LBID_t lbid, VER_t verID, bool vbFlag, bool locked, bool loading) { VSSEntry entry; - + #ifdef BRM_DEBUG if (lbid < 0) { log("VSS::insert(): lbid must be >= 0", logging::LOG_TYPE_DEBUG); @@ -329,7 +377,7 @@ void VSS::insert(LBID_t lbid, VER_t verID, bool vbFlag, bool locked) throw invalid_argument("VSS::insert(): verID must be >= 0"); } #endif - + entry.lbid = lbid; entry.verID = verID; entry.vbFlag = vbFlag; @@ -338,25 +386,26 @@ void VSS::insert(LBID_t lbid, VER_t verID, bool vbFlag, bool locked) // check for resize if (vss->currentSize == vss->capacity) growVSS(); - - _insert(entry, vss, hashBuckets, storage); - makeUndoRecord(&vss->currentSize, sizeof(vss->currentSize)); + + _insert(entry, vss, hashBuckets, storage, loading); + if (!loading) + makeUndoRecord(&vss->currentSize, sizeof(vss->currentSize)); vss->currentSize++; if (locked) vss->lockedEntryCount++; } - - + + //assumes write lock is held and that it is properly sized already //metadata is modified by the caller -void VSS::_insert(VSSEntry& e, VSSShmsegHeader *dest, int *destHash, - VSSEntry *destStorage) +void VSS::_insert(VSSEntry& e, VSSShmsegHeader *dest, int *destHash, + VSSEntry *destStorage, bool loading) { int hashIndex, insertIndex; - - hashIndex = e.lbid % dest->numHashBuckets; - + + hashIndex = hasher((char*) &e.lbid, sizeof(e.lbid)) % dest->numHashBuckets; + insertIndex = dest->LWM; while (destStorage[insertIndex].lbid != -1) { insertIndex++; @@ -368,16 +417,19 @@ void VSS::_insert(VSSEntry& e, VSSShmsegHeader *dest, int *destHash, } #endif } - makeUndoRecord(dest, sizeof(VSSShmsegHeader)); + if (!loading) + makeUndoRecord(dest, sizeof(VSSShmsegHeader)); dest->LWM = insertIndex + 1; - makeUndoRecord(&destStorage[insertIndex], sizeof(VSSEntry)); - makeUndoRecord(&destHash[hashIndex], sizeof(int)); + if (!loading) { + makeUndoRecord(&destStorage[insertIndex], sizeof(VSSEntry)); + makeUndoRecord(&destHash[hashIndex], sizeof(int)); + } e.next = destHash[hashIndex]; destStorage[insertIndex] = e; destHash[hashIndex] = insertIndex; } - + //assumes read lock is held int VSS::lookup(LBID_t lbid, const QueryContext_vss &verInfo, VER_t txnID, VER_t *outVer, bool *vbFlag, bool vbOnly) const @@ -400,7 +452,7 @@ int VSS::lookup(LBID_t lbid, const QueryContext_vss &verInfo, VER_t txnID, VER_t } #endif - hashIndex = lbid % vss->numHashBuckets; + hashIndex = hasher((char *) &lbid, sizeof(lbid)) % vss->numHashBuckets; currentIndex = hashBuckets[hashIndex]; while (currentIndex != -1) { @@ -409,7 +461,7 @@ int VSS::lookup(LBID_t lbid, const QueryContext_vss &verInfo, VER_t txnID, VER_t if (vbOnly && !listEntry->vbFlag) goto next; - + /* "if it is/was part of a different transaction, ignore it" */ if (txnID != listEntry->verID && @@ -457,7 +509,7 @@ VER_t VSS::getCurrentVersion(LBID_t lbid, bool *isLocked) const int hashIndex, currentIndex; VSSEntry *listEntry; - hashIndex = lbid % vss->numHashBuckets; + hashIndex = hasher((char *) &lbid, sizeof(lbid)) % vss->numHashBuckets; currentIndex = hashBuckets[hashIndex]; while (currentIndex != -1) { listEntry = &storage[currentIndex]; @@ -479,7 +531,7 @@ VER_t VSS::getHighestVerInVB(LBID_t lbid, VER_t max) const VER_t ret = -1; VSSEntry *listEntry; - hashIndex = lbid % vss->numHashBuckets; + hashIndex = hasher((char *) &lbid, sizeof(lbid)) % vss->numHashBuckets; currentIndex = hashBuckets[hashIndex]; while (currentIndex != -1) { listEntry = &storage[currentIndex]; @@ -496,7 +548,7 @@ bool VSS::isVersioned(LBID_t lbid, VER_t version) const int hashIndex, currentIndex; VSSEntry *listEntry; - hashIndex = lbid % vss->numHashBuckets; + hashIndex = hasher((char *) &lbid, sizeof(lbid)) % vss->numHashBuckets; currentIndex = hashBuckets[hashIndex]; while (currentIndex != -1) { listEntry = &storage[currentIndex]; @@ -512,12 +564,12 @@ bool VSS::isLocked(const LBIDRange& range, VER_t transID) const int hashIndex, currentIndex; LBID_t currentBlock; VSSEntry *listEntry; - - for (currentBlock = range.start; + + for (currentBlock = range.start; currentBlock < range.start + range.size; currentBlock++) { - hashIndex = currentBlock % vss->numHashBuckets; + hashIndex = hasher((char *) ¤tBlock, sizeof(currentBlock)) % vss->numHashBuckets; currentIndex = hashBuckets[hashIndex]; while (currentIndex != -1) { @@ -526,7 +578,7 @@ bool VSS::isLocked(const LBIDRange& range, VER_t transID) const { if (listEntry->verID == transID) return false; - else + else return true; } currentIndex = listEntry->next; @@ -550,21 +602,21 @@ void VSS::removeEntry(LBID_t lbid, VER_t verID, vector *flushList) throw invalid_argument("VSS::removeEntry(): verID must be >= 0"); } #endif - + index = getIndex(lbid, verID, prev, bucket); if (index == -1) { #ifdef BRM_DEBUG ostringstream ostr; - ostr << "VSS::removeEntry(): that entry doesn't exist lbid = " << + ostr << "VSS::removeEntry(): that entry doesn't exist lbid = " << lbid << " verID = " << verID; log(ostr.str(), logging::LOG_TYPE_DEBUG); throw logic_error(ostr.str()); #else return; -#endif +#endif } - + makeUndoRecord(&storage[index], sizeof(VSSEntry)); storage[index].lbid = -1; if (prev != -1) { @@ -582,15 +634,15 @@ void VSS::removeEntry(LBID_t lbid, VER_t verID, vector *flushList) if (index < vss->LWM) vss->LWM = index; - // scan the list of entries with that lbid to see if there are others + // scan the list of entries with that lbid to see if there are others // to remove. for (index = hashBuckets[bucket]; index != -1; index = storage[index].next) if (storage[index].lbid == lbid && (storage[index].vbFlag || storage[index].locked)) return; - + // if execution gets here, we should be able to remove all entries // with the given lbid because none point to the VB. - for (prev = -1, index = hashBuckets[bucket]; + for (prev = -1, index = hashBuckets[bucket]; index != -1; index = storage[index].next) { if (storage[index].lbid == lbid) { makeUndoRecord(&storage[index], sizeof(VSSEntry)); @@ -621,7 +673,7 @@ bool VSS::isTooOld(LBID_t lbid, VER_t verID) const VER_t minVer = 0; VSSEntry *listEntry; - bucket = lbid % vss->numHashBuckets; + bucket = hasher((char *) &lbid, sizeof(lbid)) % vss->numHashBuckets; index = hashBuckets[bucket]; while (index != -1) { @@ -637,7 +689,7 @@ bool VSS::isEntryLocked(LBID_t lbid, VER_t verID) const { int index; int bucket; - + if (lbid == -1) return false; /* See bug 3287 for info on these code blocks */ @@ -651,8 +703,8 @@ bool VSS::isEntryLocked(LBID_t lbid, VER_t verID) const /* This version considers any locked entry for an LBID to mean the block is locked. VSSEntry *listEntry; - bucket = lbid % vss->numHashBuckets; - + bucket = hasher((char *) &lbid, sizeof(lbid)) % vss->numHashBuckets; + index = hashBuckets[bucket]; while (index != -1) { listEntry = &storage[index]; @@ -678,7 +730,7 @@ bool VSS::isEntryLocked(LBID_t lbid, VER_t verID) const bool hasALockedEntry = false; VER_t rollbackVersion = 0; - bucket = lbid % vss->numHashBuckets; + bucket = hasher((char *) &lbid, sizeof(lbid)) % vss->numHashBuckets; index = hashBuckets[bucket]; while (index != -1) { @@ -699,9 +751,9 @@ int VSS::getIndex(LBID_t lbid, VER_t verID, int &prev, int &bucket) const { int currentIndex; VSSEntry *listEntry; - + prev = -1; - bucket = lbid % vss->numHashBuckets; + bucket = hasher((char *) &lbid, sizeof(lbid)) % vss->numHashBuckets; currentIndex = hashBuckets[bucket]; while (currentIndex != -1) { @@ -715,7 +767,7 @@ int VSS::getIndex(LBID_t lbid, VER_t verID, int &prev, int &bucket) const } //write lock -void VSS::setVBFlag(LBID_t lbid, VER_t verID, bool vbFlag) +void VSS::setVBFlag(LBID_t lbid, VER_t verID, bool vbFlag) { int index, prev, bucket; @@ -729,12 +781,12 @@ void VSS::setVBFlag(LBID_t lbid, VER_t verID, bool vbFlag) throw invalid_argument("VSS::setVBFlag(): verID must be >= 0"); } #endif - + index = getIndex(lbid, verID, prev, bucket); if (index == -1) { ostringstream ostr; - - ostr << "VSS::setVBFlag(): that entry doesn't exist lbid=" << lbid << + + ostr << "VSS::setVBFlag(): that entry doesn't exist lbid=" << lbid << " ver=" << verID; log(ostr.str(), logging::LOG_TYPE_DEBUG); throw logic_error(ostr.str()); @@ -747,14 +799,14 @@ void VSS::setVBFlag(LBID_t lbid, VER_t verID, bool vbFlag) void VSS::commit(VER_t txnID) { int i; - + #ifdef BRM_DEBUG if (txnID < 1) { log("VSS::commit(): txnID must be > 0", logging::LOG_TYPE_DEBUG); throw invalid_argument("VSS::commit(): txnID must be > 0"); } -#endif - +#endif + for (i = 0; i < vss->capacity; i++) if (storage[i].lbid != -1 && storage[i].verID == txnID) { #ifdef BRM_DEBUG @@ -773,23 +825,23 @@ void VSS::commit(VER_t txnID) vss->lockedEntryCount--; } } - + //read lock void VSS::getUncommittedLBIDs(VER_t txnID, vector& lbids) { int i; - + lbids.clear(); - + #ifdef BRM_DEBUG if (txnID < 1) { - log("VSS::getUncommittedLBIDs(): txnID must be > 0", + log("VSS::getUncommittedLBIDs(): txnID must be > 0", logging::LOG_TYPE_DEBUG); throw invalid_argument("VSS::getUncommittedLBIDs(): txnID must be > 0"); } -#endif +#endif - for (i = 0; i < vss->capacity; i++) + for (i = 0; i < vss->capacity; i++) if (storage[i].lbid != -1 && storage[i].verID == txnID) { #ifdef BRM_DEBUG if (storage[i].locked == false) { @@ -805,14 +857,14 @@ void VSS::getUncommittedLBIDs(VER_t txnID, vector& lbids) #endif lbids.push_back(storage[i].lbid); } - + } void VSS::getUnlockedLBIDs(BlockList_t& lbids) { lbids.clear(); - for (int i = 0; i < vss->capacity; i++) + for (int i = 0; i < vss->capacity; i++) if (storage[i].lbid != -1 && !storage[i].locked) lbids.push_back(LVP_t(storage[i].lbid, storage[i].verID)); } @@ -821,7 +873,7 @@ void VSS::getLockedLBIDs(BlockList_t& lbids) { lbids.clear(); - for (int i = 0; i < vss->capacity; i++) + for (int i = 0; i < vss->capacity; i++) if (storage[i].lbid != -1 && storage[i].locked) lbids.push_back(LVP_t(storage[i].lbid, storage[i].verID)); } @@ -832,10 +884,10 @@ void VSS::removeEntriesFromDB(const LBIDRange& range, VBBM& vbbm, bool use_vbbm) { int bucket, index, prev; LBID_t lastLBID, lbid; - + #ifdef BRM_DEBUG if (range.start < 0) { - log("VSS::removeEntriesFromDB(): lbids must be positive.", + log("VSS::removeEntriesFromDB(): lbids must be positive.", logging::LOG_TYPE_DEBUG); throw invalid_argument("VSS::removeEntriesFromDB(): lbids must be positive."); } @@ -849,8 +901,8 @@ void VSS::removeEntriesFromDB(const LBIDRange& range, VBBM& vbbm, bool use_vbbm) lastLBID = range.start + range.size - 1; for (lbid = range.start; lbid <= lastLBID; lbid++) { - bucket = lbid % vss->numHashBuckets; - + bucket = hasher((char *) &lbid, sizeof(lbid)) % vss->numHashBuckets; + for (prev = -1, index = hashBuckets[bucket]; index != -1; index = storage[index].next) { if (storage[index].lbid == lbid) { @@ -881,27 +933,27 @@ void VSS::removeEntriesFromDB(const LBIDRange& range, VBBM& vbbm, bool use_vbbm) int VSS::size() const { int i, ret = 0; - - for (i = 0; i < vss->capacity; i++) + + for (i = 0; i < vss->capacity; i++) if (storage[i].lbid != -1) ret++; - + if (ret != vss->currentSize) { ostringstream ostr; - ostr << "VSS: actual size & recorded size disagree. actual size = " + ostr << "VSS: actual size & recorded size disagree. actual size = " << ret << " recorded size = " << vss->currentSize; log(ostr.str(), logging::LOG_TYPE_DEBUG); throw logic_error(ostr.str()); } - + return ret; } bool VSS::hashEmpty() const { int i; - + for (i = 0; i < vss->numHashBuckets; i++) if (hashBuckets[i] != -1) return false; @@ -909,7 +961,7 @@ bool VSS::hashEmpty() const } void VSS::clear() -{ +{ int allocSize; key_t newshmkey; char *newshmseg; @@ -949,20 +1001,20 @@ int VSS::checkConsistency(const VBBM &vbbm, ExtentMap &em) const c. each hash table entry points to a non-empty element or -1 d. verify that there are no empty entries below the LWM e. verify uniqueness of the entries - + */ - + int i, j, k, err; - + /* Test 1 */ - + OID_t oid; uint32_t fbo; - + for (i = 0; i < vss->capacity; i++) { if (storage[i].lbid != -1) { if (storage[i].vbFlag) { - err = vbbm.lookup(storage[i].lbid, storage[i].verID, oid, + err = vbbm.lookup(storage[i].lbid, storage[i].verID, oid, fbo); if (err != 0) { cerr << "VSS: lbid=" << storage[i].lbid << " verID=" << @@ -989,35 +1041,35 @@ int VSS::checkConsistency(const VBBM &vbbm, ExtentMap &em) const } /* Test 2a is already implemented */ - size(); - + size(); + /* Tests 2b & 2c - no empty elements reachable from the hash table */ - + int nextElement; - + for (i = 0; i < vss->numHashBuckets; i++) { if (hashBuckets[i] != -1) - for (nextElement = hashBuckets[i]; nextElement != -1; + for (nextElement = hashBuckets[i]; nextElement != -1; nextElement = storage[nextElement].next) if (storage[nextElement].lbid == -1) throw logic_error("VSS::checkConsistency(): an empty storage entry is reachable from the hash table"); } - + /* Test 2d - verify that there are no empty entries below the LWM */ - + for (i = 0; i < vss->LWM; i++) if (storage[i].lbid == -1) { cerr << "VSS: LWM=" << vss->LWM << " first empty entry=" << i << endl; throw logic_error("VSS::checkConsistency(): LWM accounting error"); } - + /* Test 2e - verify uniqueness of each entry */ - for (i = 0; i < vss->numHashBuckets; i++) + for (i = 0; i < vss->numHashBuckets; i++) if (hashBuckets[i] != -1) - for (j = hashBuckets[i]; j != -1; j = storage[j].next) + for (j = hashBuckets[i]; j != -1; j = storage[j].next) for (k = storage[j].next; k != -1; k = storage[k].next) - if (storage[j].lbid == storage[k].lbid && + if (storage[j].lbid == storage[k].lbid && storage[j].verID == storage[k].verID) { cerr << "VSS: lbid=" << storage[j].lbid << " verID=" << storage[j].verID << endl; @@ -1034,8 +1086,8 @@ void VSS::setReadOnly() void VSS::getCurrentTxnIDs(set &list) const { int i; - - for (i = 0; i < vss->capacity; i++) + + for (i = 0; i < vss->capacity; i++) if (storage[i].lbid != -1 && storage[i].locked) list.insert(storage[i].verID); } @@ -1069,7 +1121,7 @@ void VSS::save(string filename) log_errno("VSS::save()"); throw runtime_error("VSS::save(): Failed to open the file"); } - + header.magic = VSS_MAGIC_V1; header.entries = vss->currentSize; @@ -1096,7 +1148,7 @@ void VSS::save(string filename) throw runtime_error("VSS::save(): Failed to open the file"); } out.exceptions(ios_base::badbit); - + header.magic = VSS_MAGIC_V1; header.entries = vss->currentSize; @@ -1141,12 +1193,19 @@ bool VSS::isEmpty(bool useLock) return rc; } + +//#include "boost/date_time/posix_time/posix_time.hpp" +//using namespace boost::posix_time; + void VSS::load(string filename) { int i; struct Header header; struct VSSEntry entry; + //ptime time1, time2; + //time1 = microsec_clock::local_time(); + //cout << "loading the VSS " << time1 << endl; const char* filename_p = filename.c_str(); scoped_ptr in(IDBDataFile::open( IDBPolicy::getType(filename_p, IDBPolicy::WRITEENG), @@ -1170,6 +1229,9 @@ void VSS::load(string filename) throw runtime_error("VSS::load(): Bad size. Not a VSS file?"); } + growForLoad(header.entries); + +/* for (i = 0; i < vss->capacity; i++) storage[i].lbid = -1; for (i = 0; i < vss->numHashBuckets; i++) @@ -1177,15 +1239,18 @@ void VSS::load(string filename) vss->currentSize = 0; vss->lockedEntryCount = 0; vss->LWM = 0; +*/ for (i = 0; i < header.entries; i++) { if (in->read((char *)&entry, sizeof(entry)) != sizeof(entry)) { log_errno("VSS::load()"); throw runtime_error("VSS::load(): Failed to read entry"); } - insert(entry.lbid, entry.verID, entry.vbFlag, entry.locked); - confirmChanges(); + insert(entry.lbid, entry.verID, entry.vbFlag, entry.locked, true); } + + //time2 = microsec_clock::local_time(); + //cout << "done loading " << time2 << " duration: " << time2-time1 << endl; } #ifndef __LP64__ @@ -1241,8 +1306,7 @@ void VSS::load64(string filename) log_errno("VSS::load()"); throw runtime_error("VSS::load(): Failed to read entry"); } - insert(entry.lbid, entry.verID, entry.vbFlag, entry.locked); - confirmChanges(); + insert(entry.lbid, entry.verID, entry.vbFlag, entry.locked, true); } } #endif diff --git a/versioning/BRM/vss.h b/versioning/BRM/vss.h index ffdca137..adf34786 100644 --- a/versioning/BRM/vss.h +++ b/versioning/BRM/vss.h @@ -20,7 +20,7 @@ * *****************************************************************************/ -/** @file +/** @file * class XXX interface */ @@ -38,6 +38,7 @@ #include "undoable.h" #include "mastersegmenttable.h" #include "shmkeys.h" +#include "hasher.h" #ifdef NONE #undef NONE @@ -52,18 +53,23 @@ // These config parameters need to be loaded //will get a small hash function performance boost by using powers of 2 -#define VSSSTORAGE_INITIAL_SIZE (200000*sizeof(VSSEntry)) -#define VSSSTORAGE_INCREMENT (20000*sizeof(VSSEntry)) +#define VSSSTORAGE_INITIAL_COUNT 200000 +#define VSSSTORAGE_INITIAL_SIZE (VSSSTORAGE_INITIAL_COUNT*sizeof(VSSEntry)) +#define VSSSTORAGE_INCREMENT_COUNT 20000 +#define VSSSTORAGE_INCREMENT (VSSSTORAGE_INCREMENT_COUNT*sizeof(VSSEntry)) // (average list length = 4) -#define VSSTABLE_INITIAL_SIZE (50000*sizeof(int)) +#define VSSTABLE_INITIAL_SIZE (50000*sizeof(int)) #define VSSTABLE_INCREMENT (5000*sizeof(int)) #define VSS_INITIAL_SIZE (sizeof(VSSShmsegHeader) + \ VSSSTORAGE_INITIAL_SIZE + VSSTABLE_INITIAL_SIZE) - + #define VSS_INCREMENT (VSSTABLE_INCREMENT + VSSSTORAGE_INCREMENT) +#define VSS_SIZE(entries) \ + ((entries*sizeof(VSSEntry)) + (entries/4 * sizeof(int)) + sizeof(VSSShmsegHeader)) + #if defined(_MSC_VER) && defined(xxxVSS_DLLEXPORT) #define EXPORT __declspec(dllexport) #else @@ -90,7 +96,7 @@ struct VSSShmsegHeader { int LWM; int numHashBuckets; int lockedEntryCount; - + // the rest of the overlay looks like this // int hashBuckets[numHashBuckets]; // VSSEntry storage[capacity]; @@ -143,7 +149,7 @@ class ExtentMap; /** @brief The Version Substitution Structure (VSS) * * At a high level, the VSS maintains a table that associates an LBID with - * a version number and 2 flags that indicate whether or not the block + * a version number and 2 flags that indicate whether or not the block * identified by the pair exists in the main database files * or the Version Buffer. The VSS's main purpose is to resolve the version of * a specified block the caller can safely use given that there may be concurrent @@ -154,16 +160,16 @@ class ExtentMap; * each valid entry points to the head of a unique list. Each list element * contains the LBID, VerID, & the two flags that encapsulate "an entry in the * VSS table". Every list contains all elements that collide on that hash table - * entry that points to it, "load factor" has no bearing on performance, + * entry that points to it, "load factor" has no bearing on performance, * and lists can grow arbitrarily large. * Technically lookups are O(n), but in normal circumstances it'll - * be constant time. As things are right now, we expect there to be about + * be constant time. As things are right now, we expect there to be about * 200k VSS entries. The hash table is sized such that on average there will be 4 * entries per list when it's at capacity. * * The memory management & structure manipulation code is nearly identical * to that in the VBBM, so any bugs found here are likely there as well. - * + * * Shared memory is managed using code similar to the ExtentMap & VBBM. When * the shared memory segment needs to grow, it is write-locked, a new one * is created, the contents are reinserted to the new one, the key is @@ -173,19 +179,19 @@ class ExtentMap; class VSS : public Undoable { public: - + enum OPS { NONE, READ, WRITE }; - + EXPORT VSS(); EXPORT ~VSS(); - + EXPORT bool isLocked(const LBIDRange& l, VER_t txnID = -1) const; EXPORT void removeEntry(LBID_t lbid, VER_t verID, std::vector *flushList); - + // Note, the use_vbbm switch should be used for unit testing the VSS only EXPORT void removeEntriesFromDB(const LBIDRange& range, VBBM& vbbm, bool use_vbbm = true); EXPORT int lookup(LBID_t lbid, const QueryContext_vss &, VER_t txnID, VER_t *outVer, @@ -201,14 +207,14 @@ class VSS : public Undoable { EXPORT bool isVersioned(LBID_t lbid, VER_t version) const; EXPORT void setVBFlag(LBID_t lbid, VER_t verID, bool vbFlag); - EXPORT void insert(LBID_t, VER_t, bool vbFlag, bool locked); + EXPORT void insert(LBID_t, VER_t, bool vbFlag, bool locked, bool loading=false); EXPORT void commit(VER_t txnID); EXPORT void getUncommittedLBIDs(VER_t txnID, std::vector& lbids); EXPORT void getUnlockedLBIDs(BlockList_t& lbids); EXPORT void getLockedLBIDs(BlockList_t& lbids); EXPORT void lock(OPS op); EXPORT void release(OPS op); - EXPORT void setReadOnly(); + EXPORT void setReadOnly(); EXPORT int checkConsistency(const VBBM &vbbm, ExtentMap &em) const; EXPORT int size() const; @@ -228,8 +234,8 @@ class VSS : public Undoable { #endif EXPORT bool isEmpty(bool doLock = true); - - /* Bug 2293. VBBM will use this fcn to determine whether a block is + + /* Bug 2293. VBBM will use this fcn to determine whether a block is * currently in use. */ EXPORT bool isEntryLocked(LBID_t lbid, VER_t verID) const; EXPORT bool isTooOld(LBID_t lbid, VER_t verID) const; @@ -237,7 +243,7 @@ class VSS : public Undoable { private: VSS(const VSS &); VSS& operator=(const VSS &); - + struct VSSShmsegHeader *vss; int *hashBuckets; VSSEntry *storage; @@ -247,20 +253,22 @@ class VSS : public Undoable { key_t currentVSSShmkey; int vssShmid; MSTEntry *vssShminfo; - MasterSegmentTable mst; + MasterSegmentTable mst; static const int MAX_IO_RETRIES=10; key_t chooseShmkey() const; void growVSS(); + void growForLoad(int count); void initShmseg(); void copyVSS(VSSShmsegHeader *dest); - + int getIndex(LBID_t lbid, VER_t verID, int& prev, int& bucket) const; void _insert(VSSEntry& e, VSSShmsegHeader* dest, int* destTable, VSSEntry* - destStorage); + destStorage, bool loading=false); ShmKeys fShmKeys; VSSImpl* fPVSSImpl; + utils::Hasher hasher; }; } diff --git a/writeengine/bulk/we_bulkloadbuffer.cpp b/writeengine/bulk/we_bulkloadbuffer.cpp index ac285d44..0fa8c196 100644 --- a/writeengine/bulk/we_bulkloadbuffer.cpp +++ b/writeengine/bulk/we_bulkloadbuffer.cpp @@ -2203,7 +2203,8 @@ void BulkLoadBuffer::tokenize( bRowGenAutoInc = true; } else if (jobCol.dataType == - CalpontSystemCatalog::VARBINARY) + CalpontSystemCatalog::VARBINARY && + (bValidRow)) { bValidRow = false; @@ -2272,27 +2273,6 @@ void BulkLoadBuffer::tokenize( validationErrMsg = ossErrMsg.str(); } - // @bug 4037: When cmd line option set, treat char - // and varchar fields that are too long as errors - else if (getTruncationAsError()) - { - if ((jobCol.dataType == - CalpontSystemCatalog::VARCHAR || - jobCol.dataType == - CalpontSystemCatalog::CHAR) - && (fTokens[curRowNum1][curCol].offset > - jobCol.definedWidth)) - { - bValidRow = false; - ostringstream ossErrMsg; - ossErrMsg << INPUT_ERROR_STRING_TOO_LONG << - "field " << (curFld+1) << - " longer than " << jobCol.definedWidth<< - " bytes"; - validationErrMsg = ossErrMsg.str(); - } - } - // @bug 3478: Truncate instead of rejecting dctnry // strings>8000. Only reject numeric cols>1000 bytes else if ((fTokens[curRowNum1][curCol].offset > @@ -2312,6 +2292,29 @@ void BulkLoadBuffer::tokenize( break; } } // end of switch on offset + + // @bug 4037: When cmd line option set, treat char + // and varchar fields that are too long as errors + if (getTruncationAsError() && bValidRow && + (fTokens[curRowNum1][curCol].offset != + COLPOSPAIR_NULL_TOKEN_OFFSET)) + { + if ((jobCol.dataType == CalpontSystemCatalog::VARCHAR || + jobCol.dataType == CalpontSystemCatalog::CHAR) && + (fTokens[curRowNum1][curCol].offset > + jobCol.definedWidth)) + { + bValidRow = false; + + ostringstream ossErrMsg; + ossErrMsg << INPUT_ERROR_STRING_TOO_LONG << + "field " << (curFld+1) << + " longer than " << jobCol.definedWidth<< + " bytes"; + validationErrMsg = ossErrMsg.str(); + } + } + } // end of "if (offset)" else { diff --git a/writeengine/splitter/we_cmdargs.cpp b/writeengine/splitter/we_cmdargs.cpp index 2644b466..7cfd1c2e 100644 --- a/writeengine/splitter/we_cmdargs.cpp +++ b/writeengine/splitter/we_cmdargs.cpp @@ -33,6 +33,7 @@ using namespace std; #include #include #include +#include #include "liboamcpp.h" using namespace oam; @@ -74,7 +75,7 @@ WECmdArgs::WECmdArgs(int argc, char** argv) : fUUID(boost::uuids::nil_generator()()) { - try + try { appTestFunction(); parseCmdLineArgs(argc, argv); @@ -770,6 +771,11 @@ void WECmdArgs::parseCmdLineArgs(int argc, char** argv) else if(fBatchQty>100000) fBatchQty = 10000; break; } + case 'N': //-N no console output + { + fConsoleOutput = false; + break; + } default: { std::string aErr = "Unknown command line option " + aCh; @@ -785,6 +791,8 @@ void WECmdArgs::parseCmdLineArgs(int argc, char** argv) std::string bulkRootPath = getBulkRootDir(); + checkForBulkLogDir(bulkRootPath); + if (aJobType) { if(0==fArgMode) throw runtime_error("Incompatible mode and option types"); @@ -1636,6 +1644,58 @@ void WECmdArgs::getColumnList( std::set& columnList ) const } } +//----------------------------------------------------------------------------- +// check for the bulkload log directory. If it is not existing, create it +// w.r.t Bug 6137 +//----------------------------------------------------------------------------- + +void WECmdArgs::checkForBulkLogDir(const std::string& BulkRoot) +{ + if( !boost::filesystem::exists(BulkRoot.c_str()) ) + { + cout << "Creating directory : " << BulkRoot < VecArgs; @@ -167,7 +170,8 @@ class WECmdArgs bool fCpiInvoke; // invoke cpimport in mode 3 bool fBlockMode3; // Do not allow Mode 3 bool fbTruncationAsError; // Treat string truncation as error - boost::uuids::uuid fUUID; + boost::uuids::uuid fUUID; + bool fConsoleOutput; // If false, no output to console. }; //---------------------------------------------------------------------- From b5220b085b818670a95134e531436e2056d475d4 Mon Sep 17 00:00:00 2001 From: david hill Date: Fri, 20 Feb 2015 16:56:18 -0600 Subject: [PATCH 3/3] change stdlib location --- build/build_rpms | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/build_rpms b/build/build_rpms index f1af2b23..5bf92343 100755 --- a/build/build_rpms +++ b/build/build_rpms @@ -112,9 +112,9 @@ sed -i -e "s/@@PACKAGER@@/Packager: $packager/" \ echo done. if [ -d /usr/local/gcc45/lib64 ]; then - cp /usr/local/gcc45/lib64/libgcc_s.so.1 $buildroot/Calpont/lib - cp /usr/local/gcc45/lib64/libstdc++.so.6.0.14 $buildroot/Calpont/lib - cp /usr/local/gdb71/bin/gdb $buildroot/Calpont/bin + cp ./build/libgcc_s.so.1 $buildroot/Calpont/lib + cp ./build/libstdc++.so.6.0.14 $buildroot/Calpont/lib + cp ./build/gdb $buildroot/Calpont/bin fi echo -n "Building rpms..."