summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index c6140e35b24..a2cfc0d0128 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -4862,7 +4862,10 @@ void SELECT_LEX::increase_derived_records(ha_rows records)
break;
default:
// usual UNION
- result->est_records+= records;
+ if (HA_ROWS_MAX - records > result->est_records)
+ result->est_records+= records;
+ else
+ result->est_records= HA_ROWS_MAX;
break;
}
}