mysql workbench 去掉系统数据库,MySQL Workbench会话看不到数据库更新

I have MySQL Workbench (community-6.2.3) installed in a Ubuntu system using .deb.

Workbench session does not seem to see updates (DML) to the database done by other sessions (applications/command line client).

A new session is able to see correct status of the database at its start but non of the changes that happen afterwards is visible to it.

It seems workbench session does sync up with db after a commit in workbench.

I'm getting Error Code: 1412. Table definition has changed, please retry transaction

when I try to query a table that I've created from a different session.

Non workbench sessions does not seem to have any of these issues.

Am I missing a configuration or something?

Update:

This is partly the expected behaviour and partly a bug.

I'm not using autocommit mode, in which case SELECT statements are executed using the snapshot established at the first read.

This is the behaviour for REPEATABLE READ isolation level, which gets used by MySQL Workbench.

Is there a way to change or set default isolation level of a MySQL Workbench session?

When executed in Workbench:

SELECT @@Global.tx_isolation, @@tx_isolation, @@session.tx_isolation;

returns:

READ-COMMITTED, REPEATABLE-READ, REPEATABLE-READ

as opposed to, in command line client:

READ-COMMITTED, READ-COMMITTED, READ-COMMITTED

解决方案

This is an old question, but still I have the same bug.

OP mentionned a bug opened on MySQL Workbench in another thread (http://bugs.mysql.com/bug.php?id=69800).

This mean that a snapshot of the database is made on the FIRST read of the transaction. Every other read of this transaction will show you the data of the snapshot.

So you need to end the transaction (commit or roll-back) to get a new snapshot on the next read.

My colleagues who set MySQL Workbench on AutoCommit don't see the repeatable-read behaviour. We figured out it's because after each SELECT, the transaction is closed and a new snapshot is created.

So, as the bug is still not corrected, a workaround would be :

switch to autocommit for new snapshots to be automatically created

or commit/rollback after each SELECT to create a new snapshot

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值