[MDEV-10529] SELECT SLEEP(n) with MAX_STATEMENT_TIME produces no error Created: 2016-08-10 Updated: 2016-08-10 Resolved: 2016-08-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Trivial |
| Reporter: | Federico Razzoli | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This is a minor problem, but I think it's natural to use the following query to test the behavior of max_statement_time:
The natural conclusion is that MAX_STATEMENT_TIME forces MariaDB to send the results it read until now, without any error. But this is not true:
|
| Comments |
| Comment by Elena Stepanova [ 2016-08-10 ] |
I don't think it's a natural conclusion (assumption) at all. How would this work in general, if it were a normal SELECT, which was caught by the timeout on the phase of query optimization, or DDL in the middle of the operation, etc.? The description of the variable also clearly says that the operation is aborted:
|
| Comment by Elena Stepanova [ 2016-08-10 ] |
|
Re-opening the bug – sorry, I've misread the initial complain, which is about SLEEP not producing the error. The previous comment is still true, of course max_statement_time is not meant to make a query return intermediate results. |
| Comment by Elena Stepanova [ 2016-08-10 ] |
|
For SELECT SLEEP(N), it works the same way as if you interrupted the query manually – that is, if you run SELECT SLEEP(10) in one connection, and while it's sleeping, run KILL QUERY n, where n is the first connection's ID, from another connection, SLEEP will also return 1 rather then ERROR 1969. That's how SLEEP function is defined:
|