summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorRex <rex.johnston@mariadb.com>2023-02-02 06:29:05 +1200
committerRex <rex.johnston@mariadb.com>2023-02-14 14:46:21 +1200
commitd9395d42273a4ec4742fac528d8ecece1baaa151 (patch)
tree9d15538184d337a1c6b175fbadc3321ae31e9668 /sql/sql_select.cc
parentb05218e08f45a17f46d1b73cbb9dcb2969dc04cd (diff)
downloadmariadb-git-bb-10.4-MDEV-30334.tar.gz
MDEV-30334 Optimizer trace produces invalid JSON with WHERE subquerybb-10.4-MDEV-30334
Simple code rearrangement to stop it displaying an unsigned int in a String.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index eb54484fa51..228ce799457 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -27865,6 +27865,8 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
}
}
str->append(" */ ");
+ if (join && join->cleaned) // if this join has been cleaned
+ return; // the select_number printed above is all we have
}
str->append(STRING_WITH_LEN("select "));
@@ -27875,11 +27877,12 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
JOIN already cleaned up so it is dangerous to print items
because temporary tables they pointed on could be freed.
*/
- str->append('#');
- str->append(select_number);
+ str->append("#");
+ str->append_ulonglong(select_number);
return;
}
+
/* First add options */
if (options & SELECT_STRAIGHT_JOIN)
str->append(STRING_WITH_LEN("straight_join "));