8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 12:43:03 +01:00
This commit is contained in:
asfernandes 2014-07-20 02:19:06 +00:00
parent e49347428f
commit 86487fda92
16 changed files with 49 additions and 33 deletions

View File

@ -3164,9 +3164,8 @@ bool CreateAlterTriggerNode::checkPermission(thread_db* tdbb, jrd_tra* transacti
SCL_check_relation(tdbb, &dscName, SCL_alter);
}
else
{
SCL_check_database(tdbb, SCL_alter);
}
return true;
}
@ -3355,9 +3354,7 @@ bool DropTriggerNode::checkPermission(thread_db* tdbb, jrd_tra* transaction)
END_FOR
if (relationName.isEmpty())
{
SCL_check_database(tdbb, SCL_alter);
}
else
{
dsc dscName;

View File

@ -936,7 +936,7 @@ ddl_privileges($privilegeArray)
;
privileges_opt
:
: // nothing
| PRIVILEGES
;

View File

@ -1409,7 +1409,8 @@ void MET_load_hash_table(gpre_dbb* database)
p = FUN.RDB$QUERY_NAME;
p[length] = 0;
}
gpre_sym* symbol = an_udf->udf_symbol = MSC_symbol(SYM_udf, p, static_cast<USHORT>(strlen(p)), (gpre_ctx*) an_udf);
gpre_sym* symbol = an_udf->udf_symbol = MSC_symbol(SYM_udf,
p, static_cast<USHORT>(strlen(p)), (gpre_ctx*) an_udf);
HSH_insert(symbol);
an_udf->udf_length = ARG.RDB$FIELD_LENGTH;
@ -1637,7 +1638,8 @@ gpre_fld* MET_make_field(const SCHAR* name, SSHORT dtype, SSHORT length, bool in
gpre_index* MET_make_index(const SCHAR* name)
{
gpre_index* index = (gpre_index*) MSC_alloc(IND_LEN);
index->ind_symbol = MSC_symbol(SYM_index, name, static_cast<USHORT>(strlen(name)), (gpre_ctx*) index);
index->ind_symbol = MSC_symbol(SYM_index,
name, static_cast<USHORT>(strlen(name)), (gpre_ctx*) index);
return index;
}
@ -1651,7 +1653,8 @@ gpre_index* MET_make_index(const SCHAR* name)
gpre_rel* MET_make_relation(const SCHAR* name)
{
gpre_rel* relation = (gpre_rel*) MSC_alloc(REL_LEN);
relation->rel_symbol = MSC_symbol(SYM_relation, name, static_cast<USHORT>(strlen(name)), (gpre_ctx*) relation);
relation->rel_symbol = MSC_symbol(SYM_relation,
name, static_cast<USHORT>(strlen(name)), (gpre_ctx*) relation);
return relation;
}
@ -1697,7 +1700,8 @@ bool MET_type(gpre_fld* field, const TEXT* string, SSHORT* ptr)
field_type* type = (field_type*) MSC_alloc(TYP_LEN);
type->typ_field = field;
*ptr = type->typ_value = X.RDB$TYPE;
type->typ_symbol = symbol = MSC_symbol(SYM_type, string, static_cast<USHORT>(strlen(string)), (gpre_ctx*) type);
type->typ_symbol = symbol = MSC_symbol(SYM_type,
string, static_cast<USHORT>(strlen(string)), (gpre_ctx*) type);
HSH_insert(symbol);
return true;
END_FOR

View File

@ -7418,7 +7418,8 @@ static unsigned print_item(TEXT** s, const IsqlVar* var, const unsigned length)
else
{
IcuUtil::pad(p, var->charSet,
static_cast<unsigned>(strnlen(var->value.asChar, var->length)), var->value.asChar, length, false);
static_cast<unsigned>(strnlen(var->value.asChar, var->length)),
var->value.asChar, length, false);
strcat(p, " ");
}
break;
@ -7939,7 +7940,8 @@ static void process_header(Firebird::IMessageMetadata* msg, const unsigned pad[]
p += strlen(p);
// Separators need not go on forever no more than a line
unsigned limit = IcuUtil::charLength(isqlGlob.att_charset, static_cast<unsigned>(strlen(var.alias)), var.alias);
unsigned limit = IcuUtil::charLength(
isqlGlob.att_charset, static_cast<unsigned>(strlen(var.alias)), var.alias);
limit = MAX(limit, pad[i]) + 1;
for (unsigned j = 1; j < limit && j < 80; j++)
@ -8133,7 +8135,8 @@ static unsigned process_message_display(Firebird::IMessageMetadata* message, uns
unsigned data_length, disp_length, alignment;
data_length = disp_length = alignment = var.length;
unsigned namelength = IcuUtil::charLength(isqlGlob.att_charset, static_cast<unsigned>(strlen(var.alias)), var.alias);
unsigned namelength = IcuUtil::charLength(isqlGlob.att_charset,
static_cast<unsigned>(strlen(var.alias)), var.alias);
// Minimum display length should not be less than that needed
// for displaying null

View File

@ -283,9 +283,12 @@ string Jrd::Attachment::stringToMetaCharSet(thread_db* tdbb, const string& str,
if (charSet)
{
if (!MET_get_char_coll_subtype(tdbb, &charSetId, (const UCHAR*) charSet, static_cast<USHORT>(strlen(charSet))))
if (!MET_get_char_coll_subtype(tdbb, &charSetId, (const UCHAR*) charSet,
static_cast<USHORT>(strlen(charSet))))
{
(Arg::Gds(isc_charset_not_found) << Arg::Str(charSet)).raise();
}
}
if (charSetId == CS_METADATA || charSetId == CS_NONE)
return str;

View File

@ -1095,7 +1095,8 @@ void mapUser(string& name, string& trusted_role, Firebird::string* auth_method,
{
newAuthBlock->shrink(0);
newAuthBlock->push(newBlock.getBuffer(), newBlock.getBufferLength());
MAP_DEBUG(fprintf(stderr, "Saved to newAuthBlock %u bytes\n", static_cast<unsigned>(newAuthBlock->getCount())));
MAP_DEBUG(fprintf(stderr, "Saved to newAuthBlock %u bytes\n",
static_cast<unsigned>(newAuthBlock->getCount())));
}
}

View File

@ -491,8 +491,8 @@ public:
virtual RecordSource* compile(thread_db* tdbb, OptimizerBlk* opt, bool innerSubStream);
private:
RecordSource* generate(thread_db* tdbb, OptimizerBlk* opt, const StreamType* streams, FB_SIZE_T nstreams,
BoolExprNodeStack* parentStack, StreamType shellStream);
RecordSource* generate(thread_db* tdbb, OptimizerBlk* opt, const StreamType* streams,
FB_SIZE_T nstreams, BoolExprNodeStack* parentStack, StreamType shellStream);
public:
bool dsqlAll; // UNION ALL

View File

@ -776,8 +776,8 @@ void makeLeftRight(DataTypeUtilBase* dataTypeUtil, const SysFunction* function,
result->setTextType(value->getTextType());
result->setNullable(value->isNullable() || length->isNullable());
result->dsc_length =
dataTypeUtil->fixLength(result, dataTypeUtil->convertLength(value, result)) + static_cast<USHORT>(sizeof(USHORT));
result->dsc_length = dataTypeUtil->fixLength(result,
dataTypeUtil->convertLength(value, result)) + static_cast<USHORT>(sizeof(USHORT));
}
}
@ -890,7 +890,10 @@ void makePad(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc* r
dataTypeUtil->maxBytesPerChar(result->getCharSet()));
}
else
result->dsc_length = static_cast<USHORT>(sizeof(USHORT)) + dataTypeUtil->fixLength(result, MAX_COLUMN_SIZE);
{
result->dsc_length = static_cast<USHORT>(sizeof(USHORT)) +
dataTypeUtil->fixLength(result, MAX_COLUMN_SIZE);
}
}
result->setNullable(isNullable);
@ -948,8 +951,9 @@ void makeReplace(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, ds
result->dsc_length = dataTypeUtil->fixLength(result, searchedLen) + static_cast<USHORT>(sizeof(USHORT));
else
{
result->dsc_length = dataTypeUtil->fixLength(result, MAX(searchedLen,
searchedLen + (searchedLen / findLen) * (replacementLen - findLen))) + static_cast<USHORT>(sizeof(USHORT));
result->dsc_length = dataTypeUtil->fixLength(result,
MAX(searchedLen, searchedLen + (searchedLen / findLen) * (replacementLen - findLen))) +
static_cast<USHORT>(sizeof(USHORT));
}
}

View File

@ -4329,9 +4329,12 @@ static ULONG memory_init(thread_db* tdbb, BufferControl* bcb, SLONG number)
QUE_INIT(tail->bcb_page_mod);
try {
try
{
tail->bcb_bdb = alloc_bdb(tdbb, bcb, &memory);
} catch (Firebird::BadAlloc&) {
}
catch (Firebird::BadAlloc&)
{
// Whoops! Time to reset our expectations. Release the buffer memory
// but use that memory size to calculate a new number that takes into account
// the page buffer overhead. Reduce this number by a 25% fudge factor to

View File

@ -5228,8 +5228,8 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
if (notNull)
{
dsc desc;
desc.makeText(static_cast<USHORT>(strlen(REL.RDB$RELATION_NAME)), CS_METADATA,
(UCHAR*) REL.RDB$RELATION_NAME);
desc.makeText(static_cast<USHORT>(strlen(REL.RDB$RELATION_NAME)),
CS_METADATA, (UCHAR*) REL.RDB$RELATION_NAME);
DeferredWork* work = DFW_post_work(transaction,
dfw_check_not_null, &desc, 0);

View File

@ -207,7 +207,8 @@ SINT64 DYN_UTIL_gen_unique_id(thread_db* tdbb, SSHORT id, const char* generator_
{
const FB_SIZE_T name_length = fb_strlen(generator_name);
fb_assert(name_length < MAX_SQL_IDENTIFIER_SIZE);
const FB_SIZE_T blr_size = static_cast<FB_SIZE_T>(sizeof(gen_id_blr1) + sizeof(gen_id_blr2)) + 1 + name_length;
const FB_SIZE_T blr_size = static_cast<FB_SIZE_T>(
sizeof(gen_id_blr1) + sizeof(gen_id_blr2)) + 1 + name_length;
Firebird::UCharBuffer blr;
UCHAR* p = blr.getBuffer(blr_size);

View File

@ -487,9 +487,9 @@ bool LikeEvaluator<CharType>::processNextChunk(const CharType* data, SLONG data_
SLONG data_pos = 0;
SLONG finishCandidate = -1;
while (data_pos < data_len)
{
FB_SIZE_T branch_number = 0;
while (branch_number < branches.getCount())
{

View File

@ -112,8 +112,8 @@ ULONG maxRecsPerDP(ULONG page_size)
// size of the record index (dpb_repeat) and a record header. This
// gives an artificially high number, reducing the density of db_keys.
ULONG max_records =
static_cast<ULONG>((page_size - sizeof(data_page)) / (sizeof(data_page::dpg_repeat) + offsetof(rhd, rhd_data[0])));
ULONG max_records = static_cast<ULONG>(
(page_size - sizeof(data_page)) / (sizeof(data_page::dpg_repeat) + offsetof(rhd, rhd_data[0])));
// Artificially reduce density of records to test high bits of record number
// max_records = 32000;