Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11.6, 10.11.7, 10.11.8, 10.11.9, 10.11.10, 10.6, 10.11, 11.4, 11.7
-
docker (official mariadb docker image)
Description
Since 10.11.6 prepared statements are broken when using WITH ... AS ...
Example in 10.11.5:
prepare q FROM 'WITH t(id) AS (VALUES (?)) |
SELECT t.id FROM t'; |
|
SET @val = 1; |
|
EXECUTE q USING @val; |
Result:
id |
---|
1 |
In 10.11.6 and above:
prepare q FROM 'WITH t(id) AS (VALUES (?)) |
SELECT t.id FROM t'; |
|
SET @val = 1; |
|
EXECUTE q USING @val; |
Result:
id |
---|
Reproduction using docker:
#10.11.5 -> works
|
docker run --rm --name mariadb-test --env MARIADB_ROOT_PASSWORD=secret -d mariadb:10.11.5 |
sleep 10 |
docker exec -it mariadb-test mariadb -psecret -uroot --execute "prepare q FROM 'WITH t(id) AS (VALUES (?)) SELECT t.id FROM t'; SET @val = 1; EXECUTE q USING @val;" |
docker kill mariadb-test |
|
#10.11.6 -> broken
|
docker run --rm --name mariadb-test --env MARIADB_ROOT_PASSWORD=secret -d mariadb:10.11.6 |
sleep 10 |
docker exec -it mariadb-test mariadb -psecret -uroot --execute "prepare q FROM 'WITH t(id) AS (VALUES (?)) SELECT t.id FROM t'; SET @val = 1; EXECUTE q USING @val;" |
docker kill mariadb-test |
Attachments
Issue Links
- is caused by
-
MDEV-32225 Test case from opt_tvc.test fails with statement memory protection
- Closed