Alex Lourie has posted comments on this change.

Change subject: backend: changing template1 encoding to utf8
......................................................................


Patch Set 1: (2 inline comments)

Some comments inline.

Code is generally OK, but I don't think that it belongs in create_db.sh

It feels more naturally that it should go to our wrapper engine-db-install.sh, 
as create_db.sh should not be called at all if prerequisites are not fulfilled. 
And having our DBs created in utf8 encoding is a prerequisite.

....................................................
File backend/manager/dbscripts/create_db.sh
Line 44: 
Line 45: printf "Creating the database: ${DATABASE}\n"
Line 46: #try to drop the database first (if exists)
Line 47: dropdb --username=${USERNAME} --host=${SERVERNAME} --port=${PORT} 
${DATABASE} -e > /dev/null
Line 48: RET=`execute_command "select encoding from pg_database WHERE 
datname='template1';" postgres ${SERVERNAME} ${PORT}`
why postgres? User USERNAME here, it should be ok for SELECTs
Line 49:     if [[ ! $RET == 6  ]]
Line 50:         if [[ ! $SERVERNAME=="localhost"]]
Line 51:             then
Line 52:                 echo "The current encoding in template1 db is not set 
to UTF8.\n in order for the engine to function properly template1 encoding must 
be UTF8"


Line 45: printf "Creating the database: ${DATABASE}\n"
Line 46: #try to drop the database first (if exists)
Line 47: dropdb --username=${USERNAME} --host=${SERVERNAME} --port=${PORT} 
${DATABASE} -e > /dev/null
Line 48: RET=`execute_command "select encoding from pg_database WHERE 
datname='template1';" postgres ${SERVERNAME} ${PORT}`
Line 49:     if [[ ! $RET == 6  ]]
this would be better: if [ $RET ne 6 ]
Line 50:         if [[ ! $SERVERNAME=="localhost"]]
Line 51:             then
Line 52:                 echo "The current encoding in template1 db is not set 
to UTF8.\n in order for the engine to function properly template1 encoding must 
be UTF8"
Line 53:             else


--
To view, visit http://gerrit.ovirt.org/8936
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib380cc82f4ef7f30b266d29cfa27707fcb5b3601
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ohad Basan <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Kiril Nesenko <[email protected]>
Gerrit-Reviewer: Moran Goldboim <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to