Ondra Žižka commented on Bug HHH-2697

Still doesn't work with 4.1.5.SP1:

Caused by: org.hibernate.QueryException: Space is not allowed after parameter prefix ':' [

 INSERT INTO poh_users_stats_daily (id_user, day, watch_patterns, watch_subjects, watch_merged) 
 SELECT u.id_user, CURRENT_DATE() AS day,
   @a :=  (SELECT COUNT(*) FROM poh_users_vzory AS v WHERE v.id_user = u.id_user) AS hlid_vz,
   @b :=  (SELECT COUNT(*) FROM poh_users_sled_osoby AS ho WHERE ho.id_user = u.id_user) AS hlid_os,
   @a + @b AS soucet 
 FROM isir_sled_users AS u 
 LEFT OUTER JOIN poh_users_stats_daily AS s 
    ON u.id_user = s.id_user AND `day` = CURRENT_DATE() WHERE s.id_user IS NULL

]
        at org.hibernate.engine.query.spi.ParameterParser.parse(ParameterParser.java:95) [hibernate-core-4.1.5.SP1.jar:4.1.5.SP1]
        at org.hibernate.engine.query.spi.ParamLocationRecognizer.parseLocations(ParamLocationRecognizer.java:75) [hibernate-core-4.1.5.SP1.jar:4.1.5.SP1]
        at org.hibernate.engine.query.spi.QueryPlanCache.buildParameterMetadata(QueryPlanCache.java:138) [hibernate-core-4.1.5.SP1.jar:4.1.5.SP1]
        at org.hibernate.engine.query.spi.QueryPlanCache.getSQLParameterMetadata(QueryPlanCache.java:131) [hibernate-core-4.1.5.SP1.jar:4.1.5.SP1]
        at org.hibernate.internal.AbstractSessionImpl.createSQLQuery(AbstractSessionImpl.java:209) [hibernate-core-4.1.5.SP1.jar:4.1.5.SP1]
        at org.hibernate.internal.SessionImpl.createSQLQuery(SessionImpl.java:1742) [hibernate-core-4.1.5.SP1.jar:4.1.5.SP1]
        at org.hibernate.ejb.AbstractEntityManagerImpl.createNativeQuery(AbstractEntityManagerImpl.java:730) [hibernate-entitymanager-4.1.5.SP1.jar:4.1.5.SP1]
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira