Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-35817

MAX_EXECUTION_TIME does not honor SLEEP(.5)

    XMLWordPrintable

Details

    Description

      This issue is sporadic, and possibly [OS] timing related. For me it replays once every 1 to 13 attempts, provided the server is restarted each attempt.

      SELECT /*+ MAX_EXECUTION_TIME(1) */ SLEEP(.5); 
      

      Leads to, pre-patch:

      CS 11.8.0 7734c85c31c9e292ef1133115fba2f7edd71dd51 (Optimized)

      11.8.0-opt>SELECT /*+ MAX_EXECUTION_TIME(1) */ SLEEP(.5);    # Note the extra syntax is not valid and ignored here
      +-----------+
      | SLEEP(.5) |
      +-----------+
      |         0 |
      +-----------+
      1 row in set (0.500 sec)
      

      Versus post-patch:

      bb-11.8-MDEV-35504-opt-hints CS 11.8.0 6d92aa1cf0a042e506189b6739e03a8b45e20ee7 (Optimized)

      11.8.0-opt>SELECT /*+ MAX_EXECUTION_TIME(1) */ SLEEP(.5);
      +-----------+
      | SLEEP(.5) |
      +-----------+
      |         1 |
      +-----------+
      1 row in set (0.002 sec)
      

      Note the incorrect 0.002 sec as well as the '1' output. When the feature works as epected we instead see:

      bb-11.8-MDEV-35504-opt-hints CS 11.8.0 6d92aa1cf0a042e506189b6739e03a8b45e20ee7 (Optimized)

      11.8.0-opt>SELECT /*+ MAX_EXECUTION_TIME(1) */ SLEEP(.5); 
      ERROR 1969 (70100): Query execution was interrupted (max_statement_time exceeded)
      

      Additionally, and though not related to the feature, as the following reports a warning:

      bb-11.8-MDEV-35504-opt-hints CS 11.8.0 6d92aa1cf0a042e506189b6739e03a8b45e20ee7 (Optimized)

      11.8.0-opt>SELECT /*+ INVALID(1) */ SLEEP(.5);
      +-----------+
      | SLEEP(.5) |
      +-----------+
      |         0 |
      +-----------+
      1 row in set, 1 warning (0.500 sec)
       
      11.8.0-opt>SHOW WARNINGS;
      +---------+------+----------------------------------------------------------------------+
      | Level   | Code | Message                                                              |
      +---------+------+----------------------------------------------------------------------+
      | Warning | 1064 | Optimizer hint syntax error near 'INVALID(1) */ SLEEP(.5)' at line 1 |
      +---------+------+----------------------------------------------------------------------+
      1 row in set (0.000 sec)
      

      one would expect a similar warning pre-patch for the there-invalid MAX_EXECUTION_TIME hint, which is not present as can be seen from the first output above.
      Perhaps this can be fixed at the same time, or we can open a new ticket.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.