Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fb_lock_print which is querying DB without attachments: 1) send to STDLOG (instead STDERR) one line of message; 2) ignores errorlevel env. variable [CORE5467] #5737

Open
firebird-automations opened this issue Jan 22, 2017 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Choose some database _without_ attachments.
Then run following batch on 2.5.7, 3.0.2 and 4.0.0 (correct 'fbc' and 'dbnm' variables to be appropriate to your env.):

===
@echo off
setlocal enabledelayedexpansion enableextensions

set fbc=C:\\FB\\30sC
set dbnm=C:\\FBTESTING\\qa\\fbt\-repo\\tmp\\E30\.fdb

\!fbc\!\\fb\_lock\_print \-c \-a \-d \!dbnm\! 1\>log 2\>err

for /f "tokens=\*" %%a in \('type log'\) do \(
  echo STDLOG: %%a
\)
for /f "tokens=\*" %%a in \('type err'\) do \(
  echo STDERR: %%a
\)


\!fbc\!\\fb\_lock\_print \-c \-a \!dbnm\! 1\>nul 2\>&1
if errorlevel 1 \(
  echo We have a trouble\.\.\.
\) else \(
  echo WAW\.\.\. All fine, NO errors occured\.\.\.
\)

for /d %%i in \(log,err\) do del %%i 2\>nul

===

On 3.0.2 and 4.0 you will see:

STDLOG: Unable to access lock table.
STDERR: File for memory mapping is empty.
WAW... All fine, NO errors occured...

On 2.5.7:

STDLOG: Unable to access lock table.
STDERR: operating system directive CreateFileMapping failed
STDERR: <.... localized message about volume for open file, see below ...> --- [1]
WAW... All fine, NO errors occured...

[1]: this is strange line with following text:
cyrillic: -Том для открытого файла был изменен извне, поэтому работа с этим файлом невозможна.
ascii: ~"Volume for the open file was changed externally, so work with this file is not possible."

IMO, output should be:

STDERR: Unable to access lock table.
STDERR: File for memory mapping is empty.
We have a trouble...

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Component: LOCK_PRINT [ 10120 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

description: Run following batch on 2.5.7, 3.0.2 and 4.0.0:

@echo off
setlocal enabledelayedexpansion enableextensions

set fbc=C:\\FB\\30sC
set dbnm=C:\\FBTESTING\\qa\\fbt\-repo\\tmp\\E30\.fdb

\!fbc\!\\fb\_lock\_print \-c \-a \-d \!dbnm\! 1\>log 2\>err

for /f "tokens=\*" %%a in \('type log'\) do \(
  echo STDLOG: %%a
\)
for /f "tokens=\*" %%a in \('type err'\) do \(
  echo STDERR: %%a
\)


\!fbc\!\\fb\_lock\_print \-c \-a \!dbnm\! 1\>nul 2\>&1
if errorlevel 1 \(
  echo We have a trouble\.\.\.
\) else \(
  echo WAW\.\.\. All fine, NO errors occured\.\.\.
\)

for /d %%i in \(log,err\) do del %%i 2\>nul

===

On 3.0.2 and 4.0 you will see:

STDLOG: Unable to access lock table.
STDERR: File for memory mapping is empty.
WAW... All fine, NO errors occured...

On 2.5.7:

STDLOG: Unable to access lock table.
STDERR: operating system directive CreateFileMapping failed
STDERR: <.... localized message about volume for open file, see below ...> --- [1]
WAW... All fine, NO errors occured...

[1]: this is strange line with following text:
cyrillic: -Том для открытого файла был изменен извне, поэтому работа с этим файлом невозможна.
ascii: ~"Volume for the open file was changed externally, so work with this file is not possible."

IMO, output should be:

STDERR: Unable to access lock table.
STDERR: File for memory mapping is empty.
We have a trouble...

=>

Choose some database _without_ attachments.
Then run following batch on 2.5.7, 3.0.2 and 4.0.0 (correct 'fbc' and 'dbnm' variables to be appropriate to your env.):

===
@echo off
setlocal enabledelayedexpansion enableextensions

set fbc=C:\\FB\\30sC
set dbnm=C:\\FBTESTING\\qa\\fbt\-repo\\tmp\\E30\.fdb

\!fbc\!\\fb\_lock\_print \-c \-a \-d \!dbnm\! 1\>log 2\>err

for /f "tokens=\*" %%a in \('type log'\) do \(
  echo STDLOG: %%a
\)
for /f "tokens=\*" %%a in \('type err'\) do \(
  echo STDERR: %%a
\)


\!fbc\!\\fb\_lock\_print \-c \-a \!dbnm\! 1\>nul 2\>&1
if errorlevel 1 \(
  echo We have a trouble\.\.\.
\) else \(
  echo WAW\.\.\. All fine, NO errors occured\.\.\.
\)

for /d %%i in \(log,err\) do del %%i 2\>nul

===

On 3.0.2 and 4.0 you will see:

STDLOG: Unable to access lock table.
STDERR: File for memory mapping is empty.
WAW... All fine, NO errors occured...

On 2.5.7:

STDLOG: Unable to access lock table.
STDERR: operating system directive CreateFileMapping failed
STDERR: <.... localized message about volume for open file, see below ...> --- [1]
WAW... All fine, NO errors occured...

[1]: this is strange line with following text:
cyrillic: -Том для открытого файла был изменен извне, поэтому работа с этим файлом невозможна.
ascii: ~"Volume for the open file was changed externally, so work with this file is not possible."

IMO, output should be:

STDERR: Unable to access lock table.
STDERR: File for memory mapping is empty.
We have a trouble...

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants