Skip to content

Instantly share code, notes, and snippets.

@spetrunia
Created February 13, 2024 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spetrunia/9d0cffde72308ea904c2f372992b6e08 to your computer and use it in GitHub Desktop.
Save spetrunia/9d0cffde72308ea904c2f372992b6e08 to your computer and use it in GitHub Desktop.
diff --git a/mysql-test/main/join.result b/mysql-test/main/join.result
index 141db4221b5..ceedb4f6bb7 100644
--- a/mysql-test/main/join.result
+++ b/mysql-test/main/join.result
@@ -3408,7 +3408,7 @@ drop table t1,t2,t3;
drop table t1000,t10,t03;
# End of 10.3 tests
#
-# MDEV-30975
+# MDEV-30975: Wrong result with cross Join given join order
#
CREATE TABLE `t1` (
`t1_seq` INT NOT NULL,
diff --git a/mysql-test/main/join.test b/mysql-test/main/join.test
index 368c170dd07..28d440c579f 100644
--- a/mysql-test/main/join.test
+++ b/mysql-test/main/join.test
@@ -1826,7 +1826,7 @@ drop table t1000,t10,t03;
--echo # End of 10.3 tests
--echo #
---echo # MDEV-30975
+--echo # MDEV-30975: Wrong result with cross Join given join order
--echo #
CREATE TABLE `t1` (
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index a2fc60966f5..29de51ab488 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -1201,8 +1201,10 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
(derived->alias.str ? derived->alias.str : "<NULL>"),
derived->get_unit()));
- /* Only fill derived tables once, unless the derived table is dependent in
- which case we will delete all of its rows and refill it below. */
+ /*
+ Only fill derived tables once, unless the derived table is dependent in
+ which case we will delete all of its rows and refill it below.
+ */
if (unit->executed && !(unit->uncacheable & UNCACHEABLE_DEPENDENT) &&
!unit->describe && !derived_is_recursive)
DBUG_RETURN(FALSE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment