Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043952Openbravo ERPA. Platformpublic2020-05-05 18:202020-06-26 07:09
shuehner 
cberner 
normalminorhave not tried
closedfixed 
5
 
PR20Q3 
alostale
Core
No
0043952: ant create.database on postgresql fails with username containing @ symbol
Having a username containing an @ symbol as value for bbdd.username fails in builds.xml for example during ant create.database

      [sql] Failed to execute: DROP ROLE IF EXISTS tadpi_pgtest@test
      [sql] org.postgresql.util.PSQLException: ERROR: syntax error at or near "@"
      [sql] Position: 35
      [sql] 0 of 1 SQL statements executed successfully

POSTGRE.structure:

POSTGRE.structure.param:
      [sql] Executing commands
      [sql] Failed to execute: CREATE ROLE tadpi_pgtest@test LOGIN PASSWORD 'tad' CREATEDB CREATEROLE VALID UNTIL 'infinity'
      [sql] org.postgresql.util.PSQLException: ERROR: syntax error at or near "@"

Problem is missing quoting around the value inside the build-create.xml file

That is a problem for any user choosing such a username but also when trying to use/test 'Azure Database for PostgreSQL' (aka managed postgres offering in Azure hosting) which forces to use user@dbname as a pattern for the username.
Configure Openbravo.properties with bddd.username with a value containing @ symbol
run ant create.database
Add necessary quoting for the value in build*.xml
No tags attached.
related to design defect 0015126 closed cberner create.database.database fails with db-name like 'org.openbravo.base.seam' on postgres 
Issue History
2020-05-05 18:20shuehnerNew Issue
2020-05-05 18:20shuehnerAssigned To => platform
2020-05-05 18:20shuehnerModules => Core
2020-05-05 18:20shuehnerTriggers an Emergency Pack => No
2020-05-05 18:20shuehnerRelationship addedrelated to 0015126
2020-05-05 18:24shuehnerNote Added: 0119590
2020-06-12 14:33cbernerNote Added: 0120833
2020-06-12 14:33cbernerAssigned Toplatform => cberner
2020-06-16 08:19cbernerStatusnew => scheduled
2020-06-16 08:19cbernerReview Assigned To => alostale
2020-06-24 09:25hgbotCheckin
2020-06-24 09:25hgbotNote Added: 0121010
2020-06-24 09:25hgbotStatusscheduled => resolved
2020-06-24 09:25hgbotResolutionopen => fixed
2020-06-24 09:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e8e21dee39c4cc22e0953f6331484915e3e3394a [^]
2020-06-26 07:09alostaleStatusresolved => closed
2020-06-26 07:09alostaleFixed in Version => 3.0PR20Q3

Notes
(0119590)
shuehner   
2020-05-05 18:24   
Note:
For testing the fix apart of testing the described use-case result should be double-checked in an ob-cloud test-instance configure to use "Azure Database for Postgres". OB-Cloud team can provide such an instance when required.
(0120833)
cberner   
2020-06-12 14:33   
Merge Request: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/85 [^]
(0121010)
hgbot   
2020-06-24 09:25   
Repository: erp/devel/pi
Changeset: e8e21dee39c4cc22e0953f6331484915e3e3394a
Author: Cristian Berner <cristian.berner <at> openbravo.com>
Date: Fri Jun 12 14:29:07 2020 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e8e21dee39c4cc22e0953f6331484915e3e3394a [^]

Fixes ISSUE-43952: Fix create.database when db user contains @ char

Database username is now correctly quoted in build-create.xml allowing
names that contain @ and other characters as username. This is important
as Azure instances have as user.name this @ char.

---
M src-db/database/build-create.xml
---