mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 06:03:02 +01:00
Warn users when qli cannot do DDL on a db (due to FB version >= 3).
This commit is contained in:
parent
87f2c336de
commit
20568d2751
@ -2,7 +2,7 @@
|
||||
set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES (?, ?, ?, ?);
|
||||
--
|
||||
('2010-02-25 12:40:00', 'JRD', 0, 700)
|
||||
('2009-07-16 05:41:59', 'QLI', 1, 530)
|
||||
('2010-03-15 06:59:09', 'QLI', 1, 531)
|
||||
--
|
||||
--('2008-11-28 20:27:04', 'GDEF', 2, 346)
|
||||
--
|
||||
|
@ -1412,7 +1412,8 @@ Roll back all databases or commit databases individually', NULL, NULL);
|
||||
(NULL, 'usage', 'dtr.cpp', NULL, 1, 526, NULL, ' -z show program version', NULL, NULL)
|
||||
(NULL, 'usage', 'dtr.cpp', NULL, 1, 527, NULL, ' Options can be abbreviated to the unparenthesized characters', NULL, NULL)
|
||||
(NULL, 'usage', 'dtr.cpp', NULL, 1, 528, NULL, 'Start qli without [command] to enter interactive mode', NULL, NULL)
|
||||
(NULL, 'main', 'dtr.cpp', NULL, 1, 529, NULL, 'qli: ignoring unknown switch @1', NULL, NULL);
|
||||
(NULL, 'main', 'dtr.cpp', NULL, 1, 529, NULL, 'qli: ignoring unknown switch @1', NULL, NULL)
|
||||
(NULL, 'install', 'meta.epp', NULL, 1, 530, NULL, 'Warning: cannot issue DDL statements against database "@1"', NULL, NULL)
|
||||
-- GFIX
|
||||
('gfix_db_name', 'ALICE_gfix', 'alice.c', NULL, 3, 1, NULL, 'data base file name (@1) already given', NULL, NULL);
|
||||
('gfix_invalid_sw', 'ALICE_gfix', 'alice.c', NULL, 3, 2, NULL, 'invalid switch @1', NULL, NULL);
|
||||
|
@ -340,7 +340,8 @@ const ULONG DBB_cap_dimensions = 4096; // Database supports arrays -- What a da
|
||||
//const ULONG DBB_cap_external_type = 8192; // Database supports external datatypes. Unused
|
||||
const ULONG DBB_cap_rfr_sys_flag = 16384; // Database hasn't forgotten about the system flag
|
||||
const ULONG DBB_cap_filters = 32768; // Database supports filters
|
||||
const ULONG DBB_cap_index_type = 65536; // Database has too damn much stuff
|
||||
const ULONG DBB_cap_index_type = 65536; // Database has descending indices
|
||||
const ULONG DBB_cap_nodyn = 131072; // Database (really, engine) does not support DYN
|
||||
// Relation block
|
||||
|
||||
struct qli_rel
|
||||
|
@ -151,6 +151,7 @@ static const rfr_tab_t rfr_table[] =
|
||||
{ "RDB$RELATION_FIELDS", "RDB$SYSTEM_FLAG", DBB_cap_rfr_sys_flag },
|
||||
{ "RDB$FILTERS", "RDB$FUNCTION_NAME", DBB_cap_filters },
|
||||
{ "RDB$INDICES", "RDB$INDEX_TYPE", DBB_cap_index_type },
|
||||
{ "RDB$PROCEDURES", "RDB$ENGINE_NAME", DBB_cap_nodyn }, // FB3.0
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
|
||||
@ -2085,7 +2086,8 @@ static bool check_relation( qli_rel* relation)
|
||||
|
||||
FOR(REQUEST_HANDLE relation->rel_database->dbb_requests[REQ_relation_def]
|
||||
TRANSACTION_HANDLE relation->rel_database->dbb_meta_trans)
|
||||
X IN DB.RDB$RELATIONS WITH X.RDB$RELATION_NAME EQ relation->rel_symbol->sym_string
|
||||
X IN DB.RDB$RELATIONS
|
||||
WITH X.RDB$RELATION_NAME EQ relation->rel_symbol->sym_string
|
||||
previously_defined = true;
|
||||
END_FOR
|
||||
ON_ERROR
|
||||
@ -2140,13 +2142,12 @@ static void clone_fields( qli_rel* target, qli_rel* source)
|
||||
STUFF(isc_dyn_version_1);
|
||||
STUFF(isc_dyn_begin);
|
||||
|
||||
FOR(REQUEST_HANDLE req1
|
||||
TRANSACTION_HANDLE s_trans)
|
||||
Y IN DB.RDB$RELATION_FIELDS
|
||||
CROSS F IN DB.RDB$FIELDS
|
||||
WITH Y.RDB$RELATION_NAME = source->rel_symbol->sym_string
|
||||
AND Y.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME
|
||||
// If SQL made this field, create a new global field for it
|
||||
FOR(REQUEST_HANDLE req1 TRANSACTION_HANDLE s_trans)
|
||||
Y IN DB.RDB$RELATION_FIELDS
|
||||
CROSS F IN DB.RDB$FIELDS
|
||||
WITH Y.RDB$RELATION_NAME = source->rel_symbol->sym_string
|
||||
AND Y.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME
|
||||
// If SQL made this field, create a new global field for it
|
||||
if (F.RDB$COMPUTED_BLR.NULL &&
|
||||
!fb_utils::implicit_domain(Y.RDB$FIELD_NAME) &&
|
||||
fb_utils::implicit_domain(F.RDB$FIELD_NAME))
|
||||
@ -2329,8 +2330,7 @@ static void clone_global_fields( qli_rel* target, qli_rel* source)
|
||||
qli_rlb* rlb = NULL;
|
||||
bool first_field = true;
|
||||
|
||||
FOR(REQUEST_HANDLE req1
|
||||
TRANSACTION_HANDLE s_trans)
|
||||
FOR(REQUEST_HANDLE req1 TRANSACTION_HANDLE s_trans)
|
||||
RFR IN DB.RDB$RELATION_FIELDS CROSS
|
||||
Y IN DB.RDB$FIELDS
|
||||
WITH RFR.RDB$RELATION_NAME = source->rel_symbol->sym_string AND
|
||||
@ -2858,7 +2858,7 @@ static void install( qli_dbb* old_dbb)
|
||||
|
||||
// Copy the database block to one out of the permanent pool
|
||||
|
||||
SSHORT l = old_dbb->dbb_filename_length;
|
||||
const SSHORT l = old_dbb->dbb_filename_length;
|
||||
qli_dbb* new_dbb = (qli_dbb*) ALLOCPV(type_dbb, l);
|
||||
new_dbb->dbb_filename_length = l;
|
||||
memcpy(new_dbb->dbb_filename, old_dbb->dbb_filename, l);
|
||||
@ -2888,6 +2888,13 @@ static void install( qli_dbb* old_dbb)
|
||||
|
||||
get_database_type(new_dbb);
|
||||
set_capabilities(new_dbb);
|
||||
if (new_dbb->dbb_capabilities & DBB_cap_nodyn)
|
||||
{
|
||||
const char* str = new_dbb->dbb_filename;
|
||||
if (name && strncmp(name->nam_string, "QLI_", 4))
|
||||
str = name->nam_string;
|
||||
ERRQ_msg_put(530, str);
|
||||
}
|
||||
|
||||
// Get all relations in database. For each relation make up a
|
||||
// relation block, make up a symbol block, and insert the symbol
|
||||
|
Loading…
Reference in New Issue
Block a user