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

ST_GeomFromText(one_parameter) marks its SELECT with UNCACHEABLE_RAND

    XMLWordPrintable

Details

    Description

      Discovered this while looking at MDEV-38099:
      In its testcase:

      SELECT (WITH cte AS (SELECT ST_GEOMFROMTEXT ('')) SELECT * FROM cte);
      

      use of ST_GEOMFROMTEXT() has caused its SELECT to have UNCACHEABLE_RAND flag.

      It was explicitly set by Create_func_geometry_from_text::create_native():

      +  case 1:
      +  {
      +    Item *param_1= item_list->pop();
      +    func= new (thd->mem_root) Item_func_geometry_from_text(param_1);
      +    thd->lex->uncacheable(UNCACHEABLE_RAND);
      +    break;
      +  }
      +  case 2:
      +  {
      +    Item *param_1= item_list->pop();
      +    Item *param_2= item_list->pop();
      +    func= new (thd->mem_root) Item_func_geometry_from_text(param_1, param_2);
      +    break;
      

      The code seems to originate from this patch (fixer: please check!)

      commit 384407aaeb37dafe4826c31006cd47c611da0da2
      Author: unknown <malff/marcsql@weblab.(none)>
      Date:   Thu Nov 2 11:01:53 2006 -0700
       
          Bug#21114 (Foreign key creation fails to table with name format)
          
          Due to the complexity of this change, everything is documented in WL#3565
          
          This patch is the third iteration, it takes into account the comments
          received to date.
      

      but there is no explanation about why it sets UNCACHEABLE_RAND.

      Attachments

        Issue Links

          Activity

            People

              Gosselin Dave Gosselin
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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