summaryrefslogtreecommitdiff
path: root/sql/my_json_writer.h
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2021-04-15 00:19:13 +0300
committerSergei Petrunia <psergey@askmonty.org>2021-04-17 00:05:29 +0300
commit2656e876828c2d3cb05bd698fc641e333c336034 (patch)
tree7164aca065740925f5c47b2413cda3564eae64b0 /sql/my_json_writer.h
parent3f138fa3a53383b98a934aae72667390ea3bf2eb (diff)
downloadmariadb-git-2656e876828c2d3cb05bd698fc641e333c336034.tar.gz
Cleanup: fake_select_lex->select_number=FAKE_SELECT_LEX_ID, not [U]INT_MAX
SELECT_LEX objects that are "fake_select_lex" (i.e read UNION output) used both INT_MAX and UINT_MAX as select_number. - mysql_explain_union() assigned UINT_MAX - st_select_lex_unit::add_fake_select_lex assigned INT_MAX This didn't matter initially (before EXPLAIN FORMAT=JSON), because the code had no checks for this value. EXPLAIN FORMAT=JSON and later other features did introduce checks for select_number values. The check had to check for two constants and looked really confusing. This patch joins the two constants into one - FAKE_SELECT_LEX_ID.
Diffstat (limited to 'sql/my_json_writer.h')
-rw-r--r--sql/my_json_writer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/my_json_writer.h b/sql/my_json_writer.h
index bc8002de529..27aec74d08d 100644
--- a/sql/my_json_writer.h
+++ b/sql/my_json_writer.h
@@ -491,7 +491,7 @@ public:
if (my_writer)
{
add_member("select_id");
- if (unlikely(select_number >= INT_MAX))
+ if (unlikely(select_number == FAKE_SELECT_LEX_ID))
context.add_str("fake");
else
context.add_ll(static_cast<longlong>(select_number));