Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Missing arg #1 - possibly status vector overflow #7392

Open
EPluribusUnum opened this issue Nov 22, 2022 · 4 comments
Open

Missing arg #1 - possibly status vector overflow #7392

EPluribusUnum opened this issue Nov 22, 2022 · 4 comments

Comments

@EPluribusUnum
Copy link

Hi!

We get

" Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 1, column 3028.
).
<Missing arg #1 - possibly status vector overflow>.
SQLCODE: -104
SQLSTATE: 42000
GDSCODE: 335544569 "

error when execute this command

EXECUTE PROCEDURE pu_afa_legyujt(137885459, 'S', 'N', NULL, 138045796, NULL)

Firebird 3.0.9, Linux, Windows, classic server.
I can send you the FTP access informations for the database.
The original code works on FB25, and also works on FB30 with other customers.

If we modified the PU_AFA_LEGYUJT_ELLENORZES procedure part

execute statement 'insert into pu_afahibak ' || ' (id, csop_id, tipus, ' || ' ugyfel_kod, ugyfel_megnevezes, hivszam, ' || ' iktato, ' || ' pu_biz_id, sv, pu_btet_gysor)' || ' select gen_id(xrptid_gen, 1), ' || cast(:pu_afahibak_csop__id as varchar(20)) || ', ''H'', ' || ' u.kod, u.megnevezes, a.hivszam, ' || ' a.iktato, ' || ' a.id, a.sv, b.gysor ' || ' from PU_BIZ A ' || ' inner join PU_BTET B on B.PBIZ_ID = A.ID ' || ' left outer join UGYFEL_T U on U.ID = A.UGYF_ID ' || ' left outer join PU_IKT_T I on I.IKTIP_KOD = A.IKTIP_KOD and I.KOD = A.IKT_T_KOD ' || ' left outer join pu_biz_afainfo ai on ai.id = a.id ' || :whr || ' and u.id is not null and i.id is not null ' || -- left outer joinok innerré alakítása, de így jobb az index használat ' and b.afa_kulcs not similar to ''[[:DIGIT:]]+'' ' || ' and a.orszagtip = ''3''' || ' and a.sv = ''S''' || ' and u.jelleg in (''G'',''P'')' || -- nincs áfatípus megadva! ' and b.pu_afatipus_id is null'; end

to

execute statement 'insert into pu_afahibak ' || ' (id, csop_id, tipus, ' || ' ugyfel_kod, ugyfel_megnevezes, hivszam, ' || ' iktato, ' || ' pu_biz_id, sv, pu_btet_gysor)' || ' select gen_id(xrptid_gen, 1), ' || cast(:pu_afahibak_csop__id as varchar(20)) || ', ''H'', ' || ' u.kod, u.megnevezes, a.hivszam, ' || ' a.iktato, ' || ' a.id, a.sv, b.gysor ' || ' from PU_BIZ A ' || ' inner join PU_BTET B on B.PBIZ_ID = A.ID ' || ' left outer join UGYFEL_T U on U.ID = A.UGYF_ID ' || ' left outer join PU_IKT_T I on I.IKTIP_KOD = A.IKTIP_KOD and I.KOD = A.IKT_T_KOD ' || ' left outer join pu_afatipus aft on aft.id = b.pu_afatipus_id ' || ' left outer join pu_biz_afainfo ai on ai.id = a.id ' || :whr || ' and u.id is not null and i.id is not null ' || -- left outer joinok innerré alakítása, de így jobb az index használat ' and b.afa_kulcs not similar to ''[[:DIGIT:]]+'' ' || ' and a.orszagtip = ''3''' || ' and a.sv = ''S''' || ' and u.jelleg in (''G'',''P'')' || -- nincs áfatípus megadva! ' and aft.id is null'; end

the error disappears, the call works as expected. This is a workaround, we do not want to keep this, the original code should work.

Thank you!

@omachtandras
Copy link

Hi All,

it's a pretty weird bug.
Select works with hundreds of databases on 3.0.10 and worked on 2.5.9 before we convert this company's database.
This company runs Firebird 3.0.10 released version, windows server, superclassic mode.

The simplified query looks like this:
select a.*
from table_a a
inner join table_b b on b.a_id = a.id
where a.c_id is null

The following trick works:
select a.*
from table_a a
inner join table_b b on b.a_id = a.id
left outer join table_c c on c.id = a.c_id
where c.id is null

@hvlad
Copy link
Member

hvlad commented Dec 24, 2022

Could you explain the issue ? What is the problem with "simplified" query ?

@omachtandras
Copy link

Could you explain the issue ? What is the problem with "simplified" query ?

I made the simplified case just so that the structure of the select can be seen in a more readable way and how we temporarily avoided the problem.

The problem is that there are many selects with this structure in our program for many years and there is no problem with them. Only now, only in one place and only in this one case.
It would be good to understand what causes it, because we will not be able to detect / rewrite it everywhere.

@aafemt
Copy link
Contributor

aafemt commented Dec 24, 2022

Start from quoting full error text, please. In firebird-support mail list, not here,

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants