Details
-
Bug
-
Resolution: Invalid
-
Major
-
None
-
11.10.10
-
debian 10, jetty 9.4.15-1 (debian), mariadb connector for JAVA as shipped in libmariadb-java package/debian (2.3.0)
-
Unknown
-
Description
We noticed a behavior change in database name handling between XWiki 9.11.8 and XWiki 11.10.10
in XWiki v9, in xwiki.cfg , with:
xwiki.db=main xwiki.prefix=xwiki_
The main database name was resolved by the system to the contatenation of both : xwiki_main
In XWiki 11.10.10, I need to put :
xwiki.db=xwiki_main xwiki.prefix=xwiki_
For the main database to get selected properly. Other wise I get the following error:
Caused by: java.sql.SQLException: Could not select database 'main' : Access denied for user 'xwdev'@'localhost' to database 'main'
To reproduce, download XWiki war, unpack in the application container, create a database xwiki_main & user as stated in the documentation, tweak the hibernate conf then put in xwiki.cfg:
xwiki.db=main xwiki.prefix=xwiki_
PS: hibernate should contains something like
<property name="hibernate.connection.url">jdbc:mariadb://localhost/xwiki_main</property>
PS: First inspection with tmortagne led to https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/store/hibernate/HibernateStore.java#L339