-- sission B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X,GAP | X | +--------------+-------------+-------------------+--------------------+
-- sission C Blocked 1 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | X | +--------------+-------------+-------------------+--------------------+
-- sission C Blocked 2 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | X | +--------------+-------------+-------------------+--------------------+
BEGIN; SELECT * FROM t WHERE id>10 AND id<=15 FOR UPDATE;
INSERT INTO t VALUES (16,16,16); (Blocked)
UPDATE t SET d=d+1 WHERE id=20; (Blocked)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-- sission B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X,GAP | X | +--------------+-------------+-------------------+--------------------+
-- sission C Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | X | +--------------+-------------+-------------------+--------------------+
BEGIN; SELECT id FROM t WHERE c=5 LOCK IN SHARE MODE;
INSERT INTO t VALUES (7,7,7); (Blocked)
UPDATE t SET d=d+1 WHERE id=5; (Query OK)
UPDATE t SET d=d+1 WHERE c=10; (Query OK)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-- Using index:覆盖索引 mysql> EXPLAIN SELECT id FROM t WHERE c=5 LOCK IN SHARE MODE; +----+-------------+-------+------------+------+---------------+------+---------+-------+------+----------+-------------+ | id | select_type |table| partitions | type | possible_keys | key | key_len |ref|rows| filtered | Extra | +----+-------------+-------+------------+------+---------------+------+---------+-------+------+----------+-------------+ |1| SIMPLE | t |NULL|ref| c | c |5| const |1|100.00|Using index | +----+-------------+-------+------------+------+---------------+------+---------+-------+------+----------+-------------+
-- sission B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ | c | RECORD | X,GAP | S,GAP | +--------------+-------------+-------------------+--------------------+
LOCK IN SHARE MODE只会锁住覆盖索引,而FOR UPDATE会同时给聚簇索引上满足条件的行加上X Lock
session A
session B
BEGIN; SELECT id FROM t WHERE c=5 FOR UPDATE;
UPDATE t SET d=d+1 WHERE id=5; (Blocked)
1 2 3 4 5 6 7
-- sission B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | X | +--------------+-------------+-------------------+--------------------+
BEGIN; SELECT d FROM t WHERE c=5 LOCK IN SHARE MODE
UPDATE t SET d=d+1 WHERE id=5; (Blocked)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-- Extra=NULL:绕过覆盖索引,需要回表 mysql> EXPLAIN SELECT d FROM t WHERE c=5 LOCK IN SHARE MODE; +----+-------------+-------+------------+------+---------------+------+---------+-------+------+----------+-------+ | id | select_type |table| partitions | type | possible_keys | key | key_len |ref|rows| filtered | Extra | +----+-------------+-------+------------+------+---------------+------+---------+-------+------+----------+-------+ |1| SIMPLE | t |NULL|ref| c | c |5| const |1|100.00|NULL| +----+-------------+-------+------------+------+---------------+------+---------+-------+------+----------+-------+
-- sission B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | S | +--------------+-------------+-------------------+--------------------+
-- session B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ | c | RECORD | X,GAP | X,GAP | +--------------+-------------+-------------------+--------------------+
-- session C Blocked 1 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | X | +--------------+-------------+-------------------+--------------------+
-- session C Blocked 2 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | X | +--------------+-------------+-------------------+--------------------+
-- session C Blocked 1 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | X | +--------------+-------------+-------------------+--------------------+
-- session C Blocked 2 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | X | +--------------+-------------+-------------------+--------------------+
BEGIN; SELECT id FROM t WHERE c=10 LOCK IN SHARE MODE;
UPDATE t SET d=d+1 WHERE c=10; (Blocked)
INSERT INTO t values (8,8,8);
ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction
由于二级索引c是非唯一索引,因此没法降级为行锁 session A持有的锁
c:Next-Key Lock:(5,10]+c:Next-Key Lock:(10,15]
PRIMARY:S Lock:10
session B首先尝试持有c:Next-Key Lock:(5,10],分两阶段
c:Gap Lock:(5,10),加锁成功
c:X Lock:10,加锁失败,被阻塞,session B被session A阻塞
session A尝试插入(8,8,8),被session B的c:Gap Lock:(5,10)阻塞,系统检测到死锁并回滚session B
1 2 3 4 5 6 7
-- session B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ | c | RECORD | X | S | +--------------+-------------+-------------------+--------------------+
范围查询
session A
session B
session C
BEGIN; SELECT * FROM t WHERE c>=10 AND c<11 FOR UPDATE;
-- session B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ | c | RECORD | X,GAP | X | +--------------+-------------+-------------------+--------------------+
-- session C Blocked 1 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | X | +--------------+-------------+-------------------+--------------------+
-- session C Blocked 2 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ | c | RECORD | X | X | +--------------+-------------+-------------------+--------------------+
由于二级索引c是非唯一索引,因此没法降级为行锁 session A持有的锁
c:Next-Key Lock:(5,10]+c:Next-Key Lock:(10,15]
PRIMARY:X Lock:10
ORDE BY DESC
session A
session B
BEGIN; SELECT * FROM t WHERE c>=15 AND c <=20 ORDER BY c DESC LOCK IN SHARE MODE;
-- session B Blocked 1 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ | c | RECORD | X,GAP | S | +--------------+-------------+-------------------+--------------------+
-- session B Blocked 2 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ | c | RECORD | X,GAP | S,GAP | +--------------+-------------+-------------------+--------------------+
-- session B Blocked 3 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | S | +--------------+-------------+-------------------+--------------------+
-- session B Blocked 4 mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X | S | +--------------+-------------+-------------------+--------------------+
ORDE BY DESC,首先找到第一个满足c=20的行,session A持有锁:c:Next-Key Lock:(15,20]
BEGIN; SELECT*FROM t WHERE id>9AND id<12ORDERBY id DESCFORUPDATE;
利用上面的加锁规则,加锁范围如下
PRIMARY:Next-Key Lock:(0,5]
PRIMARY:Next-Key Lock:(5,10]
PRIMARY:Gap Lock:(10,15)
加锁动作是发生在语句执行过程中
ORDER BY DESC,优化器必须先找到第一个id<12的值
这个过程是通过索引树的搜索过程得到的,其实是在引擎内部查找id=12
只是最终没找到,而找到了(10,15)这个间隙
然后向左遍历,在这个遍历过程,就不是等值查询了
在执行过程中,通过树搜索的方式定位记录的过程,用的是等值查询
IN
1 2 3 4 5 6 7 8 9 10 11 12
BEGIN; SELECT id FROM t WHERE c IN (5,20,10) LOCK IN SHARE MODE;
-- Using index:使用了覆盖索引 -- key=c:使用了索引c -- rows=3:三个值都是通过树搜索定位的 mysql> EXPLAIN SELECT id FROM t WHERE c IN (5,20,10) LOCK IN SHARE MODE; +----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+--------------------------+ | id | select_type |table| partitions | type | possible_keys | key | key_len |ref|rows| filtered | Extra | +----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+--------------------------+ |1| SIMPLE | t |NULL|range| c | c |5|NULL|3|100.00|Usingwhere; Using index | +----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+--------------------------+
查找c=5
c:Next-Key Lock:(0,5]+c:Gap Lock:(5,10)
查找c=10
c:Next-Key Lock:(5,10]+c:Gap Lock:(10,15)
查找c=20
c:Next-Key Lock:(15,20]+c:Gap Lock:(20,25)
锁是在执行过程中是一个一个加的
ORDER BY DESC
1 2 3 4 5 6 7 8 9
BEGIN; SELECT id FROM t WHERE c IN (5,20,10) ORDERBY c DESCFORUPDATE;
mysql> EXPLAIN SELECT id FROM t WHERE c IN (5,20,10) ORDERBY c DESCFORUPDATE; +----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+-----------------------------------------------+ | id | select_type |table| partitions | type | possible_keys | key | key_len |ref|rows| filtered | Extra | +----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+-----------------------------------------------+ |1| SIMPLE | t |NULL|range| c | c |5|NULL|3|100.00|Usingwhere; Backward index scan; Using index | +----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+-----------------------------------------------+
ORDER BY DESC:先锁c=20,再锁c=10,最后锁c=5
加锁资源相同,但加锁顺序相反,如果语句是并发执行的,可能会出现死锁
死锁
session A
session B
BEGIN;
SELECT id FROM t WHERE c=5 LOCK IN SHARE MODE;
BEGIN;
SELECT id FROM t WHERE c=20 FOR UPDATE;
SELECT id FROM t WHERE c=20 LOCK IN SHARE MODE;
SELECT id FROM t WHERE c=5 FOR UPDATE;
Deadlock found when trying to get lock; try restarting transaction
mysql>SHOW ENGINE INNODB STATUS\G; ------------------------ LATEST DETECTED DEADLOCK ------------------------ 2019-03-0320:49:400x700006a43000 *** (1) TRANSACTION: TRANSACTION 281479811602240, ACTIVE 35 sec starting index read mysql tables in use 1, locked 1 LOCK WAIT 4 lock struct(s), heap size 1136, 3row lock(s) MySQL thread id 15, OS thread handle 123145414946816, query id 283 localhost root Sending data SELECT id FROM t WHERE c=20 LOCK IN SHARE MODE *** (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 77 page no5 n bits 80 index c oftable `test`.`t` trx id 281479811602240 lock mode S waiting Record lock, heap no6 PHYSICAL RECORD: n_fields 2; compact format; info bits 0 0: len 4; hex 80000014; asc ;; 1: len 4; hex 80000014; asc ;;
*** (2) TRANSACTION: TRANSACTION 6407220, ACTIVE 25 sec starting index read, thread declared inside InnoDB 5000 mysql tables in use 1, locked 1 5 lock struct(s), heap size 1136, 4row lock(s) MySQL thread id 16, OS thread handle 123145413734400, query id 284 localhost root Sending data SELECT id FROM t WHERE c=5FORUPDATE *** (2) HOLDS THE LOCK(S): RECORD LOCKS space id 77 page no5 n bits 80 index c oftable `test`.`t` trx id 6407220 lock_mode X Record lock, heap no6 PHYSICAL RECORD: n_fields 2; compact format; info bits 0 0: len 4; hex 80000014; asc ;; 1: len 4; hex 80000014; asc ;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 77 page no5 n bits 80 index c oftable `test`.`t` trx id 6407220 lock_mode X waiting Record lock, heap no3 PHYSICAL RECORD: n_fields 2; compact format; info bits 0 0: len 4; hex 80000005; asc ;; 1: len 4; hex 80000005; asc ;;
*** WE ROLL BACK TRANSACTION (1)
(1) TRANSACTION:第一个事务的信息
(2) TRANSACTION:第二个事务的信息
WE ROLL BACK TRANSACTION (1):最终的处理结果是回滚第一个事务
第一个事务
1 2 3 4 5 6
SELECT id FROM t WHERE c=20 LOCK IN SHARE MODE *** (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 77 page no5 n bits 80 index c oftable `test`.`t` trx id 281479811602240 lock mode S waiting Record lock, heap no6 PHYSICAL RECORD: n_fields 2; compact format; info bits 0 0: len 4; hex 80000014; asc ;; 1: len 4; hex 80000014; asc ;;
(1) WAITING FOR THIS LOCK TO BE GRANTED:表示第一个事务在等待的锁的信息
index c of table test.t:表示等待表t的索引c上的锁
lock mode S waiting:表示正在执行的语句要加一个S Lock,当前状态为等待中
Record lock:表示这是一个记录锁(行数)
n_fields 2:表示这个记录有2列(二级索引),即字段c和主键字段id
0: len 4; hex 80000014; asc ;;:第一个字段c
asc:表示接下来要打印值里面的可打印字符,20不是可打印字符,因此显示空格
1: len 4; hex 80000014; asc ;;:第二个字段id
第一个事务在等待(c=20,id=20)这一行的行锁
但并没有打印出第一个事务本身所占有的锁,可以通过第二个事务反向推导出来
第二个事务
1 2 3 4 5 6 7 8 9 10 11 12
SELECT id FROM t WHERE c=5FORUPDATE *** (2) HOLDS THE LOCK(S): RECORD LOCKS space id 77 page no5 n bits 80 index c oftable `test`.`t` trx id 6407220 lock_mode X Record lock, heap no6 PHYSICAL RECORD: n_fields 2; compact format; info bits 0 0: len 4; hex 80000014; asc ;; 1: len 4; hex 80000014; asc ;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 77 page no5 n bits 80 index c oftable `test`.`t` trx id 6407220 lock_mode X waiting Record lock, heap no3 PHYSICAL RECORD: n_fields 2; compact format; info bits 0 0: len 4; hex 80000005; asc ;; 1: len 4; hex 80000005; asc ;;
(2) HOLDS THE LOCK(S):表示第二个事务持有的锁的信息
index c of table test.t:表示锁是加在表t的索引c上
0: len 4; hex 80000014; asc ;;+1: len 4; hex 80000014; asc ;;
第二个事务持有(c=20,id=20)这一行的行锁(X Lock)
(2) WAITING FOR THIS LOCK TO BE GRANTED
第二个事务等待(c=5,id=5)只一行的行锁
小结
锁是一个一个加的,为了避免死锁,对同一组资源,尽量按照相同的顺序访问
在发生死锁的时候,FOR UPDATE占用的资源更多,回滚成本更大,因此选择回滚LOCK IN SHARE MODE
锁等待
时刻
session A
session B
T1
BEGIN;
T2
SELECT * FROM t WHERE id>10 AND id<=15 FOR UPDATE;
-- session B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ |PRIMARY| RECORD | X,GAP | X | +--------------+-------------+-------------------+--------------------+
mysql>SHOW ENGINE INNODB STATUS\G; ------------ TRANSACTIONS ------------ ---TRANSACTION 6407254, ACTIVE 3 sec inserting mysql tables in use 1, locked 1 LOCK WAIT 2 lock struct(s), heap size 1136, 1row lock(s) MySQL thread id 16, OS thread handle 123145413734400, query id 319 localhost root update INSERTINTO t VALUES (10,10,10) ------- TRX HAS BEEN WAITING 3 SEC FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 78 page no4 n bits 80 index PRIMARYoftable `test`.`t` trx id 6407254 lock_mode X locks gap before rec insert intention waiting Record lock, heap no5 PHYSICAL RECORD: n_fields 5; compact format; info bits 0 0: len 4; hex 8000000f; asc ;; 1: len 6; hex 00000061c44a; asc a J;; 2: len 7; hex 810000008f0137; asc7;; 3: len 4; hex 8000000f; asc ;; 4: len 4; hex 8000000f; asc ;;
-- session B Blocked mysql>SELECT locked_index,locked_type,waiting_lock_mode,blocking_lock_mode FROM sys.innodb_lock_waits WHERE locked_table='`test`.`t`'; +--------------+-------------+-------------------+--------------------+ | locked_index | locked_type | waiting_lock_mode | blocking_lock_mode | +--------------+-------------+-------------------+--------------------+ | c | RECORD | X,GAP | S | | c | RECORD | X,GAP | S | +--------------+-------------+-------------------+--------------------+
mysql>show engine innodb status\G; ------------ TRANSACTIONS ------------ ---TRANSACTION 6407282, ACTIVE 5 sec updating or deleting mysql tables in use 1, locked 1 LOCK WAIT 5 lock struct(s), heap size 1136, 4row lock(s), undo log entries 1 MySQL thread id 16, OS thread handle 123145413734400, query id 337 localhost root updating UPDATE t SET c=5WHERE c=1 ------- TRX HAS BEEN WAITING 5 SEC FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 79 page no5 n bits 80 index c oftable `test`.`t` trx id 6407282 lock_mode X locks gap before rec insert intention waiting Record lock, heap no4 PHYSICAL RECORD: n_fields 2; compact format; info bits 0 0: len 4; hex 8000000a; asc ;; 1: len 4; hex 8000000a; asc ;;