
08.02.2021 18:44:21,212 WARN   (com.logicaldoc.core.document.dao.HibernateDocumentDAO:1214) -- StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
com.logicaldoc.core.PersistenceException: StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at com.logicaldoc.core.HibernatePersistentObjectDAO.jdbcUpdate(HibernatePersistentObjectDAO.java:550)
	at com.logicaldoc.core.document.dao.HibernateDocumentDAO.cleanUnexistingUniqueTags(HibernateDocumentDAO.java:1212)
	at jdk.internal.reflect.GeneratedMethodAccessor802.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy62.cleanUnexistingUniqueTags(Unknown Source)
	at com.logicaldoc.core.document.TagsProcessor.runTask(TagsProcessor.java:47)
	at com.logicaldoc.core.task.Task.run(Task.java:204)
	at jdk.internal.reflect.GeneratedMethodAccessor651.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:265)
	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:230)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:419)
	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:544)
	at com.logicaldoc.core.HibernatePersistentObjectDAO.jdbcUpdate(HibernatePersistentObjectDAO.java:548)
	... 23 more
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1335)
	at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2108)
	at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1245)
	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:532)
	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:529)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:408)
	... 25 more
08.02.2021 18:50:20,648 WARN   (com.logicaldoc.core.document.dao.HibernateDocumentDAO:1214) -- StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
com.logicaldoc.core.PersistenceException: StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at com.logicaldoc.core.HibernatePersistentObjectDAO.jdbcUpdate(HibernatePersistentObjectDAO.java:550)
	at com.logicaldoc.core.document.dao.HibernateDocumentDAO.cleanUnexistingUniqueTags(HibernateDocumentDAO.java:1212)
	at jdk.internal.reflect.GeneratedMethodAccessor802.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy62.cleanUnexistingUniqueTags(Unknown Source)
	at com.logicaldoc.core.document.TagsProcessor.runTask(TagsProcessor.java:47)
	at com.logicaldoc.core.task.Task.run(Task.java:204)
	at jdk.internal.reflect.GeneratedMethodAccessor651.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:265)
	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:230)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:419)
	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:544)
	at com.logicaldoc.core.HibernatePersistentObjectDAO.jdbcUpdate(HibernatePersistentObjectDAO.java:548)
	... 23 more
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1335)
	at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2108)
	at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1245)
	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:532)
	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:529)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:408)
	... 25 more
08.02.2021 18:52:22,795 ERROR  (com.logicaldoc.core.document.DocumentManagerImpl: 506) -- Error reindexing document 3606055 - RR Form 01 - User Access Request Form.docx
08.02.2021 18:52:22,864 ERROR  (com.logicaldoc.core.document.DocumentManagerImpl: 506) -- Error reindexing document 3606056 - User Access Request.html
08.02.2021 18:56:20,075 WARN   (com.logicaldoc.core.document.dao.HibernateDocumentDAO:1214) -- StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
com.logicaldoc.core.PersistenceException: StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at com.logicaldoc.core.HibernatePersistentObjectDAO.jdbcUpdate(HibernatePersistentObjectDAO.java:550)
	at com.logicaldoc.core.document.dao.HibernateDocumentDAO.cleanUnexistingUniqueTags(HibernateDocumentDAO.java:1212)
	at jdk.internal.reflect.GeneratedMethodAccessor802.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy62.cleanUnexistingUniqueTags(Unknown Source)
	at com.logicaldoc.core.document.TagsProcessor.runTask(TagsProcessor.java:47)
	at com.logicaldoc.core.task.Task.run(Task.java:204)
	at jdk.internal.reflect.GeneratedMethodAccessor651.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:265)
	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:230)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:419)
	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:544)
	at com.logicaldoc.core.HibernatePersistentObjectDAO.jdbcUpdate(HibernatePersistentObjectDAO.java:548)
	... 23 more
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1335)
	at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2108)
	at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1245)
	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:532)
	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:529)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:408)
	... 25 more
08.02.2021 19:02:24,601 WARN   (com.logicaldoc.core.document.dao.HibernateDocumentDAO:1214) -- StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
com.logicaldoc.core.PersistenceException: StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at com.logicaldoc.core.HibernatePersistentObjectDAO.jdbcUpdate(HibernatePersistentObjectDAO.java:550)
	at com.logicaldoc.core.document.dao.HibernateDocumentDAO.cleanUnexistingUniqueTags(HibernateDocumentDAO.java:1212)
	at jdk.internal.reflect.GeneratedMethodAccessor802.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy62.cleanUnexistingUniqueTags(Unknown Source)
	at com.logicaldoc.core.document.TagsProcessor.runTask(TagsProcessor.java:47)
	at com.logicaldoc.core.task.Task.run(Task.java:204)
	at jdk.internal.reflect.GeneratedMethodAccessor651.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:265)
	at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [delete from ld_uniquetag as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_document as C where UT.ld_tenantid=B.ld_tenantid and UT.ld_tag=B.ld_tag and C.ld_id=B.ld_docid and C.ld_deleted=0)  and not UT.ld_tag in (select distinct(D.ld_tag) from ld_foldertag as D, ld_folder as E where UT.ld_tenantid=D.ld_tenantid and UT.ld_tag=D.ld_tag and E.ld_id=D.ld_folderid and E.ld_deleted=0) ]; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:230)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:419)
	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:544)
	at com.logicaldoc.core.HibernatePersistentObjectDAO.jdbcUpdate(HibernatePersistentObjectDAO.java:548)
	... 23 more
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as UT where  not UT.ld_tag in (select distinct(B.ld_tag) from ld_tag as B, ld_do' at line 1
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1335)
	at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2108)
	at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1245)
	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
	at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:341)
	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:532)
	at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:529)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:408)
	... 25 more
