8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:43:02 +01:00
This commit is contained in:
asfernandes 2011-10-27 01:04:14 +00:00
parent 4f1b4fe10f
commit 906ea4729e
16 changed files with 66 additions and 83 deletions

View File

@ -32,7 +32,7 @@ MERGE statement
VALUES <left paren> <value list> <right paren>
Syntax rules:
1. At least one of <merge when matched> and <merge when not matched> should be specified.
1. At least one of <merge when matched> or <merge when not matched> should be specified.
Scope:
DSQL, PSQL

View File

@ -65,21 +65,21 @@ Result FB_CARG DebugServer::startAuthentication(Firebird::IStatus* status, const
str.erase();
#ifdef AUTH_VERBOSE
fprintf(stderr, "DebugServerInstance::startAuthentication: tA-tag=%d dpb=%p\n", tags->trustedAuth, dpb);
fprintf(stderr, "DebugServer::startAuthentication: tA-tag=%d dpb=%p\n", tags->trustedAuth, dpb);
#endif
if (tags->trustedAuth && dpb && dpb->find(tags->trustedAuth))
{
unsigned int len;
const UCHAR* s = dpb->get(&len);
#ifdef AUTH_VERBOSE
fprintf(stderr, "DebugServerInstance::startAuthentication: get()=%.*s\n", len, s);
fprintf(stderr, "DebugServer::startAuthentication: get()=%.*s\n", len, s);
#endif
str.assign(s, len);
}
str += '_';
#ifdef AUTH_VERBOSE
fprintf(stderr, "DebugServerInstance::startAuthentication: %s\n", str.c_str());
fprintf(stderr, "DebugServer::startAuthentication: %s\n", str.c_str());
#endif
return AUTH_MORE_DATA;
}
@ -96,7 +96,7 @@ Result FB_CARG DebugServer::contAuthentication(Firebird::IStatus* status, const
try
{
#ifdef AUTH_VERBOSE
fprintf(stderr, "DebugServerInstance::contAuthentication: %.*s\n", size, data);
fprintf(stderr, "DebugServer::contAuthentication: %.*s\n", size, data);
#endif
Firebird::MasterInterfacePtr()->upgradeInterface(writerInterface, FB_AUTH_WRITER_VERSION, upInfo);
writerInterface->add(Firebird::string((const char*) data, size).c_str());
@ -114,7 +114,7 @@ void FB_CARG DebugServer::getData(const unsigned char** data, unsigned short* da
*data = reinterpret_cast<const unsigned char*>(str.c_str());
*dataSize = str.length();
#ifdef AUTH_VERBOSE
fprintf(stderr, "DebugServerInstance::getData: %.*s\n", *dataSize, *data);
fprintf(stderr, "DebugServer::getData: %.*s\n", *dataSize, *data);
#endif
}
@ -139,14 +139,14 @@ Result FB_CARG DebugClient::startAuthentication(Firebird::IStatus* status, const
{
str = "HAND";
#ifdef AUTH_VERBOSE
fprintf(stderr, "DebugClientInstance::startAuthentication: %s\n", str.c_str());
fprintf(stderr, "DebugClient::startAuthentication: %s\n", str.c_str());
#endif
if (dpb && tags->trustedAuth)
{
Firebird::MasterInterfacePtr()->upgradeInterface(dpb, FB_AUTH_CLUMPLETS_VERSION, upInfo);
dpb->add(tags->trustedAuth, str.c_str(), str.length());
#ifdef AUTH_VERBOSE
fprintf(stderr, "DebugClientInstance::startAuthentication: DPB filled\n");
fprintf(stderr, "DebugClient::startAuthentication: DPB filled\n");
#endif
return AUTH_SUCCESS;
}
@ -164,7 +164,7 @@ Result FB_CARG DebugClient::contAuthentication(Firebird::IStatus* status, const
try
{
#ifdef AUTH_VERBOSE
fprintf(stderr, "DebugClientInstance::contAuthentication: %.*s\n", size, data);
fprintf(stderr, "DebugClient::contAuthentication: %.*s\n", size, data);
#endif
str.assign(data, size);
const char* env = getenv("ISC_DEBUG_AUTH");
@ -186,7 +186,7 @@ void FB_CARG DebugClient::getData(const unsigned char** data, unsigned short* da
*data = reinterpret_cast<const unsigned char*>(str.c_str());
*dataSize = str.length();
#ifdef AUTH_VERBOSE
fprintf(stderr, "DebugClientInstance::getData: %.*s\n", *dataSize, *data);
fprintf(stderr, "DebugClient::getData: %.*s\n", *dataSize, *data);
#endif
}

View File

@ -1741,7 +1741,7 @@ void CVT_conversion_error(const dsc* desc, ErrorFunction err)
* A data conversion error occurred. Complain.
*
**************************************/
Firebird::string message;
string message;
if (desc->dsc_dtype == dtype_blob)
message = "BLOB";

View File

@ -534,30 +534,35 @@ namespace {
#ifdef DEB_EVNT
struct AbsPtr
{
SLONG offset;
int fn;
bool bad()
{
return offset < 0 || fn < 0;
}
AbsPtr()
: offset(-1), fn(-1)
{ }
bool operator==(const AbsPtr& sec) const
{
return offset == sec.offset && fn == sec.fn;
}
bool bad()
{
return offset < 0 || fn < 0;
}
SLONG offset;
int fn;
};
static AbsPtr absPtr(const void* s)
{
const int n = getByAddress((UCHAR*) s);
AbsPtr rc;
if (n >= 0)
{
rc.offset = (IPTR)s - (IPTR)(sharedFiles[n].from);
rc.offset = (IPTR) s - (IPTR) (sharedFiles[n].from);
rc.fn = sharedFiles[n].fileNum;
}
return rc;
}
#endif // DEB_EVNT
@ -726,6 +731,7 @@ namespace {
} state;
int code;
};
GlobalPtr<Array<Dump> > dump;
GlobalPtr<Mutex> dMutex;

View File

@ -149,7 +149,7 @@ extern "C" {
#endif
#ifdef SA_SIGINFO
static void CLIB_ROUTINE signal_action(int number, siginfo_t *siginfo, void *context);
static void CLIB_ROUTINE signal_action(int number, siginfo_t* siginfo, void* context);
#else
static void CLIB_ROUTINE signal_action(int number);
#endif
@ -346,7 +346,7 @@ static SIG que_signal(int signal_number,
#ifdef SA_SIGINFO
static void CLIB_ROUTINE signal_action(int number, siginfo_t *siginfo, void *context)
static void CLIB_ROUTINE signal_action(int number, siginfo_t* siginfo, void* context)
#else
static void CLIB_ROUTINE signal_action(int number)
#endif

View File

@ -1031,6 +1031,7 @@ UnicodeUtil::ConversionICU& UnicodeUtil::getConversionICU()
LocalStatus lastError;
string version;
const int majorArray[] = {4, 3, 5, 6, 0};
for (const int* major = majorArray; *major; ++major)
{
for (int minor = 20; minor--; ) // from 19 down to 0
@ -1054,9 +1055,7 @@ UnicodeUtil::ConversionICU& UnicodeUtil::getConversionICU()
<< Arg::StatusVector(lastError.get())).raise();
}
else
{
(Arg::Gds(isc_random) << "Could not find acceptable ICU library").raise();
}
// compiler warning silencer
return *convIcu;

View File

@ -32,4 +32,3 @@ CREATE TABLE QLI$PROCEDURES (QLI$PROCEDURE_NAME QLI$PROCEDURE_NAME,
/* Index definitions for all user tables */
CREATE UNIQUE INDEX QLI$PROCEDURES_IDX1 ON QLI$PROCEDURES(QLI$PROCEDURE_NAME);

View File

@ -218,7 +218,6 @@ namespace
dsql_ctx* oldContext;
string oldAlias, oldInternalAlias;
AutoSetRestore<USHORT> autoFlags;
bool hasModContext;
};
} // namespace

View File

@ -2376,9 +2376,9 @@ static void compress(thread_db* tdbb,
UCHAR* ptr;
size_t length;
if (isNull) {
if (isNull)
length = 0;
}
else if (itype >= idx_first_intl_string || itype == idx_metadata)
{
DSC to;
@ -2394,24 +2394,23 @@ static void compress(thread_db* tdbb,
length = INTL_string_to_key(tdbb, itype, desc, &to, key_type);
}
else
{
length = MOV_get_string(desc, &ptr, &buffer, MAX_KEY);
}
if (length)
{
// clear key_empty flag, because length is >= 1
key->key_flags &= ~key_empty;
if (length > sizeof(key->key_data)) {
if (length > sizeof(key->key_data))
length = sizeof(key->key_data);
}
if (descending && ((*ptr == desc_end_value_prefix) || (*ptr == desc_end_value_check)))
{
*p++ = desc_end_value_prefix;
if ((length + 1) > sizeof(key->key_data)) {
if ((length + 1) > sizeof(key->key_data))
length = sizeof(key->key_data) - 1;
}
}
memcpy(p, ptr, length);
p += length;
}
@ -2419,19 +2418,18 @@ static void compress(thread_db* tdbb,
{
// Leave key_empty flag, because the string is an empty string
if (descending && ((pad == desc_end_value_prefix) || (pad == desc_end_value_check)))
{
*p++ = desc_end_value_prefix;
}
*p++ = pad;
}
while (p > key->key_data)
{
if (*--p != pad) {
if (*--p != pad)
break;
}
}
key->key_length = p + 1 - key->key_data;
key->key_length = p + 1 - key->key_data;
return;
}

View File

@ -244,7 +244,8 @@ void SHUT_database(thread_db* tdbb, SSHORT flag, SSHORT delay)
}
}
if (!exclusive && !successful && (timeout > 0 || flag & (isc_dpb_shut_attachment | isc_dpb_shut_transaction)))
if (!exclusive && !successful &&
(timeout > 0 || flag & (isc_dpb_shut_attachment | isc_dpb_shut_transaction)))
{
notify_shutdown(tdbb, 0, -1); // Tell everyone we're giving up
attachment->att_flags &= ~ATT_shutdown_manager;

View File

@ -306,9 +306,7 @@ void ConfigStorage::acquire()
void ConfigStorage::release()
{
fb_assert(m_recursive > 0);
const FB_THREAD_ID currTID = getThreadId();
fb_assert(m_mutexTID == currTID);
fb_assert(m_mutexTID == getThreadId());
if (--m_recursive == 0)
{

View File

@ -116,9 +116,9 @@ private:
void putItem(ITEM tag, ULONG len, const void* data);
bool getItemLength(ITEM& tag, ULONG& len);
int m_recursive;
int m_recursive;
FB_THREAD_ID m_mutexTID;
int m_cfg_file;
int m_cfg_file;
bool m_dirty;
};

View File

@ -4264,7 +4264,8 @@ static THREAD_ENTRY_DECLARE garbage_collector(THREAD_ENTRY_PARAM arg)
jrd_rel* relation = NULL;
jrd_tra* transaction = NULL;
AutoPtr<GarbageCollector> gc(FB_NEW(*attachment->att_pool) GarbageCollector(*attachment->att_pool, dbb));
AutoPtr<GarbageCollector> gc(FB_NEW(*attachment->att_pool) GarbageCollector(
*attachment->att_pool, dbb));
try
{

View File

@ -2307,7 +2307,8 @@ SRQ_PTR LockManager::grant_or_que(Attachment* attachment, lrq* request, lbl* loc
}
bool LockManager::init_owner_block(Arg::StatusVector& statusVector, own* owner, UCHAR owner_type, LOCK_OWNER_T owner_id)
bool LockManager::init_owner_block(Arg::StatusVector& statusVector, own* owner, UCHAR owner_type,
LOCK_OWNER_T owner_id)
{
/**************************************
*

View File

@ -592,8 +592,7 @@ static Rvnt* find_event(rem_port*, SLONG);
static bool get_new_dpb(ClumpletWriter&, const ParametersSet&);
static void handle_error(ISC_STATUS);
static void info(IStatus*, Rdb*, P_OP, USHORT, USHORT, USHORT,
const UCHAR*, USHORT, const UCHAR*, ULONG, UCHAR*,
AuthClientPlugins* authItr = NULL);
const UCHAR*, USHORT, const UCHAR*, ULONG, UCHAR*, AuthClientPlugins* authItr = NULL);
static void init(IStatus*, rem_port*, P_OP, PathName&, ClumpletWriter&);
static Rtr* make_transaction(Rdb*, USHORT);
static void mov_dsql_message(const UCHAR*, const rem_fmt*, UCHAR*, const rem_fmt*);
@ -620,16 +619,10 @@ static void svcstart(IStatus*, Rdb*, P_OP, USHORT, USHORT, USHORT, const UCHAR*)
static void unsupported();
static void zap_packet(PACKET *);
static void authFillParametersBlock(AuthClientPlugins& authItr,
ClumpletWriter& dpb,
const Auth::AuthTags* tags,
rem_port* port);
static void authReceiveResponse(AuthClientPlugins& authItr,
rem_port* port,
Rdb* rdb,
const Auth::AuthTags* tags,
IStatus* status,
PACKET* packet);
static void authFillParametersBlock(AuthClientPlugins& authItr, ClumpletWriter& dpb,
const Auth::AuthTags* tags, rem_port* port);
static void authReceiveResponse(AuthClientPlugins& authItr, rem_port* port, Rdb* rdb,
const Auth::AuthTags* tags, IStatus* status, PACKET* packet);
static AtomicCounter remote_event_id;
@ -5843,10 +5836,8 @@ static void info(IStatus* status,
}
// Let plugins try to add data to DPB in order to avoid extra network roundtrip
static void authFillParametersBlock(AuthClientPlugins& authItr,
ClumpletWriter& dpb,
const Auth::AuthTags* tags,
rem_port* port)
static void authFillParametersBlock(AuthClientPlugins& authItr, ClumpletWriter& dpb,
const Auth::AuthTags* tags, rem_port* port)
{
LocalStatus s;
Auth::DpbImplementation di(dpb);
@ -5879,12 +5870,8 @@ static void authFillParametersBlock(AuthClientPlugins& authItr,
}
}
static void authReceiveResponse(AuthClientPlugins& authItr,
rem_port* port,
Rdb* rdb,
const Auth::AuthTags* tags,
IStatus* status,
PACKET* packet)
static void authReceiveResponse(AuthClientPlugins& authItr, rem_port* port, Rdb* rdb,
const Auth::AuthTags* tags, IStatus* status, PACKET* packet)
{
LocalStatus s;
@ -5985,11 +5972,8 @@ static void authReceiveResponse(AuthClientPlugins& authItr,
(Arg::Gds(isc_login) << Arg::StatusVector(s.get())).raise();
}
static void init(IStatus* status,
rem_port* port,
P_OP op,
PathName& file_name,
ClumpletWriter& dpb)
static void init(IStatus* status, rem_port* port, P_OP op, PathName& file_name,
ClumpletWriter& dpb)
{
/**************************************
*
@ -6012,8 +5996,8 @@ static void init(IStatus* status,
AuthClientPlugins authItr(PluginType::AuthClient, FB_AUTH_CLIENT_VERSION, upInfo);
authFillParametersBlock(authItr, dpb,
op == op_service_attach ? &Auth::SVC_ATTACH_LIST : &Auth::DB_ATTACH_LIST,
port);
op == op_service_attach ? &Auth::SVC_ATTACH_LIST : &Auth::DB_ATTACH_LIST,
port);
if (port->port_protocol < PROTOCOL_VERSION12)
{
@ -6061,8 +6045,8 @@ static void init(IStatus* status,
send_packet(port, packet);
authReceiveResponse(authItr, port, rdb,
op == op_service_attach ? &Auth::SVC_ATTACH_LIST : &Auth::DB_ATTACH_LIST,
status, packet);
op == op_service_attach ? &Auth::SVC_ATTACH_LIST : &Auth::DB_ATTACH_LIST,
status, packet);
}
catch (const Exception&)
{

View File

@ -4754,15 +4754,13 @@ void YService::query(IStatus* status, unsigned int sendLength, const unsigned ch
{
ClumpletWriter spb(ClumpletReader::SpbSendItems, MAX_DPB_SIZE, sendItems, sendLength);
if (!regular.next)
{
populateSpb(spb, isc_info_svc_auth_block);
}
checkSpbLen = receiveLength;
checkSpbPresent = receiveItems;
YEntry<YService> entry(status, this, SERV_QUERY);
entry.next()->query(status, spb.getBufferLength(), spb.getBuffer(), receiveLength, receiveItems,
bufferLength, buffer);
entry.next()->query(status, spb.getBufferLength(), spb.getBuffer(),
receiveLength, receiveItems, bufferLength, buffer);
checkSpbLen = 0;
checkSpbPresent = NULL;
}
@ -4780,9 +4778,7 @@ void YService::start(IStatus* status, unsigned int spbLength, const unsigned cha
{
ClumpletWriter spb(ClumpletReader::SpbStart, MAX_DPB_SIZE, spbItems, spbLength);
if (!regular.next)
{
populateSpb(spb, isc_spb_auth_block);
}
YEntry<YService> entry(status, this, SERV_START);
entry.next()->start(status, spb.getBufferLength(), spb.getBuffer());
@ -5081,7 +5077,8 @@ YService* Dispatcher::attachServiceManager(IStatus* status, const char* serviceN
svcName.trim();
ClumpletReader spbReader(ClumpletReader::SpbAttach, spb, spbLength);
if ((spbReader.find(isc_spb_auth_block) && spbReader.getClumpLength() > 0) || ISC_check_if_remote(svcName, false))
if ((spbReader.find(isc_spb_auth_block) && spbReader.getClumpLength() > 0) ||
ISC_check_if_remote(svcName, false))
{
IProvider* provider = NULL;
service = getServiceManagerByName(&provider, status, svcName.c_str(), spbLength, spb);