SQL syntax error in Smartedit Personalization view

In OOTB hybris smartedit throws FlexibleSearch errors on personalization view and most part of customization functionality doesn’t work. Exception will inform that there is an error in SQL syntax near UNION ALL.

Issues is that query like SELECT x.contentSlot FROM ( (SELECT ... ) UNION ALL (SELECT ...) ) will fail with syntax error in MySQL 5.6, 5.7 with any java connector version. Proper query syntax is SELECT x.contentSlot FROM ( SELECT ... UNION ALL SELECT ... ). So to make smartedit work OOTB query must be replaced with proper one.

Query with issue is build in CxCustomizationPageIdDaoStrategy. Firstly must be created new CxDaoStrategy with proper UNION ALL syntax:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.blog.core.customization.dao.impl;

import de.hybris.platform.cms2.constants.GeneratedCms2Constants;
import de.hybris.platform.personalizationcms.customization.dao.impl.CxCustomizationPageIdDaoStrategy;
import de.hybris.platform.servicelayer.search.FlexibleSearchQuery;

import java.util.HashMap;
import java.util.Map;

public class FixedCxCustomizationPageIdDaoStrategy extends CxCustomizationPageIdDaoStrategy {

    private static final String JOIN = " JOIN ";
    private static final String CATALOG_VERSION = "catalogVersion";

    @Override
    public FlexibleSearchQuery getQuery(Map<String, String> params, Map<String, Object> queryParams) {

        String query = "SELECT {cu.pk} FROM {CxCustomization as cu } WHERE {cu.pk} " + this.getOperator(params) + " ({{ " + createProperSubselectOfCustomizations(queryParams) + " }}) " + "AND {cu." + CATALOG_VERSION + "} " + this.getMulticountryWhereOperator(queryParams) + "AND {cu." + "status" + "} IN (?statuses) " + "AND LOWER({cu." + "name" + "}) LIKE LOWER(?name) " + "ORDER BY " + this.buildOrderByForMulticountry(queryParams, "cu") + " {cu." + "groupPOS" + "} ASC ";

        String name = this.getName(params);
        String statuses = params.get("statuses");
        Map<String, Object> extraParams = new HashMap<>();
        extraParams.put("name", name);
        extraParams.put("statuses", this.getStatusesForCodesStr(statuses));
        extraParams.put("pageId", params.get("pageId"));
        extraParams.put("pageCatalogVersion", this.getPageCatalogVersion(params, queryParams));
        return this.getCxDaoQueryBuilder().buildQuery(query, extraParams);
    }


    private String createProperSubselectOfCustomizations(Map<String, Object> queryParams) {
        return "SELECT DISTINCT {c." + "pk" + "} " + "FROM {" + "CxCustomization" + " as c " + JOIN + "CxVariation" + " as v ON {c." + "pk" + "} = {v." + "customization" + "} " + JOIN + "CxCmsAction" + " as a ON {v." + "pk" + "} = {a." + "variation" + "} " + JOIN + "CxCmsComponentContainer" + " as con ON {a." + "containerId" + "} = {con." + "sourceId" + "} " + JOIN + GeneratedCms2Constants.Relations.ELEMENTSFORSLOT + " as rel ON {con." + "pk" + "} = {rel.target} " + JOIN + "ContentSlot" + " as cont ON {rel.source} = {cont." + "pk" + "} " + "} " + "WHERE " + "  {cont." + "pk" + "} IN " + "  (" + "    SELECT x.contentSlot FROM " + "    (" + "       {{ SELECT {csTempl." + "contentSlot" + "} as contentSlot " + "        FROM {" + "ContentSlotForTemplate" + " as csTempl " + JOIN + "PageTemplate" + " as pTempl ON {csTempl." + "pageTemplate" + "} = {pTempl." + "pk" + "} " + JOIN + "AbstractPage" + " as abstrPage ON {pTempl." + "pk" + "} = {abstrPage." + "masterTemplate" + "} " + " \t    } " + "        WHERE " + "          {abstrPage." + CATALOG_VERSION + "} = ?pageCatalogVersion " + "          AND {abstrPage." + "uid" + "} = ?pageId " + "      }} " + "      UNION ALL " + "       {{ SELECT {csPage." + "contentSlot" + "} as contentSlot " + "        FROM { " + "ContentSlotForPage" + " as csPage " + JOIN + "AbstractPage" + " as abstrPage ON {csPage." + "page" + "} = {abstrPage." + "pk" + "} " + "         } " + "        WHERE " + "          {abstrPage." + CATALOG_VERSION + "} = ?pageCatalogVersion " + "          AND {abstrPage." + "uid" + "} = ?pageId " + "      }} ) " + "     x " + "  )" + "  AND {c." + CATALOG_VERSION + "} " + this.getMulticountryWhereOperator(queryParams);
    }

}

And 2 bean definitions must be created for fixed CxDaoStrategy:

1
2
3
4
5
6
7

<bean id="fixedCxCustomizationPageIdDaoStrategy"
      class="com.blog.core.customization.dao.impl.FixedCxCustomizationPageIdDaoStrategy"
      parent="cxCustomizationPageIdDaoStrategy"/>
<bean id="fixedCxCustomizationPageIdNameDaoStrategy"
      class="com.blog.core.customization.dao.impl.FixedCxCustomizationPageIdDaoStrategy"
      parent="cxCustomizationPageIdNameDaoStrategy"/>

Such changes will lead to new issue:

1
2
3
4
5
6
2CxDaoStrategy support
the same
number of
provided parameters.
Please change
configuration .

DAO strategy is selected in DefaultCxDaoStrategySelector by comparing list of query parameters and list of parameters required for strategy (each CxDaoStrategy must implement getRequiredParameters() method). If more than 1 strategy would be found than error would be raised.

To get rid of this issue DefaultCxDaoStrategySelector must be replaced with new implementation, which will filter buggy strategies:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.blog.core.customization.dao.impl;

import de.hybris.platform.personalizationservices.dao.impl.DefaultCxDaoStrategySelector;

import javax.annotation.Resource;
import java.util.List;
import java.util.Optional;

public class FixedCxDaoStrategySelector extends DefaultCxDaoStrategySelector {

    @Resource
    private List<String> cxDaoExcludedStrategies;

    @Override
    protected <T> Optional<T> finalizeSelection(List<T> results) {
        if (results.size() > 1) {
            results.removeIf(result -> cxDaoExcludedStrategies.contains(result.getClass().getSimpleName()));
            if (results.size() > 1) {
                throw new IllegalArgumentException(results.size() + " CxDaoStrategy support the same number of provided parameters. Please change configuration.");
            }
        }

        return results.size() == 1 ? Optional.of(results.get(0)) : Optional.empty();
    }
}

Our strategy will filter strategies by class names. CxCustomizationPageIdDaoStrategy must be added to cxDaoExcludedStrategies list bean:

1
2
3
4
5
6
7
8

<util:list id="cxDaoExcludedStrategies" value-type="java.lang.String">
    <value>CxCustomizationPageIdDaoStrategy</value>
</util:list>

<alias name="fixedCxDaoStrategySelector" alias="cxDaoStrategySelector"/>
<bean id="fixedCxDaoStrategySelector" class="com.blog.core.customization.dao.impl.FixedCxDaoStrategySelector"
      parent="defaultCxDaoStrategySelector"/>

Query issue in CxCustomizationPageIdDaoStrategy would be fixed with solution described above and smartedit will show all CMS customizations from Personalization module.

But in case of changing personalization action via smartedit the same syntax error issue will appear in CxCmsActionTypeDao. Unfortunately FlexibleSearch query in CxCmsActionTypeDao is defined in static final constant, which is populated via static block. To figure this out reflection must be used to change value of static final field. Also code must be executed only once after hybris startup, for this purposes TenantListener would be used:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package com.blog.core.customization;

import de.hybris.platform.cms2.constants.GeneratedCms2Constants;
import de.hybris.platform.core.Registry;
import de.hybris.platform.core.Tenant;
import de.hybris.platform.core.TenantListener;
import de.hybris.platform.personalizationcms.action.dao.impl.CxCmsActionTypeDao;
import org.apache.log4j.Logger;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

/**
 * Fix query in CxCmsActionTypeDao. Issues is with round brackets for UNION ALL query.
 * Query like "SELECT x.contentSlot FROM ( () UNION ALL () )" will fail with syntax error in MySQL 5.6, 5.7 with any
 * connector version. This listener replaces OOTB query with right one.
 * <p>
 * Same procedure is done in FixedCxCustomizationPageIdDaoStrategy.
 */
public class PersonalizationBrokenQueriesFixTenantListener implements TenantListener {

    private Boolean isExecuted;

    private static final Logger LOG = Logger.getLogger(PersonalizationBrokenQueriesFixTenantListener.class);

    private static final String JOIN = " JOIN ";
    private static final String FIXED_PAGE_ID_QUERY = "({{SELECT DISTINCT {ac.pk} FROM {CxCmsAction as ac JOIN CxCmsComponentContainer as con ON {ac.containerId} = {con.sourceId} JOIN " + GeneratedCms2Constants.Relations.ELEMENTSFORSLOT + " as rel ON {con." + "pk" + "} = {rel.target} " + "JOIN " + "ContentSlot" + " as cont ON {rel.source} = {cont." + "pk" + "} " + "} " + "WHERE " + "  {cont." + "pk" + "} IN " + "  (" + "    SELECT x.contentSlot FROM " + "    (" + "       {{ SELECT {csTempl." + "contentSlot" + "} as contentSlot " + "        FROM {" + "ContentSlotForTemplate" + " as csTempl " + JOIN + "PageTemplate" + " as pTempl ON {csTempl." + "pageTemplate" + "} = {pTempl." + "pk" + "} " + JOIN + "AbstractPage" + " as abstrPage ON {pTempl." + "pk" + "} = {abstrPage." + "masterTemplate" + "} " + " \t    } " + "        WHERE " + "          {abstrPage." + "catalogVersion" + "} = ?pageCatalogVersion " + "          AND {abstrPage." + "uid" + "} = ?pageId " + "      }} " + "      UNION ALL " + "      {{ SELECT {csPage." + "contentSlot" + "} as contentSlot " + "        FROM { " + "ContentSlotForPage" + " as csPage " + JOIN + "AbstractPage" + " as abstrPage ON {csPage." + "page" + "} = {abstrPage." + "pk" + "} " + "         } " + "        WHERE " + "          {abstrPage." + "catalogVersion" + "} = ?pageCatalogVersion " + "          AND {abstrPage." + "uid" + "} = ?pageId " + "      }} " + "    ) x " + "  )" + " }}) ";

    PersonalizationBrokenQueriesFixTenantListener() {
        Registry.registerTenantListener(this);
    }

    @Override
    public void afterTenantStartUp(Tenant tenant) {
        for (int i = 0; i < 40; i++) {
            LOG.warn("Check correctness after each version migration. Most probably hybris already fixed this issue and issue fixed by FixedCxCustomizationPageIdDaoStrategy.");
        }

        try {
            if (!Boolean.TRUE.equals(isExecuted)) {
                PersonalizationBrokenQueriesFixTenantListener.setFinalStatic(CxCmsActionTypeDao.class.getDeclaredField("PAGE_ID_QUERY"), FIXED_PAGE_ID_QUERY);
            }
        } catch (NoSuchFieldException | IllegalAccessException e) {
            LOG.warn("Can't fix Personalization queries");
            if (LOG.isDebugEnabled()) {
                LOG.debug("Can't fix Personalization queries", e);
            }
        }

        this.setExecuted(true);
    }


    static void setFinalStatic(Field field, Object newValue) throws NoSuchFieldException, IllegalAccessException {
        field.setAccessible(true);

        Field modifiersField = Field.class.getDeclaredField("modifiers");
        modifiersField.setAccessible(true);
        modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);

        field.set(null, newValue);
    }

    public void setExecuted(boolean executed) {
        this.isExecuted = this.isExecuted == null ? executed : this.isExecuted;
    }

    @Override
    public void beforeTenantShutDown(Tenant tenant) {
        // No actions on shutdown, only on tenant creation
    }

    @Override
    public void afterSetActivateSession(Tenant tenant) {
        // No actions on set of session, only on tenant creation
    }

    @Override
    public void beforeUnsetActivateSession(Tenant tenant) {
        // No actions on unset of session, only on tenant creation
    }

}

Now smartedit can be used to manage personalization customization in hybris 1808 and 1811 with MySQL 5.6 and MySQL 5.7.

P.S. To enable extended debug of SQL and FlexibleSearch queries can be used such local.properties:

1
2
3
4
5
6
7
8
# Log raw SQL
db.log.active                                = true
db.log.appendStackTrace                      = true
db.log.loggerclass                           = de.hybris.platform.jdbcwrapper.logger.StdoutLogger
db.log.sql.parameters                        = true

# Log FlexibleSearch queries
flexible.search.exception.show.query.details = true

P.P.S. Exception with extended query log:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
251|master|190130-15:24:25:634|2 ms|statement|SELECT  item_t0.PK  FROM cxcustomization item_t0 WHERE ( item_t0.PK   IN  (SELECT DISTINCT  item_t1.PK  FROM cxcustomization item_t1 JOIN cxvariation item_t2 ON  item_t1.PK  =  item_t2.p_customization  JOIN cxabstractaction item_t3 ON  item_t2.PK  =  item_t3.p_variation  JOIN cmscomponent item_t4 ON  item_t3.p_containerid  =  item_t4.p_sourceid  JOIN elements4slots item_t5 ON  item_t4.PK  =  item_t5.TargetPK  JOIN contentslot item_t6 ON  item_t5.SourcePK  =  item_t6.PK  WHERE ( item_t6.PK  IN   (    SELECT x.contentSlot FROM     (      ( SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN cmspage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = ?           AND  item_t9.p_uid  = ?) AND ((item_t7.TypePkString=?  AND item_t8.TypePkString IN  (?,?,?)  AND item_t9.TypePkString IN  (?,?,?,?,?,?,?) )) UNION ALL SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN catlandpage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = ?           AND  item_t9.p_uid  = ?) AND ((item_t7.TypePkString=?  AND item_t8.TypePkString IN  (?,?,?)  AND item_t9.TypePkString=? )) )      UNION ALL       ( SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN cmspage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = ?           AND  item_t11.p_uid  = ?) AND ((item_t10.TypePkString=?  AND item_t11.TypePkString IN  (?,?,?,?,?,?,?) )) UNION ALL SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN catlandpage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = ?           AND  item_t11.p_uid  = ?) AND ((item_t10.TypePkString=?  AND item_t11.TypePkString=? )) )     ) x   )  AND  item_t1.p_catalogversion   = ?) AND ((item_t1.TypePkString=?  AND item_t2.TypePkString=?  AND item_t3.TypePkString=?  AND item_t4.TypePkString=?  AND item_t5.TypePkString=?  AND item_t6.TypePkString=? ))) AND  item_t0.p_catalogversion   = ? AND  item_t0.p_status  IN (?,?) AND LOWER( item_t0.p_name ) LIKE LOWER(?)) AND (item_t0.TypePkString=? ) order by  item_t0.p_grouppos  ASC LIMIT ?,?|SELECT  item_t0.PK  FROM cxcustomization item_t0 WHERE ( item_t0.PK   IN  (SELECT DISTINCT  item_t1.PK  FROM cxcustomization item_t1 JOIN cxvariation item_t2 ON  item_t1.PK  =  item_t2.p_customization  JOIN cxabstractaction item_t3 ON  item_t2.PK  =  item_t3.p_variation  JOIN cmscomponent item_t4 ON  item_t3.p_containerid  =  item_t4.p_sourceid  JOIN elements4slots item_t5 ON  item_t4.PK  =  item_t5.TargetPK  JOIN contentslot item_t6 ON  item_t5.SourcePK  =  item_t6.PK  WHERE ( item_t6.PK  IN   (    SELECT x.contentSlot FROM     (      ( SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN cmspage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = 8796093219417           AND  item_t9.p_uid  = 'homepage') AND ((item_t7.TypePkString=8796126773330  AND item_t8.TypePkString IN  (8796125528146,8796125560914,8796125429842)  AND item_t9.TypePkString IN  (8796125888594,8796125823058,8796119859282,8796125921362,8796125855826,8796125954130,8796125593682) )) UNION ALL SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN catlandpage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = 8796093219417           AND  item_t9.p_uid  = 'homepage') AND ((item_t7.TypePkString=8796126773330  AND item_t8.TypePkString IN  (8796125528146,8796125560914,8796125429842)  AND item_t9.TypePkString=8796125986898 )) )      UNION ALL       ( SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN cmspage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = 8796093219417           AND  item_t11.p_uid  = 'homepage') AND ((item_t10.TypePkString=8796126806098  AND item_t11.TypePkString IN  (8796125888594,8796125823058,8796119859282,8796125921362,8796125855826,8796125954130,8796125593682) )) UNION ALL SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN catlandpage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = 8796093219417           AND  item_t11.p_uid  = 'homepage') AND ((item_t10.TypePkString=8796126806098  AND item_t11.TypePkString=8796125986898 )) )     ) x   )  AND  item_t1.p_catalogversion   = 8796093219417) AND ((item_t1.TypePkString=8796133720146  AND item_t2.TypePkString=8796107866194  AND item_t3.TypePkString=8796107997266  AND item_t4.TypePkString=8796121989202  AND item_t5.TypePkString=8796121661522  AND item_t6.TypePkString=8796121628754 ))) AND  item_t0.p_catalogversion   = 8796093219417 AND  item_t0.p_status  IN (8796094922843,8796114813019) AND LOWER( item_t0.p_name ) LIKE LOWER('%')) AND (item_t0.TypePkString=8796133720146 ) order by  item_t0.p_grouppos  ASC LIMIT 0,50 /*PreparedStatementImpl:57:DataSourceImplFactory:108:ConnectionImpl:338:ConnectionImpl:630:FlexibleSearchExecutor:114:FlexibleSearch:1810:FlexibleSearchCacheUnit:51:AbstractCacheUnit:305:AbstractCacheUnit:278:AbstractCacheUnit:180:FlexibleSearchCacheUnit:90:FlexibleSearch:1453:FlexibleSearch:1385:DefaultFlexibleSearchService$2:418:DefaultFlexibleSearchService$2:1:DefaultSessionService:89:DefaultFlexibleSearchService:396:DefaultFlexibleSearchService:168:DefaultPaginatedFlexibleSearchService:55:AbstractCxDao:114:DefaultCxCustomizationDao:97:DefaultCxCustomizationService:63:DefaultCustomizationFacade:80:CustomizationController:107:AbstractController:101:CustomizationController:107:CustomizationController$$FastClassBySpringCGLIB$$a2dd793d:-1:MethodProxy:204:CglibAopProxy$CglibMethodInvocation:736:ReflectiveMethodInvocation:157:MethodInvocationProceedingJoinPoint:96:FieldsFilter:46:NativeMethodAccessorImpl:-2:NativeMethodAccessorImpl:62:DelegatingMethodAccessorImpl:43:Method:498:AbstractAspectJAdvice:627:AbstractAspectJAdvice:616:AspectJAroundAdvice:70:ReflectiveMethodInvocation:179:ExposeInvocationInterceptor:92:ReflectiveMethodInvocation:179:CglibAopProxy$DynamicAdvisedInterceptor:671:CustomizationController$$EnhancerBySpringCGLIB$$c61499ce:-1:NativeMethodAccessorImpl:-2:NativeMethodAccessorImpl:62:DelegatingMethodAccessorImpl:43:Method:498:InvocableHandlerMethod:205:InvocableHandlerMethod:133:ServletInvocableHandlerMethod:97:RequestMappingHandlerAdapter:849:RequestMappingHandlerAdapter:760:AbstractHandlerMethodAdapter:85:DispatcherServlet:967:DispatcherServlet:901:FrameworkServlet:970:FrameworkServlet:861:HttpServlet:635:FrameworkServlet:846:HttpServlet:742:END */
        [2019/01/30 15:24:25.634] ERROR [hybrisHTTP20] [FlexibleSearch] Flexible search error occured...
        [2019/01/30 15:24:25.637] INFO  [hybrisHTTP20] [RestHandlerExceptionResolver] Translating exception [de.hybris.platform.servicelayer.search.exceptions.FlexibleSearchException]: SQL search error - 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 'UNION ALL SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_' at line 1 query = 'SELECT  item_t0.PK  FROM cxcustomization item_t0 WHERE ( item_t0.PK   IN  (SELECT DISTINCT  item_t1.PK  FROM cxcustomization item_t1 JOIN cxvariation item_t2 ON  item_t1.PK  =  item_t2.p_customization  JOIN cxabstractaction item_t3 ON  item_t2.PK  =  item_t3.p_variation  JOIN cmscomponent item_t4 ON  item_t3.p_containerid  =  item_t4.p_sourceid  JOIN elements4slots item_t5 ON  item_t4.PK  =  item_t5.TargetPK  JOIN contentslot item_t6 ON  item_t5.SourcePK  =  item_t6.PK  WHERE ( item_t6.PK  IN   (    SELECT x.contentSlot FROM     (      ( SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN cmspage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = ?           AND  item_t9.p_uid  = ?) AND ((item_t7.TypePkString=?  AND item_t8.TypePkString IN  (?,?,?)  AND item_t9.TypePkString IN  (?,?,?,?,?,?,?) )) UNION ALL SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN catlandpage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = ?           AND  item_t9.p_uid  = ?) AND ((item_t7.TypePkString=?  AND item_t8.TypePkString IN  (?,?,?)  AND item_t9.TypePkString=? )) )      UNION ALL       ( SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN cmspage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = ?           AND  item_t11.p_uid  = ?) AND ((item_t10.TypePkString=?  AND item_t11.TypePkString IN  (?,?,?,?,?,?,?) )) UNION ALL SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN catlandpage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = ?           AND  item_t11.p_uid  = ?) AND ((item_t10.TypePkString=?  AND item_t11.TypePkString=? )) )     ) x   )  AND  item_t1.p_catalogversion   = ?) AND ((item_t1.TypePkString=?  AND item_t2.TypePkString=?  AND item_t3.TypePkString=?  AND item_t4.TypePkString=?  AND item_t5.TypePkString=?  AND item_t6.TypePkString=? ))) AND  item_t0.p_catalogversion   = ? AND  item_t0.p_status  IN (?,?) AND LOWER( item_t0.p_name ) LIKE LOWER(?)) AND (item_t0.TypePkString=? ) order by  item_t0.p_grouppos  ASC LIMIT ?,?', values = [8796093219417, homepage, 8796126773330, 8796125528146, 8796125560914, 8796125429842, 8796125888594, 8796125823058, 8796119859282, 8796125921362, 8796125855826, 8796125954130, 8796125593682, 8796093219417, homepage, 8796126773330, 8796125528146, 8796125560914, 8796125429842, 8796125986898, 8796093219417, homepage, 8796126806098, 8796125888594, 8796125823058, 8796119859282, 8796125921362, 8796125855826, 8796125954130, 8796125593682, 8796093219417, homepage, 8796126806098, 8796125986898, 8796093219417, 8796133720146, 8796107866194, 8796107997266, 8796121989202, 8796121661522, 8796121628754, 8796093219417, PropertyValue:8796094922843, PropertyValue:8796114813019, %, 8796133720146]
        [2019/01/30 15:24:25.646] ERROR [hybrisHTTP20] [RestHandlerExceptionResolver] de.hybris.platform.servicelayer.search.exceptions.FlexibleSearchException: SQL search error - 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 'UNION ALL SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_' at line 1 query = 'SELECT  item_t0.PK  FROM cxcustomization item_t0 WHERE ( item_t0.PK   IN  (SELECT DISTINCT  item_t1.PK  FROM cxcustomization item_t1 JOIN cxvariation item_t2 ON  item_t1.PK  =  item_t2.p_customization  JOIN cxabstractaction item_t3 ON  item_t2.PK  =  item_t3.p_variation  JOIN cmscomponent item_t4 ON  item_t3.p_containerid  =  item_t4.p_sourceid  JOIN elements4slots item_t5 ON  item_t4.PK  =  item_t5.TargetPK  JOIN contentslot item_t6 ON  item_t5.SourcePK  =  item_t6.PK  WHERE ( item_t6.PK  IN   (    SELECT x.contentSlot FROM     (      ( SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN cmspage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = ?           AND  item_t9.p_uid  = ?) AND ((item_t7.TypePkString=?  AND item_t8.TypePkString IN  (?,?,?)  AND item_t9.TypePkString IN  (?,?,?,?,?,?,?) )) UNION ALL SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN catlandpage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = ?           AND  item_t9.p_uid  = ?) AND ((item_t7.TypePkString=?  AND item_t8.TypePkString IN  (?,?,?)  AND item_t9.TypePkString=? )) )      UNION ALL       ( SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN cmspage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = ?           AND  item_t11.p_uid  = ?) AND ((item_t10.TypePkString=?  AND item_t11.TypePkString IN  (?,?,?,?,?,?,?) )) UNION ALL SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN catlandpage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = ?           AND  item_t11.p_uid  = ?) AND ((item_t10.TypePkString=?  AND item_t11.TypePkString=? )) )     ) x   )  AND  item_t1.p_catalogversion   = ?) AND ((item_t1.TypePkString=?  AND item_t2.TypePkString=?  AND item_t3.TypePkString=?  AND item_t4.TypePkString=?  AND item_t5.TypePkString=?  AND item_t6.TypePkString=? ))) AND  item_t0.p_catalogversion   = ? AND  item_t0.p_status  IN (?,?) AND LOWER( item_t0.p_name ) LIKE LOWER(?)) AND (item_t0.TypePkString=? ) order by  item_t0.p_grouppos  ASC LIMIT ?,?', values = [8796093219417, homepage, 8796126773330, 8796125528146, 8796125560914, 8796125429842, 8796125888594, 8796125823058, 8796119859282, 8796125921362, 8796125855826, 8796125954130, 8796125593682, 8796093219417, homepage, 8796126773330, 8796125528146, 8796125560914, 8796125429842, 8796125986898, 8796093219417, homepage, 8796126806098, 8796125888594, 8796125823058, 8796119859282, 8796125921362, 8796125855826, 8796125954130, 8796125593682, 8796093219417, homepage, 8796126806098, 8796125986898, 8796093219417, 8796133720146, 8796107866194, 8796107997266, 8796121989202, 8796121661522, 8796121628754, 8796093219417, PropertyValue:8796094922843, PropertyValue:8796114813019, %, 8796133720146]
at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService$2.execute(DefaultFlexibleSearchService.java:422)
at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService$2.execute(DefaultFlexibleSearchService.java:1)
at de.hybris.platform.servicelayer.session.impl.DefaultSessionService.executeInLocalView(DefaultSessionService.java:89)
at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService.getJaloResult(DefaultFlexibleSearchService.java:396)
at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService.search(DefaultFlexibleSearchService.java:168)
at de.hybris.platform.servicelayer.search.paginated.impl.DefaultPaginatedFlexibleSearchService.search(DefaultPaginatedFlexibleSearchService.java:55)
at de.hybris.platform.personalizationservices.dao.impl.AbstractCxDao.queryList(AbstractCxDao.java:114)
at de.hybris.platform.personalizationservices.customization.dao.impl.DefaultCxCustomizationDao.findCustomizations(DefaultCxCustomizationDao.java:97)
at de.hybris.platform.personalizationservices.customization.impl.DefaultCxCustomizationService.getCustomizations(DefaultCxCustomizationService.java:63)
at de.hybris.platform.personalizationfacades.customization.impl.DefaultCustomizationFacade.getCustomizations(DefaultCustomizationFacade.java:80)
at de.hybris.platform.personalizationwebservices.controllers.CustomizationController.lambda$0(CustomizationController.java:107)
at de.hybris.platform.webservicescommons.controllers.AbstractController.executeAndConvertException(AbstractController.java:101)
at de.hybris.platform.personalizationwebservices.controllers.CustomizationController.getCustomizations(CustomizationController.java:107)
at de.hybris.platform.personalizationwebservices.controllers.CustomizationController$$FastClassBySpringCGLIB$$a2dd793d.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:96)
at de.hybris.platform.webservicescommons.mapping.aop.FieldsFilter.filterFields(FieldsFilter.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
at de.hybris.platform.personalizationwebservices.controllers.CustomizationController$$EnhancerBySpringCGLIB$$c61499ce.getCustomizations(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:849)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:760)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:330)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$StatisticsGatewayFilter.doFilter(AbstractPlatformFilterChain.java:419)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:300)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
at de.hybris.platform.webservicescommons.oauth2.HybrisOauth2UserFilter.doFilter(HybrisOauth2UserFilter.java:55)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:176)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:157)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:300)
at de.hybris.platform.webservicescommons.filter.LanguageFilter.doFilterInternal(LanguageFilter.java:68)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:300)
at de.hybris.platform.webservicescommons.filter.CatalogVersionFilter.doFilterInternal(CatalogVersionFilter.java:58)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:300)
at de.hybris.platform.webservicescommons.filter.RestSessionFilter.doFilter(RestSessionFilter.java:46)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:300)
at de.hybris.platform.servicelayer.web.TenantActivationFilter.doFilter(TenantActivationFilter.java:88)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:300)
at de.hybris.platform.servicelayer.web.Log4JFilter.doFilter(Log4JFilter.java:44)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:300)
at de.hybris.platform.webservicescommons.filter.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:42)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:300)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.processStandardFilterChain(AbstractPlatformFilterChain.java:209)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.doFilterInternal(AbstractPlatformFilterChain.java:186)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at de.hybris.platform.webservicescommons.filter.SessionHidingFilter.doFilter(SessionHidingFilter.java:41)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at de.hybris.platform.servicelayer.web.XSSFilter.processPatternsAndDoFilter(XSSFilter.java:358)
at de.hybris.platform.servicelayer.web.XSSFilter.doFilter(XSSFilter.java:306)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: de.hybris.platform.jalo.flexiblesearch.FlexibleSearchException: SQL search error - 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 'UNION ALL SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_' at line 1 query = 'SELECT  item_t0.PK  FROM cxcustomization item_t0 WHERE ( item_t0.PK   IN  (SELECT DISTINCT  item_t1.PK  FROM cxcustomization item_t1 JOIN cxvariation item_t2 ON  item_t1.PK  =  item_t2.p_customization  JOIN cxabstractaction item_t3 ON  item_t2.PK  =  item_t3.p_variation  JOIN cmscomponent item_t4 ON  item_t3.p_containerid  =  item_t4.p_sourceid  JOIN elements4slots item_t5 ON  item_t4.PK  =  item_t5.TargetPK  JOIN contentslot item_t6 ON  item_t5.SourcePK  =  item_t6.PK  WHERE ( item_t6.PK  IN   (    SELECT x.contentSlot FROM     (      ( SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN cmspage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = ?           AND  item_t9.p_uid  = ?) AND ((item_t7.TypePkString=?  AND item_t8.TypePkString IN  (?,?,?)  AND item_t9.TypePkString IN  (?,?,?,?,?,?,?) )) UNION ALL SELECT  item_t7.p_contentslot  as contentSlot FROM slotsfortemplate item_t7 JOIN pagetemplate item_t8 ON  item_t7.p_pagetemplate  =  item_t8.PK  JOIN catlandpage item_t9 ON  item_t8.PK  =  item_t9.p_mastertemplate  WHERE ( item_t9.p_catalogversion  = ?           AND  item_t9.p_uid  = ?) AND ((item_t7.TypePkString=?  AND item_t8.TypePkString IN  (?,?,?)  AND item_t9.TypePkString=? )) )      UNION ALL       ( SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN cmspage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = ?           AND  item_t11.p_uid  = ?) AND ((item_t10.TypePkString=?  AND item_t11.TypePkString IN  (?,?,?,?,?,?,?) )) UNION ALL SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_t10 JOIN catlandpage item_t11 ON  item_t10.p_page  =  item_t11.PK  WHERE ( item_t11.p_catalogversion  = ?           AND  item_t11.p_uid  = ?) AND ((item_t10.TypePkString=?  AND item_t11.TypePkString=? )) )     ) x   )  AND  item_t1.p_catalogversion   = ?) AND ((item_t1.TypePkString=?  AND item_t2.TypePkString=?  AND item_t3.TypePkString=?  AND item_t4.TypePkString=?  AND item_t5.TypePkString=?  AND item_t6.TypePkString=? ))) AND  item_t0.p_catalogversion   = ? AND  item_t0.p_status  IN (?,?) AND LOWER( item_t0.p_name ) LIKE LOWER(?)) AND (item_t0.TypePkString=? ) order by  item_t0.p_grouppos  ASC LIMIT ?,?', values = [8796093219417, homepage, 8796126773330, 8796125528146, 8796125560914, 8796125429842, 8796125888594, 8796125823058, 8796119859282, 8796125921362, 8796125855826, 8796125954130, 8796125593682, 8796093219417, homepage, 8796126773330, 8796125528146, 8796125560914, 8796125429842, 8796125986898, 8796093219417, homepage, 8796126806098, 8796125888594, 8796125823058, 8796119859282, 8796125921362, 8796125855826, 8796125954130, 8796125593682, 8796093219417, homepage, 8796126806098, 8796125986898, 8796093219417, 8796133720146, 8796107866194, 8796107997266, 8796121989202, 8796121661522, 8796121628754, 8796093219417, PropertyValue:8796094922843, PropertyValue:8796114813019, %, 8796133720146][HY-0]
at de.hybris.platform.jalo.flexiblesearch.internal.FlexibleSearchExecutor.execute(FlexibleSearchExecutor.java:183)
at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.executeSearch(FlexibleSearch.java:1810)
at de.hybris.platform.jalo.flexiblesearch.FlexibleSearchCacheUnit.compute(FlexibleSearchCacheUnit.java:51)
at de.hybris.platform.cache.AbstractCacheUnit.privateGetNoLock(AbstractCacheUnit.java:305)
at de.hybris.platform.cache.AbstractCacheUnit.privateGet(AbstractCacheUnit.java:278)
at de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:180)
at de.hybris.platform.jalo.flexiblesearch.FlexibleSearchCacheUnit.myGet(FlexibleSearchCacheUnit.java:90)
at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.search(FlexibleSearch.java:1453)
at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.search(FlexibleSearch.java:1385)
at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService$2.execute(DefaultFlexibleSearchService.java:418)
	... 135 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'UNION ALL SELECT  item_t10.p_contentslot  as contentSlot FROM slotsforpage item_' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2011)
at de.hybris.platform.jdbcwrapper.interceptor.PreparedStatementWithJDBCInterceptor.lambda$3(PreparedStatementWithJDBCInterceptor.java:76)
at de.hybris.platform.jdbcwrapper.interceptor.recover.SQLRecoverableExceptionHandler.passThrough(SQLRecoverableExceptionHandler.java:101)
at de.hybris.platform.jdbcwrapper.interceptor.recover.SQLRecoverableExceptionHandler.get(SQLRecoverableExceptionHandler.java:59)
at de.hybris.platform.jdbcwrapper.interceptor.JDBCInterceptor.get(JDBCInterceptor.java:69)
at de.hybris.platform.jdbcwrapper.interceptor.PreparedStatementWithJDBCInterceptor.executeQuery(PreparedStatementWithJDBCInterceptor.java:76)
at de.hybris.platform.jdbcwrapper.PreparedStatementImpl.executeQuery(PreparedStatementImpl.java:177)
at de.hybris.platform.jalo.flexiblesearch.internal.FlexibleSearchExecutor.execute(FlexibleSearchExecutor.java:124)
	... 144 more
comments powered by Disqus