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

Wrong warning message for ambiguous query [CORE3690] #4038

Closed
firebird-automations opened this issue Dec 5, 2011 · 9 comments
Closed

Wrong warning message for ambiguous query [CORE3690] #4038

firebird-automations opened this issue Dec 5, 2011 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @hvlad

Run ambiguous query :

1. at database in 3rd dialect

SQL> select id from t1, t2;
Statement failed, SQLSTATE = 42702
Dynamic SQL Error
-SQL error code = -204
-Ambiguous field name between table T1 and table T2
-ID

2. at database in 1st sql dialect

SQL> select id from t1, t2;
SQL warning code = 204
-<Missing arg #⁠1 - possibly status vector overflow>
-Ambiguous field name between table T1 and table T2

Warning message is obviously wrong.

Commits: 18fb13e 8be35cd 6a8a920

====== Test Details ======

Implemented by two separate files: core_3690_dialect_1.fbt and core_3690_dialect_3.fbt.
Unfortunately, fbt_run can`t run single .fbt with two different dialects for the same value in 'firebird_version': actually only one of this sections will be checked.

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

The bug was not visible before v3 but wrong code exists in prior versions too

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 2.1.5 [ 10420 ]

Fix Version: 2.5.2 [ 10450 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Sorry, but I have one more question for this old ticket.

C:\MIX\firebird\fb25>C:\MIX\firebird\fb25\bin\isql -sql_ 3 C:\MIX\firebird\fb25\t0.fdb
Database: C:\MIX\firebird\fb25\t0.fdb
SQL> select rdb$relation_id from rdb$database,rdb$database;
Statement failed, SQLSTATE = 42702
Dynamic SQL Error
-SQL error code = -204
-Ambiguous field name between table RDB$DATABASE and table RDB$DATABASE
-RDB$RELATION_ID
SQL> quit;

C:\MIX\firebird\fb25>C:\MIX\firebird\fb25\bin\isql -sql_ 1 C:\MIX\firebird\fb25\t0.fdb

WARNING: This database speaks SQL dialect 3 but Client SQL dialect was set to 1 .
Database: C:\MIX\firebird\fb25\t0.fdb
SQL> select rdb$relation_id from rdb$database,rdb$database;
SQL warning code = 204
-Ambiguous field name between table RDB$DATABASE and table RDB$DATABASE
-RDB$RELATION_ID

RDB$RELATION_ID

        136

It it correct that when we connect via dialect 1 than we get error *AND ALSO* data from such query ?

PS. WI-V2.5.4.26838, database was created in dialect = 3.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

In the second case, you get a warning, not an error. Warnings do not interrupt query execution.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

But is it WRONG or no that in dialect 1 such query can produce results rather than in dialect 3 ? Was such behaviour left intentionally ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Yes, dialect 1 allows such queries for backward compatibility reasons.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

Test Details: Implemented by two separate files: core_3690_dialect_1.fbt and core_3690_dialect_3.fbt.
Unfortunately, fbt_run can`t run single .fbt with two different dialects for the same value in 'firebird_version': actually only one of this sections will be checked.

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