mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 06:43:04 +01:00
Gbak should backup/restore the new field rdb$description in rdb$roles, depending on ODS.
This commit is contained in:
parent
cc765d02cb
commit
97406b9afd
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
$Id: backup.epp,v 1.64 2004-08-29 06:53:31 robocop Exp $
|
||||
$Id: backup.epp,v 1.65 2004-08-30 10:07:00 robocop Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -152,7 +152,8 @@ enum backup_capabilities
|
||||
BCK_ods6 = 1024, // rdb$field_dimensions and shadow files
|
||||
BCK_ods8 = 2048, // stored procedures & exceptions & constraints
|
||||
BCK_ods9 = 4096, // SQL roles
|
||||
BCK_ods10 = 8192 // FIELD_PRECISION
|
||||
BCK_ods10 = 8192, // FIELD_PRECISION
|
||||
BCK_ods11 = 16384 // rdb$description in rdb$roles
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -193,6 +194,7 @@ const rfr_tab_t rfr_table[] =
|
||||
{"RDB$PROCEDURES", "RDB$PROCEDURE_NAME", BCK_ods8},
|
||||
{"RDB$ROLES", "RDB$ROLE_NAME", BCK_ods9},
|
||||
{"RDB$FIELDS", "RDB$FIELD_PRECISION", BCK_ods10},
|
||||
{"RDB$ROLES", "RDB$DESCRIPTION", BCK_ods11},
|
||||
{0, 0, 0}
|
||||
};
|
||||
|
||||
@ -1949,7 +1951,7 @@ void put_index( burp_rel* relation)
|
||||
general_on_error();
|
||||
END_ERROR;
|
||||
|
||||
put_source_blob (att_index_description2, att_index_description, (ISC_QUAD *)&X.RDB$DESCRIPTION);
|
||||
put_source_blob (att_index_description2, att_index_description, &X.RDB$DESCRIPTION);
|
||||
put_numeric (att_index_type, X.RDB$INDEX_TYPE);
|
||||
|
||||
if (!X.RDB$EXPRESSION_SOURCE.NULL)
|
||||
@ -2255,7 +2257,7 @@ void put_relation( burp_rel* relation)
|
||||
put_source_blob(att_field_description2, att_field_description,
|
||||
& field->fld_description);
|
||||
put_source_blob(att_field_query_header, att_field_query_header,
|
||||
(ISC_QUAD *) & field->fld_query_header);
|
||||
& field->fld_query_header);
|
||||
if (field->fld_security_class[0])
|
||||
PUT_TEXT(att_field_security_class, field->fld_security_class);
|
||||
if (!(field->fld_flags & FLD_position_missing))
|
||||
@ -3725,21 +3727,47 @@ void write_sql_roles(void)
|
||||
|
||||
BurpGlobals* tdgbl = BurpGlobals::getSpecific();
|
||||
|
||||
FOR (REQUEST_HANDLE req_handle1)
|
||||
X IN RDB$ROLES
|
||||
if (tdgbl->BCK_capabilities & BCK_ods11)
|
||||
{
|
||||
FOR (REQUEST_HANDLE req_handle1)
|
||||
X IN RDB$ROLES
|
||||
WITH X.RDB$SYSTEM_FLAG NE 1 OR X.RDB$SYSTEM_FLAG MISSING
|
||||
|
||||
put(tdgbl, rec_sql_roles);
|
||||
const SSHORT l = PUT_TEXT(att_role_name, X.RDB$ROLE_NAME);
|
||||
PUT_TEXT (att_role_owner_name, X.RDB$OWNER_NAME);
|
||||
put(tdgbl, att_end);
|
||||
MISC_terminate (X.RDB$ROLE_NAME, temp, l, sizeof(temp));
|
||||
BURP_verbose (249, temp, NULL, NULL, NULL, NULL);
|
||||
// msg 249 writing SQL role: %s
|
||||
put(tdgbl, rec_sql_roles);
|
||||
const SSHORT l = PUT_TEXT(att_role_name, X.RDB$ROLE_NAME);
|
||||
PUT_TEXT (att_role_owner_name, X.RDB$OWNER_NAME);
|
||||
if (!X.RDB$DESCRIPTION.NULL) {
|
||||
put_source_blob (att_role_description, att_role_description,
|
||||
&X.RDB$DESCRIPTION);
|
||||
}
|
||||
put(tdgbl, att_end);
|
||||
MISC_terminate (X.RDB$ROLE_NAME, temp, l, sizeof(temp));
|
||||
BURP_verbose (249, temp, NULL, NULL, NULL, NULL);
|
||||
// msg 249 writing SQL role: %s
|
||||
|
||||
END_FOR;
|
||||
ON_ERROR
|
||||
general_on_error();
|
||||
END_ERROR;
|
||||
END_FOR;
|
||||
ON_ERROR
|
||||
general_on_error();
|
||||
END_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
FOR (REQUEST_HANDLE req_handle1)
|
||||
X IN RDB$ROLES
|
||||
|
||||
put(tdgbl, rec_sql_roles);
|
||||
const SSHORT l = PUT_TEXT(att_role_name, X.RDB$ROLE_NAME);
|
||||
PUT_TEXT (att_role_owner_name, X.RDB$OWNER_NAME);
|
||||
put(tdgbl, att_end);
|
||||
MISC_terminate (X.RDB$ROLE_NAME, temp, l, sizeof(temp));
|
||||
BURP_verbose (249, temp, NULL, NULL, NULL, NULL);
|
||||
// msg 249 writing SQL role: %s
|
||||
|
||||
END_FOR;
|
||||
ON_ERROR
|
||||
general_on_error();
|
||||
END_ERROR;
|
||||
}
|
||||
|
||||
MISC_release_request_silent(req_handle1);
|
||||
}
|
||||
|
@ -477,6 +477,7 @@ enum att_type {
|
||||
// SQL roles attributes
|
||||
att_role_name = SERIES,
|
||||
att_role_owner_name,
|
||||
att_role_description,
|
||||
|
||||
// Check constraints attributes
|
||||
att_chk_constraint_name = SERIES,
|
||||
@ -841,6 +842,7 @@ public:
|
||||
*/
|
||||
// burp_fld* v3_cvt_fld_list;
|
||||
|
||||
// The handles_get... are for restore.
|
||||
isc_req_handle handles_get_character_sets_req_handle1;
|
||||
isc_req_handle handles_get_chk_constraint_req_handle1;
|
||||
isc_req_handle handles_get_collation_req_handle1;
|
||||
@ -877,6 +879,7 @@ public:
|
||||
isc_req_handle handles_get_type_req_handle1;
|
||||
isc_req_handle handles_get_user_privilege_req_handle1;
|
||||
isc_req_handle handles_get_view_req_handle1;
|
||||
// The handles_put.. are for backup.
|
||||
isc_req_handle handles_put_index_req_handle1;
|
||||
isc_req_handle handles_put_index_req_handle2;
|
||||
isc_req_handle handles_put_index_req_handle3;
|
||||
|
@ -24,7 +24,7 @@
|
||||
* 2003.08.17 Claudio Valderrama: Fix SF Bug #750659.
|
||||
*/
|
||||
/*
|
||||
$Id: restore.epp,v 1.81 2004-08-29 06:53:31 robocop Exp $
|
||||
$Id: restore.epp,v 1.82 2004-08-30 10:07:00 robocop Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -5026,6 +5026,8 @@ bool get_sql_roles()
|
||||
|
||||
X.RDB$ROLE_NAME.NULL = TRUE;
|
||||
X.RDB$OWNER_NAME.NULL = TRUE;
|
||||
X.RDB$DESCRIPTION.NULL = TRUE;
|
||||
X.RDB$SYSTEM_FLAG.NULL = TRUE;
|
||||
skip_init(&scan_next_attr);
|
||||
|
||||
while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end)
|
||||
@ -5049,6 +5051,11 @@ bool get_sql_roles()
|
||||
GET_TEXT(X.RDB$OWNER_NAME);
|
||||
break;
|
||||
|
||||
case att_role_description:
|
||||
get_source_blob (&X.RDB$DESCRIPTION, false);
|
||||
X.RDB$DESCRIPTION.NULL = FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
/*************************************************
|
||||
**
|
||||
|
Loading…
Reference in New Issue
Block a user