mySql federated table unable to update blob columns

淺唱寂寞╮ 提交于 2019-12-12 17:37:20

问题


I have a federated table on mySQL dbForge 6.0.265 which I created like this:

USE my_db;
CREATE TABLE my_db.federated_tbl_resources (
  Id int(11) NOT NULL AUTO_INCREMENT,
  resourceType varchar(255) NOT NULL,
  cultureCode varchar(10) NOT NULL,
  resourceKey varchar(128) NOT NULL,
  resourceValue longtext NOT NULL,
  PRIMARY KEY (Id),
  UNIQUE INDEX UK_tbl_string_resources (cultureCode, resourceKey, resourceType)
)
ENGINE=FEDERATED
AUTO_INCREMENT = 27339
AVG_ROW_LENGTH = 219
CHARACTER SET utf8
CONNECTION='connection_string'
COLLATE utf8_general_ci;
All the select queries work great.

Everything works well except UPDATE command fails on the resourceValue column.

The output of the update query shows that it was performed successfully, yet the value remains unchanged.

After a lot of digging around I have discovered this relevant post and this official mysql bug that has been around since 2008 and has been happily ignored, which prevents updates on blob columns (LONGTEXT being one of them).

Has anyone ever come across this and is there a trick to circumvent this mysql limitation?

Thanks


回答1:


A workaround is to first update the cell to NULL or to an empty string ('') and then update it again



来源:https://stackoverflow.com/questions/19364711/mysql-federated-table-unable-to-update-blob-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!