mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 23:23:04 +01:00
Fixed CORE-1398, CORE-1399, CORE-1400.
This commit is contained in:
parent
0c6278f244
commit
0c3710e24e
@ -540,20 +540,30 @@ int CLIB_ROUTINE main(int argc, char** argv)
|
||||
|
||||
/* Open database and go to work */
|
||||
|
||||
const char* local_inet_prefix = "localhost:";
|
||||
const char* local_wnet_prefix = "\\\\.\\";
|
||||
Firebird::PathName conn_str = name;
|
||||
if (conn_str.find(local_inet_prefix) == 0)
|
||||
name += strlen(local_inet_prefix);
|
||||
else if (conn_str.find(local_wnet_prefix) == 0)
|
||||
name += strlen(local_wnet_prefix);
|
||||
Firebird::PathName fileName = name;
|
||||
const Firebird::PathName connName = fileName;
|
||||
Firebird::PathName tempStr;
|
||||
|
||||
Firebird::PathName temp_buf = name;
|
||||
if (ResolveDatabaseAlias(temp_buf, temp_buf)) {
|
||||
name = temp_buf.c_str();
|
||||
#ifdef WIN_NT
|
||||
if (!ISC_analyze_pclan(fileName, tempStr))
|
||||
#endif
|
||||
{
|
||||
if (!ISC_analyze_tcp(fileName, tempStr))
|
||||
{
|
||||
#ifndef NO_NFS
|
||||
if (!ISC_analyze_nfs(fileName, tempStr))
|
||||
#endif
|
||||
{
|
||||
fileName = connName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dba_fil* current = db_open(name, strlen(name));
|
||||
if (ResolveDatabaseAlias(fileName, tempStr)) {
|
||||
fileName = tempStr;
|
||||
}
|
||||
|
||||
dba_fil* current = db_open(fileName.c_str(), fileName.length());
|
||||
tddba->page_size = sizeof(temp);
|
||||
tddba->global_buffer = (pag*) temp;
|
||||
tddba->page_number = -1;
|
||||
@ -579,10 +589,10 @@ int CLIB_ROUTINE main(int argc, char** argv)
|
||||
char file_name[1024];
|
||||
#if defined (WIN95) && !defined (SERVICE_THREAD)
|
||||
if (!fAnsiCP)
|
||||
AnsiToOem(name, file_name);
|
||||
AnsiToOem(fileName.c_str(), file_name);
|
||||
else
|
||||
#endif
|
||||
strcpy(file_name, name);
|
||||
strcpy(file_name, fileName.c_str());
|
||||
|
||||
dba_print(6, file_name, 0, 0, 0, 0); /* msg 6: \nDatabase \"%s\"\n */
|
||||
|
||||
@ -664,7 +674,7 @@ int CLIB_ROUTINE main(int argc, char** argv)
|
||||
password, strlen((char*) password));
|
||||
}
|
||||
|
||||
isc_attach_database(status_vector, 0, name, &DB, dpb.getBufferLength(),
|
||||
isc_attach_database(status_vector, 0, connName.c_str(), &DB, dpb.getBufferLength(),
|
||||
reinterpret_cast<const char*>(dpb.getBuffer()));
|
||||
if (status_vector[1])
|
||||
dba_exit(FINI_ERROR, tddba);
|
||||
|
Loading…
Reference in New Issue
Block a user