mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31721: Cursor protocol increases the counter of "Empty_queries" for select
Problem: Empty queries are incremented if no rows are sent to the client in the EXECUTE phase of select query. With cursor protocol, rows are not sent during EXECUTE phase; they are sent later in FETCH phase. Hence, queries executed with cursor protocol are always falsely treated as empty in EXECUTE phase. Fix: For cursor protocol, empty queries are now counted during the FETCH phase. This ensures counter correctly reflects whether any rows were actually sent to the client. Tests included in `mysql-test/main/show.test`.
This commit is contained in:
committed by
Raghunandan Bhat
parent
7ab205b009
commit
2c7cea28da
@@ -5850,6 +5850,17 @@ public:
|
||||
return false;
|
||||
return !is_set_timestamp_forbidden(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief
|
||||
Return true if current statement uses cursor protocol for execution.
|
||||
|
||||
@details
|
||||
Cursor protocol execution is determined by checking if lex->result is a
|
||||
Select_materialize object, which is exclusively used by the server for
|
||||
cursor result set materialization.
|
||||
*/
|
||||
bool is_cursor_execution() const;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user