← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 6efaf34: MDEV-7011: MAX_STATEMENT_TIME has no effect in a procedure after a previous successful statement

 

Hi, Sergei!

On 28.05.15 21:13, Sergei Golubchik wrote:
Hi, Sanja!

On May 21, sanja@xxxxxxxxxxx wrote:
revision-id: 6efaf349adec30115bdb94b9a9927f7c5103ed99
parent(s): 3e55ef26d49a900782d2c2bb2c03470faed6ec9d
committer: Oleksandr Byelkin
branch nick: server
timestamp: 2015-05-21 16:31:24 +0200
message:

MDEV-7011: MAX_STATEMENT_TIME has no effect in a procedure after a previous successful statement

Do not reset timer inside stored procedures and functions.

diff --git a/sql/sql_class.h b/sql/sql_class.h
index ca532ae..ebb76df 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3966,6 +3966,8 @@ class THD :public Statement,
    void reset_query_timer()
    {
  #ifndef EMBEDDED_LIBRARY
+    if (spcont  || in_sub_stmt)
+      return;
      if (!query_timer.expired)
        thr_timer_end(&query_timer);
  #endif
I'd expect reset_query_timer() to use the same condition that
set_query_timer() does:

   void set_query_timer()
   {
     if (!variables.max_statement_time || spcont  || in_sub_stmt ||
         slave_thread || query_timer.expired == 0)
       return;
     thr_timer_settime(&query_timer, variables.max_statement_time);
   }

So, I'd think that reset_query_timer() could look like

   void reset_query_timer()
   {
     if (spcont || in_sub_stmt || slave_thread)
       return;
     if (!query_timer.expired)
       thr_timer_end(&query_timer);
   }

OK for consistency it will be better (in fact I do not think that if timer was not set reseting could change something).

I changed and now running tests to check...



References