[Greater-commits] r306 - trunk/GREAT-ER-DB/impl/postgresql
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jun 29 16:43:10 CEST 2011
Author: bricks
Date: 2011-06-29 16:43:09 +0200 (Wed, 29 Jun 2011)
New Revision: 306
Modified:
trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
Log:
Fix additional lower-/uppercase problems
Modified: trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-29 13:27:41 UTC (rev 305)
+++ trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-29 14:43:09 UTC (rev 306)
@@ -23759,7 +23759,7 @@
else
{
/* case b) */
- sprintf(h_user_id_qry, "%s", vp_user_id);
+ lda_strtoupper(h_user_id_qry, vp_user_id);
}
/*
@@ -24017,6 +24017,7 @@
char h_role_name[256];
long h_phrase_grp_id;
int h_count;
+ char h_lower_user_id[ 31];
/*
char h_cre_syn_statement[100];
char h_synonym[256];
@@ -24055,12 +24056,13 @@
*
* Table ALL_USERS is PG_USER in PostgreSQL (fieldname -> usename)
* --------------------------------------------------------------------- */
- strcpy(h_user.user_id, vp_user->user_id);
+ lda_strtoupper(h_user.user_id, vp_user->user_id);
+ lda_strtolower(h_lower_user_id, vp_user->user_id);
errln = 20;
EXEC SQL SELECT COUNT(USENAME) INTO :h_count
FROM PG_USER
- WHERE USENAME = LOWER(:h_user.user_id);
+ WHERE USENAME = :h_lower_user_id;
if (h_count == 0)
{
@@ -24070,7 +24072,7 @@
* IDENTIFIED BY in Oracle is WITH PASSWORD in PostgreSQL
* ------------------------------------------------------------------- */
sprintf (h_create_statement, "CREATE USER %s WITH PASSWORD '%s'",
- h_user.user_id, vp_password);
+ h_lower_user_id, vp_password);
errln = 30;
EXEC SQL EXECUTE IMMEDIATE :h_create_statement;
}
@@ -24240,8 +24242,8 @@
\return DA_SUCCESS \n DA_FAIL
*/
-int gda_update_user (DB_con *db_con,
- DA_T_user *vp_user,
+int gda_update_user (DB_con *db_con,
+ DA_T_user *vp_user,
DA_T_errinfo *vp_errinfo)
{
DA_T_MODULE_NAME v_module = "gda_update_user";
@@ -24289,7 +24291,7 @@
/*
* copy passed record into host variable
*/
- strcpy(h_user_id_qry , vp_user->user_id);
+ lda_strtoupper(h_user_id_qry, vp_user->user_id);
strcpy(h_user.user_id , vp_user->user_id);
h_user.group_id = vp_user->group_id;
strcpy(h_user.cre_date , vp_user->cre_date);
@@ -24375,6 +24377,7 @@
EXEC SQL BEGIN DECLARE SECTION;
/* host variables */
char h_user_id[31];
+ char h_lower_user_id[31];
long h_phrase_grp_id;
char h_role_name[256];
char h_revoke_statement[300];
@@ -24404,7 +24407,8 @@
/* init local variables */
strcpy (v_errortext, "(");
- strcpy (h_user_id , vp_user_id);
+ lda_strtoupper(h_user_id , vp_user_id);
+ lda_strtolower(h_lower_user_id , vp_user_id);
strcpy (h_con_name , db_con->con_name);
EXEC SQL SET CONNECTION TO :h_con_name;
@@ -24591,7 +24595,7 @@
WHERE PHRASE_GRP_ID = :h_phrase_grp_id;
sprintf (h_revoke_statement, "REVOKE %s FROM %s",
- h_role_name, h_user_id);
+ h_role_name, h_lower_user_id);
errln = 250;
EXEC SQL EXECUTE IMMEDIATE :h_revoke_statement;
@@ -24653,7 +24657,7 @@
EXEC SQL WHENEVER NOT FOUND GOTO error;
errln = 320;
- sprintf (h_drop_statement, "DROP ROLE %s", h_user_id);
+ sprintf (h_drop_statement, "DROP ROLE %s", h_lower_user_id);
EXEC SQL EXECUTE IMMEDIATE :h_drop_statement;
/* record successfully deleted */
More information about the Greater-commits
mailing list