FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.24k stars 212 forks source link

fbsvcmgr info_svr_db_info does not see active attachments and databases in use (CLASSIC only) [CORE5413] #5686

Open firebird-automations opened 7 years ago

firebird-automations commented 7 years ago

Submitted by: @pavel-zotov

1) ensure that FB 2.5 instance works as Classic: REG.EXE query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FirebirdServerfb25cs | findstr /i /c:"ImagePath"

Output: ---------- ImagePath REG_EXPAND_SZ C:\MIX\firebird\fb25Cs\bin\fb_inet_server.exe -s FB25Cs

(OK, there is no '-m' switch' ==> this is Classic)

2) connect to any database using this FB instance and stay in ISQL prompt:

C:\MIX\firebird\fb25Cs>C:\MIX\firebird\fb25Cs\bin\isql localhost/3249:e25 -z ISQL Version: WI-V2.5.7.27027 Firebird 2.5 Server version: WI-V2.5.7.27027 Firebird 2.5 WI-V2.5.7.27027 Firebird 2.5/tcp (csprog)/P12 WI-V2.5.7.27027 Firebird 2.5/tcp (csprog)/P12 Database: localhost/3249:e25 SQL>

3) try to get number of active databases and attachments:

C:\MIX\firebird\fb25Cs>C:\MIX\firebird\fb25Cs\bin\fbsvcmgr localhost:service_mgr info_svr_db_info -z Firebird services manager version WI-V2.5.7.27027 Firebird 2.5 Databases: Number of attachments: 0 <<< ??? Number of databases: 0 <<< ???

The same on FB 3.0.x & 4.0.

firebird-automations commented 7 years ago

Commented by: @dyemanov

This was the case since the very beginning, the service manager returns only info about the server process you are connected to.

firebird-automations commented 7 years ago

Commented by: @pavel-zotov

IMO, it will be good to warn user not to use such option (' info_svr_db_info') against Classic - I mean when issue 'fbsvcmgr -?'

firebird-automations commented 7 years ago

Commented by: @dyemanov

fbsvcmgr is a trivial interface over the Services API. IMHO, it shouldn't be smarter than the underlying API.