摘要: 表锁分为read和write read锁: lock table 表名 read; unlock tabls; #解锁 当前会话只能读取数据,不能插入数据。 其他会话能读取数据,不能插入数据,解锁后数据插入。 write锁: lock table 表名 write; 当前会话可以读书数据,可以插入数 阅读全文
posted @ 2016-09-01 23:51 木三 阅读(202) 评论(0) 推荐(0)
摘要: 1.首先创建两个表,充值日志表(user_balance_log)、用户余额表(user_balance) 表结构如下: (1)user_balance: (2)user_balance_log: 注:log_type 日志类型1代表充值 2代表消费 3代表转账 2.写存储过程模拟用户充值 BEGI 阅读全文
posted @ 2016-08-16 00:51 木三 阅读(1370) 评论(0) 推荐(0)