Hi all.
I can't understand why my IB6 server restarts with message:
Abnormal termination...
Server started...
in the next situation:
In ISQL I execute:
SELECT LI_RC FROM BR_CC_CREATE_USER ('USEROCHEK', 'PASSIK', 'SNLWS', ' ');
where BR_CC_CREATE_USER is a stored procedure:
create procedure BR_CC_CREATE_USER (
S_USNAME varchar(32) character set WIN1251,
S_USPSW varchar(9) character set WIN1251,
S_SERVER varchar(32) character set WIN1251,
S_RESERVED varchar(32) character set WIN1251)
returns (
LI_RC smallint)
as
BEGIN
LI_RC = br_createuser(S_SERVER, S_USNAME, S_USPSW);
END
where br_createuser is a UDF declared as:
DECLARE EXTERNAL FUNCTION BR_CREATEUSER
CSTRING(32) CHARACTER SET WIN1251, CSTRING(32) CHARACTER SET WIN1251,
CSTRING(9) CHARACTER SET WIN1251
RETURNS SMALLINT
ENTRY_POINT 'br_createuser' MODULE_NAME 'br_utils';
br_createuser has the next realization, which was taken from documentation:
int br_createuser (char *DBServer, char *UName, char *UPSW)
{
ISC_STATUS isc_status[20];
USER_SEC_DATA user_data;
int li_rc;
user_data.server = DBServer;
user_data.user_name = UName;
user_data.password = UPSW;
user_data.protocol = sec_protocol_tcpip;
user_data.dba_user_name = "SYSDBA";
user_data.dba_password = "masterkey"; /* Don't hardcode this */
user_data.sec_flags = sec_server_spec
| sec_password_spec
| sec_dba_user_name_spec
| sec_dba_password_spec;
isc_add_user(isc_status, &user_data);
if(isc_status[0] == 1 && isc_status[1])
{
switch (isc_status[1])
{
case isc_usrname_too_long:
// The user name passed in is greater than 31 bytes
li_rc = -1;
break;
...<here I cut the text to shorten its length>
default:
// Unknown error
li_rc = -100;
break;
}
}
else
{
li_rc = 1;
}
return li_rc;
As I said server restarts, ISQL looses connection, but I can see that new
user is created.
By the way, UDF br_createuser has been successfully executed from C++ (not
trough stored procedure).
I suspect that the matter is in the declaration of UDF, but I don't know
where exactly.
Does anybody have any idea about it?
Please help me.
Nickolay S.