← Back to team overview

maria-developers team mailing list archive

Re: MDEV-10035 DBUG_ASSERT on CREATE VIEW v1 AS SELECT * FROM t1 FOR UPDATE

 

Hi!


On 16.05.2016 14:26, Sergei Golubchik wrote:
Hi, Alexander!

On May 16, Alexander Barkov wrote:
Just now this parameter for VIEWs effectively (and silently) ignored. So
error IMHO is better.
It will break existing application where users have FOR UPDATE in the
view definition. But, probably, there won't be many?
I think there won't be many.
For me it looks like when we added FOR UPDATE,
we just forgot to disallow this in VIEW.

A more clear way is to use FOR UPDATE when invoking views than when
creating views:
SELECT * FROM view1 FOR UPDATE;
That's different. See:

   CREATE VIEW v1 AS SELECT * FROM t1 FOR UPDATE;
   SELECT * FROM v1, t2;

This is different from

   SELECT * FROM t1, t2 FOR UPDATE;


the first locks only t1, the second - both t1 and t2.
No, "FOR UPDATE" has no any traces in view.frm (because it implemented by writing properties to individual tables during parsing, which I think is bad thing in all senses). So if it is processed now differently it is only because FOR UPDATE works incorrectly and do not goes inside views (I did not checked it but it is probable).

[skip]


Follow ups

References