暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

【StoneDB故障诊断】无法操作StoneDB表中数据

原创 来来士 2022-07-25
257

StoneDB对部分DML操作是有限制的,如执行delete会有如下报错,这是因为StoneDB不支持delete。

ERROR 1031 (HY000): Table storage engine for 'xxx' doesn't have this option

执行replace into、update多表关联、update关联子查询操作时,虽然返回成功了(有"Warnings"提示),但查询数据时却发现数据没有被更新。执行"show warnings",有如下提示。

mysql> show warnings; +-------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +-------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Note | 1592 | Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. | +-------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)

这是因为StoneDB只支持statement的binlog格式,执行以上三种DML操作会被认为是不安全的操作。如果有主从,可能会导致主从数据不一致。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论