Commit df93b4f2 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Fix MDEV-30820 problem found by Monty

parent d5aff2d5
......@@ -231,15 +231,18 @@ SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL log_output= "TABLE";
SET GLOBAL slow_query_log= ON;
SET SESSION long_query_time= 0;
SET GLOBAL debug_dbug="+d,debug_huge_number_of_examined_rows";
SET debug_dbug="+d,debug_huge_number_of_examined_rows";
SELECT * FROM tab_MDEV_30820 ORDER BY 1;
ID A
1 0
2 0
SET GLOBAL debug_dbug=@old_dbug;
SET debug_dbug=@old_dbug;
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
SELECT rows_examined, sql_text from mysql.slow_log where sql_text like "SELECT%FROM tab_MDEV_30820%";
rows_examined sql_text
18446744073708551615 SELECT * FROM tab_MDEV_30820 ORDER BY 1
drop table tab_MDEV_30820;
#
# End of 10.4 test
......
......@@ -104,16 +104,21 @@ SET GLOBAL log_output= "TABLE";
SET GLOBAL slow_query_log= ON;
SET SESSION long_query_time= 0;
SET GLOBAL debug_dbug="+d,debug_huge_number_of_examined_rows";
SET debug_dbug="+d,debug_huge_number_of_examined_rows";
--disable_ps_protocol
--disable_view_protocol
SELECT * FROM tab_MDEV_30820 ORDER BY 1;
SET GLOBAL debug_dbug=@old_dbug;
--enable_view_protocol
--enable_ps_protocol
SET debug_dbug=@old_dbug;
## Reset to initial values
SET @@long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
SELECT rows_examined, sql_text from mysql.slow_log where sql_text like "SELECT%FROM tab_MDEV_30820%";
drop table tab_MDEV_30820;
--echo #
......
......@@ -5682,8 +5682,6 @@ void THD::set_examined_row_count(ha_rows count)
void THD::inc_sent_row_count(ha_rows count)
{
m_sent_row_count+= count;
DBUG_EXECUTE_IF("debug_huge_number_of_examined_rows",
m_examined_row_count= (ULONGLONG_MAX - 1000000););
MYSQL_SET_STATEMENT_ROWS_SENT(m_statement_psi, m_sent_row_count);
}
......
......@@ -3013,7 +3013,11 @@ class THD: public THD_count, /* this must be first */
{ return m_sent_row_count; }
ha_rows get_examined_row_count() const
{ return m_examined_row_count; }
{
DBUG_EXECUTE_IF("debug_huge_number_of_examined_rows",
return (ULONGLONG_MAX - 1000000););
return m_examined_row_count;
}
ulonglong get_affected_rows() const
{ return affected_rows; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment