Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12659

Add THD::make_string_literal()

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3.1
    • OTHER
    • None

    Description

      In order to implement MDEV-12658 easier, and to remove duplicate code between sql_yacc.yy and sql_yacc_ora.yy, we'll remove this code:

      text_literal:
                TEXT_STRING
                {
                  LEX_CSTRING tmp;
                  CHARSET_INFO *cs_con= thd->variables.collation_connection;
                  CHARSET_INFO *cs_cli= thd->variables.character_set_client;
                  uint repertoire= $1.repertoire(cs_cli);
                  if (thd->charset_is_collation_connection ||
                      (repertoire == MY_REPERTOIRE_ASCII &&
                       my_charset_is_ascii_based(cs_con)))
                    tmp= $1;
                  else
                  {
                    LEX_STRING to;
                    if (thd->convert_string(&to, cs_con, $1.str, $1.length, cs_cli))
                      MYSQL_YYABORT;
                   tmp.str=    to.str;
                   tmp.length= to.length;
                  }
                  $$= new (thd->mem_root) Item_string(thd, tmp.str, tmp.length,
                                                      cs_con,
                                                      DERIVATION_COERCIBLE,
                                                      repertoire);
                  if ($$ == NULL)
                    MYSQL_YYABORT;
                }
      

      and add a new method in THD instead, so the code in .yy files will be simplified to:

      text_literal:
                TEXT_STRING
                {
                  if (!($$= thd->make_string_literal($1)))
                    MYSQL_YYABORT;
                }
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.