Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
12.3.1
-
ubuntu22.04
Description
Summary
On MariaDB 12.3.1-MariaDB-asan-log (rev 21a0714a), query-level hint MAX_EXECUTION_TIME inside a CREATE VIEW is not preserved and not enforced at runtime. Direct SELECT with the same hint is enforced, but SELECT via the view completes without timeout. Other hints (NO_INDEX, INDEX, JOIN_ORDER, BKA) are preserved in views.
Minimal Reproducer
CREATE TABLE t (a INT); |
INSERT INTO t VALUES (1); |
|
|
CREATE VIEW v AS |
SELECT /*+ MAX_EXECUTION_TIME(1) */ SLEEP(0.05) AS s, a FROM t; |
|
|
SHOW CREATE VIEW v; |
-- → no MAX_EXECUTION_TIME in view text
|
|
|
-- Direct: timeout enforced
|
SELECT /*+ MAX_EXECUTION_TIME(1) */ SLEEP(0.05) AS s FROM t; |
-- → ERROR 1969
|
|
|
-- Via view: succeeds (hint lost)
|
SELECT s FROM v; |
-- → 0 |
Expected
MAX_EXECUTION_TIME hint should be preserved in the view definition and applied when selecting from the view, resulting in ERROR 1969 for the same timeout.
Actual
Hint is dropped in CREATE VIEW. SELECT from the view completes successfully; no timeout.
Workarounds / Controls
Other hints (NO_INDEX, INDEX, JOIN_ORDER, BKA, SEMIJOIN) are preserved and enforced in views. Only query-level hints like MAX_EXECUTION_TIME and SET_VAR appear stripped.
Suggested Fix
Preserve MAX_EXECUTION_TIME in CREATE VIEW and enforce it at SELECT resolution, similar to direct-query hint handling in Max_execution_time_hint::resolve().
Environment
| Item | Value |
|---|---|
| Version | 12.3.1-MariaDB-asan-log |
| Revision | 21a0714a118614982d20bfa504763d7247800091 |