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

String truncation occurs when selecting from a view containing NOT IN inside [CORE3211] #3585

Closed
firebird-issue-importer opened this issue Nov 2, 2010 · 6 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Nov 2, 2010

Submitted by: @dyemanov

Is duplicated by CORE3270
Is related to QA448

Test case:

CREATE TABLE T ( ID integer, FIELD1 varchar(30) );

CREATE VIEW VT ( ID )
AS
select http://T1.ID from T as T1 where T1.FIELD1 not in ( select T2.FIELD1 from T as T2 where T2.FIELD1 = 'system1' )
;

INSERT INTO T (ID, FIELD1) VALUES (1, 'system');
INSERT INTO T (ID, FIELD1) VALUES (2, 'system');
INSERT INTO T (ID, FIELD1) VALUES (3, 'system');
INSERT INTO T (ID, FIELD1) VALUES (4, 'system');
INSERT INTO T (ID, FIELD1) VALUES (5, 'system');

COMMIT WORK;

select * from VT;
-- ERROR: string right truncation

The problem is that every select retrieves the db_key/record_version pair and they're described as having length of 8 and 4 bytes respectively. But these values gets concatenated in this case, because expand_view_nodes() returns two items. It seems being related to NOT IN, because an equivalent query with NOT EXISTS works fine. The same query without a view also works fine.

Commits: 792fbc8 fd68563 f3277d0 FirebirdSQL/fbt-repository@63d79e3

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 2, 2010

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 4, 2010

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.1 [ 10333 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 3, 2010

Modified by: @dyemanov

Link: This issue is duplicated by CORE3270 [ CORE3270 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 24, 2011

Modified by: @pcisar

Link: This issue is related to QA448 [ QA448 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 4, 2013

Modified by: @pmakowski

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

Fix Version: 3.0 Alpha 1 [ 10331 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 16, 2015

Modified by: @pavel-zotov

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

QA Status: Done successfully

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

Successfully merging a pull request may close this issue.

None yet
2 participants