Open earayu opened 1 year ago
For SQL like select get_lock('xyz', 10) from db1.t1
engine.Lock
plantryExecute()
of engine.Lock
will be calledtryExecute()
, it will generate a SQL like select get_lock('xyz', 10) from dual
and will execute it.So the tryExecute()
of engine.Lock
is not implemented correctly, we need to fix it.
Background:
The Select function for lock-related functions generates an engine.Lock type of plan and has a corresponding execution function. However, there is still room for improvement in terms of their correctness and compatibility with MySQL.
Solution:
We need to rewrite
engine.Lock
primitive and related planner. The VTGate layer need not to evaluate expressions or split the locking functions. Just like engine.Send, VTGate should send the SQL to VTTablet, and add some flags in session. That's all.