Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: Parser
    • Labels:
      None

      Description

      We can try to get rid of all m_cpp_xxx members in Lex_input_stream.
      It seems that the main purpose for these members is to cut comments from SELECT list item names:

      MariaDB [test]> SELECT 1 /* +2 */ + 3;
      +--------+
      | 1  + 3 |
      +--------+
      |      4 |
      +--------+
      1 row in set (4.69 sec)
      

      Notice, the column name does not include the comment part.

      The current code copies the original query into m_cpp_buf (removing comments on the way), so the second copy of the original query is always created. This affects performance negatively.

      Moreover, in most cases queries do not have comments at all.

      Related pieces of the code:

        void skip_binary(int n)
        {
          if (m_echo)
          {
            memcpy(m_cpp_ptr, m_ptr, n);
            m_cpp_ptr += n;
          }
          m_ptr += n;
        }
      
       ...
      
      
        unsigned char yyGet()
        {  
          char c= *m_ptr++;
          if (m_echo)
            *m_cpp_ptr++ = c;
          return c;  
        }
      
        ...
        void yySkipn(int n)
        {
          if (m_echo)
          {
            memcpy(m_cpp_ptr, m_ptr, n);
            m_cpp_ptr += n;
          }
          m_ptr += n;
        }
      
      

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: