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

Client could crash if DDL and DML are executed in the same transaction [CORE2130] #2561

Open
firebird-automations opened this issue Oct 18, 2008 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Kuznetsov Eugene (eugene)

Testing for 2.5, but other versions are also undergone.

isql failed (AV in fbclient.dll) when trying executing select statement, as no fields
exist at that moment. Server should return an error, but doesn't do it.

SET AUTODDL OFF;
SET SQL DIALECT 3;
SET NAMES WIN1251;

CONNECT test25 USER 'SYSDBA' PASSWORD 'masterkey';

CREATE TABLE NEW_TABLE7 (ID SMALLINT NOT NULL);
COMMIT;

insert into NEW_TABLE7(ID) VALUES (0);
COMMIT;

ALTER TABLE NEW_TABLE7
ADD FIELD1 CHAR(1) NOT NULL;

ALTER TABLE NEW_TABLE7
DROP ID;

select * from New_table7;

COMMIT;

--
Best regards, Eugene

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

summary: Client could failed if DDL and DML are produced in the same transaction => Client could crash if DDL and DML are executed in the same transaction

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

priority: Minor [ 4 ] => Major [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Actually, this ticket is not about metadata handling but about API usage. This test case forces the prepare/describe call to clear the sqld value of XSQLDA and pass it to the fetch call. It works okay for the embedded engine but fails for other connection types in the remote protocol code. This situation could be easily reproduced at the API level with any valid select statement.

So, this issue leaves us with a question: should we allow to fetch records with empty output XSQLDA (sqld == 0) or not? The engine itself is ready for that. Also, some clever person could use this trick to check for EOF (or count rows) without retrieving the values of the select list. Therefore, I tend to fix the code to allow such queries. From another side, this "feature" doesn't make any sense for 99% of the users...

Opinions?

@firebird-automations
Copy link
Collaborator Author

Commented by: Kuznetsov Eugene (eugene)

To Dmitry Yemanov

> Opinions?
Though dataset without columns sounds strange for me, it can make sense for optimization goals.
Maybe, we should hear developers dealing with API - Dmitry Kovalenko or Dimitry Sibiryakov, for example.
--
Best regards, Eugene

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

As a minimum requirement AV should be fixed. But IMHO it's better to let remote select 0 columns in SQLDA - if it does not require rewriting half of remote's code.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ] =>

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