升级导致mysql数据表丢失_mysql 更新操作数据丢失

开启两个MySQL客户端,在两个客户端中对同一条数据进行更新操作。操作步骤如下:数据表

select * from customer_sales_values;

+------------+-------------+-------+--------+

| first_name | surname     | value | value2 |

+------------+-------------+-------+--------+

| Patricia   | Mankunku    |   450 |   NULL |

| Winston    | Powere      |   500 |   NULL |

| Yohnny     | Chaka-Chaka |   500 |   NULL |

| Yvonne     | Clegg       |  4000 |   NULL |

| Gladys     | Malherbe    |     5 |     10 |

| Johnny     | Chaka-Chaka |   500 |   NULL |

| Patricia   | Mankunku    |   450 |   NULL |

| Winstoa    | Powers      |   750 |   NULL |

| Yvoune     | Clegg       |  5800 |   NULL |

| Charles    | Dube        |     0 |   NULL |

| Charles    | Dube        |     0 |   NULL |

| Gladys     | Malherbe    |     5 |     10 |

+------------+-------------+-------+--------+

先在window1中执行查询:

mysql> select value from customer_sales_values where

-> first_name='Johnny' and surname='Chaka-Chaka';

+-------+

| value |

+-------+

|   800 |

+-------+

1 row in set (0.05 sec)

然后在window2中执行查询:

mysql> select value from customer_sales_values where

-> first_name='Johnny' and surname='Chaka-Chaka';

+-------+

| value |

+-------+

|   800 |

+-------+

1 row in set (0.05 sec)

在window1中执行

mysql> update customer_sales_values set value=500+100

-> where first_name='Johnny' and surname='Chaka-Chaka';

Query OK, 1 row affected (0.02 sec)

Rows matched: 1  Changed: 1  Warnings: 0

在window2中执行

mysql> update customer_sales_values set value=500+300

-> where first_name='Johnny' and surname='Chaka-Chaka';

Query OK, 1 row affected (0.33 sec)

Rows matched: 1  Changed: 1  Warnings: 0

mysql>  select value from customer_sales_values where

->  first_name='Johnny' and surname='Chaka-Chaka';

+-------+

| value |

+-------+

|   800 |

+-------+

1 row in set (0.00 sec)

为什么在window1的更新操作,被在window2的更新操作覆盖了呢?不明白,请教诸位大侠!

2012年12月29日 10:18

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值