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

Possible BuildExceptionMessage problem [DNET243] #250

Closed
firebird-automations opened this issue Jun 14, 2009 · 4 comments
Closed

Possible BuildExceptionMessage problem [DNET243] #250

firebird-automations opened this issue Jun 14, 2009 · 4 comments

Comments

@firebird-automations
Copy link

Submitted by: tonim (tonim)

Votes: 1

The function public void BuildExceptionMessage()
Inside iscexception.cs file catch the formating errors, and
provides the message "No message error found".
An example is the sql warning 204 for dialect 1 connections
(order by code, where code can be a column of more than one
table)

This error message (warning) have no arguments but has
inside the message the {0} so the appendformat expect an
artument at least.

To fix this I think it should be done like this:
// Avoid incorrectly build mesage args
try
{
builder.AppendFormat(CultureInfo.CurrentCulture, message,
args);
}
catch
{
builder.Append(message);
}
Really the message exists but it's incorrectly build (or
incorrectly translated for future multilingual messages).

Then the message is: Field Ambiguity, sql error {0}...
instead of "No error message found for.."

@firebird-automations
Copy link
Author

Modified by: @cincuranet

reporter: Jiri Cincura [ cincura_net ] => tonim [ tonim ]

description: The function public void BuildExceptionMessage() Inside iscexception.cs file catch the formating errors, and provides the message "No message error found".
An example is the sql warning 204 for dialect 1 connections (order by code, where code can be a column of more than one
table)

This error message (warning) have no arguments but has inside the message the {0} so the appendformat expect an artument at least.

To fix this I think it should be done like this:
// Avoid incorrectly build mesage args
try
{
builder.AppendFormat(CultureInfo.CurrentCulture, message, args); } catch {
builder.Append(message);
}
Really the message exists but it's incorrectly build (or incorrectly translated for future multilingual messages).

Then the message is: Field Ambiguity, sql error {0}...
instead of "No error message found for.."

=>

The function public void BuildExceptionMessage()
Inside iscexception.cs file catch the formating errors, and
provides the message "No message error found".
An example is the sql warning 204 for dialect 1 connections
(order by code, where code can be a column of more than one
table)

This error message (warning) have no arguments but has
inside the message the {0} so the appendformat expect an
artument at least.

To fix this I think it should be done like this:
// Avoid incorrectly build mesage args
try
{
builder.AppendFormat(CultureInfo.CurrentCulture, message,
args);
}
catch
{
builder.Append(message);
}
Really the message exists but it's incorrectly build (or
incorrectly translated for future multilingual messages).

Then the message is: Field Ambiguity, sql error {0}...
instead of "No error message found for.."

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Can you provide some sample?

I followed your steps, but without success.
In isql:
SQL> set sql dialect 1;
SQL> create database 'localhost:d1_test.fdb';
SQL> create table t1 (id int primary key, code int);
SQL> create table t2 (id int primary key, code int);

In code:
using (FbConnection conn = new FbConnection(@"database=localhost:d1_test.fdb;user=sysdba;password=masterkey;dialect=1"))
{
conn.Open();
using (FbCommand cmd = conn.CreateCommand())
{
cmd.CommandText = "select * from t1 inner join t2 on (http://t1.id = http://t2.id) order by code";
cmd.ExecuteScalar();
}
}

With this I get exception message:
Dynamic SQL Error
SQL error code = -204
Ambiguous field name between a field and a field in the select list with name
CODE

So no problem at all.

@firebird-automations
Copy link
Author

Commented by: @cincuranet

I need some example to see the problem and to fix it, if any. I will reopen the ticket, if somebody will provide it.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Closed [ 6 ]

resolution: Cannot Reproduce [ 5 ]

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