WL#5470: DDL locking: SW lock should have higher priority than SNRW if requester has SR lock

Affects: Server-5.6   —   Status: Un-Assigned

Change priorities so that a pending MDL_SHARED_WRITE lock has a higher priority
than MDL_SHARED_NO_READ_WRITE if the requester has MDL_SHARED_READ.
This would allow transactions to complete, rather than abort on deadlock,
despite a pending DDL on the table.

Example:

con1: begin;
con1: select * from t1;
con2: lock table t1 ... -- or RENAME, TRUNCATE, CREATE/DROP TRIGGER, OPTIMIZE,
ANALYZE, blocks on shared lock
con1: update t1 set a=3; <-- currently produces ER_LOCK_DEADLOCK.
Consider making all lock upgrades higher priority than lock acquisitions (a
fairly simple implementation).