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
- relates to
-
MDEV-38099 Assertion `has_rand == static_cast<bool>(un->uncacheable & 2)' failed in st_select_lex::optimize_unflattened_subqueries
-
- In Review
-