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

Windows system errors are formatted with extra hard return and newline [CORE1129] #1550

Closed
firebird-automations opened this issue Feb 14, 2007 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Bill Oliver (verbguy)

Assigned to: Claudio Valderrama C. (robocop)

Is related to QA98

When we format an error message that includes a Windows error message, we get an extra hard return and newline in the buffer (\r\n). For example, observe the blank line below between the error message and the SQL prompt (Firebird 2 release, Windows XP):

C:\workspace\vj>\fb2\bin\isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> connect 'not_there.fdb';
Statement failed, SQLCODE = -902
I/O error for file "C:\WORKSPACE\VJ\NOT_THERE.FDB"
-Error while trying to open file
-The system cannot find the file specified.

SQL>

The "The system cannot find the file specified." string is a windows error.

I believe the fix for this is to change the call to FormatMessage in src/jrd/gds.cpp. Specifically, change

if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,

to

if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,

I've tested this with Vulcan and it seems to do the trick.

Commits: 87c9f2b

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

assignee: Claudio Valderrama C. [ robocop ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Claudio Valderrama C. (robocop)

Committed the code suggested by Bill Oliver.

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.1 [ 10041 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Fix Version: 2.1 Alpha 1 [ 10150 ]

Fix Version: 2.1.0 [ 10041 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA98 [ QA98 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

Fix verified.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 11596 ] => Firebird [ 15266 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

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