[MDEV-28696] View created as "select b''; " references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them Created: 2022-05-30  Updated: 2022-12-02  Resolved: 2022-12-02

Status: Closed
Project: MariaDB Server
Component/s: Data types
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 10.11.2, 11.0.0, 10.3.38, 10.4.28, 10.5.19, 10.6.12, 10.7.8, 10.9.5, 10.10.3

Type: Bug Priority: Critical
Reporter: Lena Startseva Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: view-protocol

Issue Links:
PartOf
is part of MDEV-27691 make working view-protocol Open

 Description   

Test:

CREATE VIEW v1 as select b'';
SELECT * FROM v1;
DROP VIEW v1;

Actual value:

At line 3: query 'SELECT * FROM v1' failed: 1356: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

Expected value:

b''



 Comments   
Comment by Alexander Barkov [ 2022-12-01 ]

sanja, please review a patch:

https://github.com/MariaDB/server/commit/7b4c7fb949d23ce0be64081e0cb6684d286a1c07

Comment by Oleksandr Byelkin [ 2022-12-01 ]

Patch looks OK, but you should also remove :

#enable after fix MDEV-28696
--disable_view_protocol
...
--enable_view_protocol

in mysql-test/main/varbinary.test

Comment by Alexander Barkov [ 2022-12-01 ]

Done. Here's a fixed version:

https://github.com/MariaDB/server/commit/5798380a384fb44728242a3cd7851235454c6fc1

Now this test passes:

./mtr --view-protocol main.varbinary

It failed before the patch.

Generated at Thu Feb 08 10:02:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.