Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-5437

columnstore fails to compile to due old cs->casedn_multiply use

Details

    Description

      https://buildbot.mariadb.org/#/builders/148/builds/19518/steps/5/logs/stdio

      /home/buildbot/amd64-debian-10-deb-autobake/build/storage/columnstore/columnstore/utils/funcexp/func_lcase.cpp: In member function ‘virtual std::__cxx11::string funcexp::Func_lcase::getStrVal(rowgroup::Row&, funcexp::FunctionParm&, bool&, execplan::CalpontSystemCatalog::ColType&)’:
      /home/buildbot/amd64-debian-10-deb-autobake/build/storage/columnstore/columnstore/utils/funcexp/func_lcase.cpp:56:33: error: invalid use of member function ‘uint charset_info_st::casedn_multiply() const’ (did you forget the ‘()’ ?)
         uint64_t bufLen = inLen * cs->casedn_multiply;
                                   ~~~~^~~~~~~~~~~~~~~
      make[4]: *** [storage/columnstore/columnstore/utils/funcexp/CMakeFiles/funcexp.dir/build.make:742: storage/columnstore/columnstore/utils/funcexp/CMakeFiles/funcexp.dir/func_lcase.cpp.o] Error 1
      

      With MDEV-30661 cs->casedn_multiply became a function rather than a structure member.

      Attachments

        Issue Links

          Activity

            danblack Daniel Black created issue -
            danblack Daniel Black made changes -
            Field Original Value New Value
            danblack Daniel Black made changes -
            Priority Major [ 3 ] Blocker [ 1 ]
            bar Alexander Barkov made changes -
            Affects Version/s 6.4.7- CS only [ 28600 ]
            bar Alexander Barkov made changes -
            Affects Version/s 6.4.7- CS only [ 28600 ]

            This patch should fix the problem:

            diff --git a/utils/funcexp/func_lcase.cpp b/utils/funcexp/func_lcase.cpp
            index 7de396e47..ec1df49c3 100644
            --- a/utils/funcexp/func_lcase.cpp
            +++ b/utils/funcexp/func_lcase.cpp
            @@ -53,7 +53,7 @@ std::string Func_lcase::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& is
             
               CHARSET_INFO* cs = colType.getCharset();
               uint64_t inLen = tstr.length();
            -  uint64_t bufLen = inLen * cs->casedn_multiply;
            +  uint64_t bufLen = inLen * cs->casedn_multiply();
               char* outBuf = new char[bufLen];
             
               uint64_t outLen = cs->casedn(tstr.c_str(), inLen, outBuf, bufLen);
            diff --git a/utils/funcexp/func_ucase.cpp b/utils/funcexp/func_ucase.cpp
            index 4d78fb8b2..9ad1e22bc 100644
            --- a/utils/funcexp/func_ucase.cpp
            +++ b/utils/funcexp/func_ucase.cpp
            @@ -62,7 +62,7 @@ std::string Func_ucase::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& is
             
               CHARSET_INFO* cs = colType.getCharset();
               uint64_t inLen = tstr.length();
            -  uint64_t bufLen = inLen * cs->caseup_multiply;
            +  uint64_t bufLen = inLen * cs->caseup_multiply();
               char* outBuf = new char[bufLen];
             
               uint64_t outLen = cs->caseup(tstr.c_str(), inLen, outBuf, bufLen);
            

            bar Alexander Barkov added a comment - This patch should fix the problem: diff --git a/utils/funcexp/func_lcase.cpp b/utils/funcexp/func_lcase.cpp index 7de396e47..ec1df49c3 100644 --- a/utils/funcexp/func_lcase.cpp +++ b/utils/funcexp/func_lcase.cpp @@ -53,7 +53,7 @@ std::string Func_lcase::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool & is CHARSET_INFO* cs = colType.getCharset(); uint64_t inLen = tstr.length(); - uint64_t bufLen = inLen * cs->casedn_multiply; + uint64_t bufLen = inLen * cs->casedn_multiply(); char * outBuf = new char [bufLen]; uint64_t outLen = cs->casedn(tstr.c_str(), inLen, outBuf, bufLen); diff --git a/utils/funcexp/func_ucase.cpp b/utils/funcexp/func_ucase.cpp index 4d78fb8b2..9ad1e22bc 100644 --- a/utils/funcexp/func_ucase.cpp +++ b/utils/funcexp/func_ucase.cpp @@ -62,7 +62,7 @@ std::string Func_ucase::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool & is CHARSET_INFO* cs = colType.getCharset(); uint64_t inLen = tstr.length(); - uint64_t bufLen = inLen * cs->caseup_multiply; + uint64_t bufLen = inLen * cs->caseup_multiply(); char * outBuf = new char [bufLen]; uint64_t outLen = cs->caseup(tstr.c_str(), inLen, outBuf, bufLen);
            serg Sergei Golubchik made changes -
            Assignee Alexander Barkov [ bar ]

            Ideally we need a solution that works for all server versions starting from 10.6

            serg Sergei Golubchik added a comment - Ideally we need a solution that works for all server versions starting from 10.6
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked lower
            danblack Daniel Black added a comment - - edited

            Like:

            #if MYSQL_VERSION_ID >= 101004
            uint64_t bufLen = inLen * cs->casedn_multiply();
            #else
            uint64_t bufLen = inLen * cs->casedn_multiply;
            #endif
            

            (except neater)

            danblack Daniel Black added a comment - - edited Like: #if MYSQL_VERSION_ID >= 101004 uint64_t bufLen = inLen * cs->casedn_multiply(); #else uint64_t bufLen = inLen * cs->casedn_multiply; #endif (except neater)
            serg Sergei Golubchik made changes -
            Assignee Alexander Barkov [ bar ] Roman [ drrtuy ]
            serg Sergei Golubchik made changes -
            Fix Version/s 6.4.7- CS only [ 28600 ]
            drrtuy Roman made changes -
            Status Open [ 1 ] In Progress [ 3 ]

            danblack That works for 10.10, but 10.11 and 11.0 are also broken in the same way. The `#if` might get quite complicated quite quickly.

            TheLinuxJedi Andrew Hutchings (Inactive) added a comment - danblack That works for 10.10, but 10.11 and 11.0 are also broken in the same way. The `#if` might get quite complicated quite quickly.
            bar Alexander Barkov added a comment - - edited

            TheLinuxJedi, danblack, something like this should probably work:

            /* The API change happened in 10.10.4, 10.11.3, 11.0.2 */
            #if ((MYSQL_VERSION_ID >= 101004 && MYSQL_VERSION_ID < 101099) || \
                  (MYSQL_VERSION_ID >= 101103 && MYSQL_VERSION_ID < 101199) || \
                  MYSQL_VERSION_ID >= 110002)
            uint64_t bufLen = inLen * cs->casedn_multiply();
            #else
            uint64_t bufLen = inLen * cs->casedn_multiply;
            #endif
            

            bar Alexander Barkov added a comment - - edited TheLinuxJedi , danblack , something like this should probably work: /* The API change happened in 10.10.4, 10.11.3, 11.0.2 */ #if ((MYSQL_VERSION_ID >= 101004 && MYSQL_VERSION_ID < 101099) || \ (MYSQL_VERSION_ID >= 101103 && MYSQL_VERSION_ID < 101199) || \ MYSQL_VERSION_ID >= 110002) uint64_t bufLen = inLen * cs->casedn_multiply(); #else uint64_t bufLen = inLen * cs->casedn_multiply; #endif
            bar Alexander Barkov added a comment - - edited

            Another option (to avoid this cumbersome #if duplication) would be to move this code into a shared header file:

            /* The API change happened in 10.10.4, 10.11.3, 11.0.2 */
            #if ((MYSQL_VERSION_ID >= 101004 && MYSQL_VERSION_ID < 101099) || \
                  (MYSQL_VERSION_ID >= 101103 && MYSQL_VERSION_ID < 101199) || \
                  MYSQL_VERSION_ID >= 110002)
            #define CS_CASEDN_MULTIPLY(cs) ((cs)->casedn_multiply())
            #define CS_CASEUP_MULTIPLY(cs) ((cs)->caseup_multiply())
            #else
            #define CS_CASEDN_MULTIPLY(cs) ((cs)->casedn_multiply)
            #define CS_CASEUP_MULTIPLY(cs) ((cs)->caseup_multiply)
            #endif
            

            and include it from func_lcase.cpp and func_ucase.cpp.

            bar Alexander Barkov added a comment - - edited Another option (to avoid this cumbersome #if duplication) would be to move this code into a shared header file: /* The API change happened in 10.10.4, 10.11.3, 11.0.2 */ #if ((MYSQL_VERSION_ID >= 101004 && MYSQL_VERSION_ID < 101099) || \ (MYSQL_VERSION_ID >= 101103 && MYSQL_VERSION_ID < 101199) || \ MYSQL_VERSION_ID >= 110002) #define CS_CASEDN_MULTIPLY(cs) ((cs)->casedn_multiply()) #define CS_CASEUP_MULTIPLY(cs) ((cs)->caseup_multiply()) #else #define CS_CASEDN_MULTIPLY(cs) ((cs)->casedn_multiply) #define CS_CASEUP_MULTIPLY(cs) ((cs)->caseup_multiply) #endif and include it from func_lcase.cpp and func_ucase.cpp .
            danblack Daniel Black added a comment -

            There's no point over complicating it. The git submodule ties the columnstore to the server version. So if you when back to 11.0.1, the git submodule would go to a previous columnstore version that didn't have this change.

            danblack Daniel Black added a comment - There's no point over complicating it. The git submodule ties the columnstore to the server version. So if you when back to 11.0.1, the git submodule would go to a previous columnstore version that didn't have this change.
            drrtuy Roman added a comment -

            danblack TheLinuxJedi AFAIK the issue has been resolved. Am I right?

            drrtuy Roman added a comment - danblack TheLinuxJedi AFAIK the issue has been resolved. Am I right?
            danblack Daniel Black added a comment - - edited

            Yes. and serg committed the submodule update in the server with commit 5f33351f48557fa09d5ebcf9864c33bfa296cd8e.

            Thanks for the fix.

            danblack Daniel Black added a comment - - edited Yes. and serg committed the submodule update in the server with commit 5f33351f48557fa09d5ebcf9864c33bfa296cd8e . Thanks for the fix.
            toddstoffel Todd Stoffel (Inactive) made changes -
            Rank Ranked higher
            drrtuy Roman made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]

            People

              drrtuy Roman
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.