Open firebird-automations opened 16 years ago
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?
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
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.
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