Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,7 @@ bool get_relation(BurpGlobals* tdgbl); | |
bool get_relation_data(BurpGlobals* tdgbl); | ||
bool get_sql_roles(BurpGlobals* tdgbl); | ||
bool get_mapping(BurpGlobals* tdgbl); | ||
bool get_db_creator(BurpGlobals* tdgbl); | ||
bool get_security_class(BurpGlobals* tdgbl); | ||
void get_source_blob(BurpGlobals* tdgbl, ISC_QUAD&, bool); | ||
USHORT get_text(BurpGlobals* tdgbl, TEXT*, ULONG); | ||
|
@@ -8905,6 +8906,70 @@ bool get_mapping(BurpGlobals* tdgbl) | |
return true; | ||
} | ||
|
||
bool get_db_creator(BurpGlobals* tdgbl) | ||
{ | ||
/************************************** | ||
* | ||
* g e t _ d b _ c r e a t o r | ||
* | ||
************************************** | ||
* | ||
* Functional description | ||
* Restore database creators | ||
* | ||
**************************************/ | ||
att_type attribute; | ||
scan_attr_t scan_next_attr; | ||
TEXT temp[GDS_NAME_LEN]; | ||
SSHORT l; | ||
Firebird::string role; | ||
|
||
if (tdgbl->runtimeODS >= DB_VERSION_DDL12) | ||
{ | ||
STORE (REQUEST_HANDLE tdgbl->handles_db_creators_req_handle1) | ||
C IN RDB$DB_CREATORS | ||
|
||
C.RDB$USER.NULL = TRUE; | ||
C.RDB$USER_TYPE.NULL = TRUE; | ||
|
||
skip_init(&scan_next_attr); | ||
while (skip_scan(&scan_next_attr), get_attribute(&attribute, tdgbl) != att_end) | ||
{ | ||
switch (attribute) | ||
{ | ||
case att_dbc_user: | ||
C.RDB$USER.NULL = FALSE; | ||
GET_TEXT(C.RDB$USER); | ||
if (tdgbl->firstDbc) | ||
{ | ||
tdgbl->firstDbc = false; | ||
BURP_verbose(394); | ||
// msg 394 restoring database creators | ||
} | ||
BURP_verbose (393, C.RDB$USER); | ||
break; | ||
|
||
case att_dbc_type: | ||
C.RDB$USER_TYPE.NULL = FALSE; | ||
C.RDB$USER_TYPE = (USHORT) get_int32(tdgbl); | ||
break; | ||
|
||
default: | ||
// msg 395 database creator | ||
bad_attribute(scan_next_attr, attribute, 395); | ||
break; | ||
} | ||
} | ||
|
||
END_STORE; | ||
ON_ERROR | ||
general_on_error (); | ||
END_ERROR; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
dyemanov
Member
|
||
bool is_ascii_name (const TEXT *name, const SSHORT len) | ||
{ | ||
/************************************** | ||
|
@@ -10921,6 +10986,12 @@ bool restore(BurpGlobals* tdgbl, Firebird::IProvider* provider, const TEXT* file | |
flag = true; | ||
break; | ||
|
||
case rec_db_creator: | ||
if (!get_db_creator(tdgbl)) | ||
return false; | ||
flag = true; | ||
break; | ||
|
||
default: | ||
BURP_error(43, true, SafeArg() << record); | ||
// msg 43 don't recognize record type %ld | ||
|
Why are both these functions inside the DB_VERSION_DDL11 block? These tables exist in ODS12 only. Currently it's harmless due to the correct ODS check inside the functions, but I'd rather prefer to fix the IF condition here and then remove the duplicated ODS checks inside the functions (like it's done for write_packages(), for example).