core icon indicating copy to clipboard operation
core copied to clipboard

FixTask00050FixInodesWithoutContentlets - Bad SQL

Open gabbydotCMS opened this issue 10 years ago • 4 comments

Tested on a client database (postgreSQL) right after their upgrade from 3.2 to 3.6. Not happening when upgrading from 3.2 to 3.5.

Full error can be found here: https://gist.github.com/gabbydotCMS/da3ad2bd5a8826d6e15c49a9dc9363b2#file-fix-assets-inconsistencies-errors-L233

I can provide the database dump to reproduce the issue.

gabbydotCMS avatar Oct 12 '16 19:10 gabbydotCMS

PR: https://github.com/dotCMS/core/pull/9970

agomez-dotcms avatar Oct 13 '16 17:10 agomez-dotcms

Passed QA. Executed Fix Assets Inconsistencies tool and verified that task successfully fixed assets by running the queries provided by @gabbydotCMS:

  • select count(inode) from inode i where type = 'contentlet' and not exists (select 1 from contentlet where i.inode = inode)
  • select count(id) from identifier i where asset_type = 'contentlet' and not exists (select 1 from contentlet where i.id = identifier)

Assets count after task returns 0

Tested in latest master-3.7 and 3.7 distribution using a Postgres DB coming from a dotCMS 3.2 instance

shaydotcms avatar Nov 18 '16 22:11 shaydotcms

port to new 3.7

jtesser avatar Jan 09 '17 15:01 jtesser

Merged to 3.7 https://github.com/dotCMS/core/pull/10415

dsilvam avatar Jan 10 '17 19:01 dsilvam