Issue Details (XML | Word | Printable)

Key: CORE-3690
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Vlad Khorsun
Reporter: Vlad Khorsun
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Wrong warning message for ambiguous query

Created: 05/Dec/11 01:00 PM   Updated: 20/Feb/15 07:31 PM
Component/s: Engine
Affects Version/s: 3.0 Initial
Fix Version/s: 2.1.5, 2.5.2, 3.0 Alpha 1

Time Tracking:
Not Specified

Planning Status: Unspecified


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 05/Dec/11 01:17 PM
The bug was not visible before v3 but wrong code exists in prior versions too

Pavel Zotov added a comment - 20/Feb/15 05:27 PM
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.

Dmitry Yemanov added a comment - 20/Feb/15 05:55 PM
In the second case, you get a warning, not an error. Warnings do not interrupt query execution.

Pavel Zotov added a comment - 20/Feb/15 07:19 PM
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 ?

Dmitry Yemanov added a comment - 20/Feb/15 07:31 PM
Yes, dialect 1 allows such queries for backward compatibility reasons.