Skip to content

Move the call of the checkArgsMismatch function before the call of th… - #8242

Merged
dyemanov merged 2 commits into
FirebirdSQL:masterfrom
Zhdanov0:master-move-checkArgsMismatch-call
Oct 7, 2025
Merged

Move the call of the checkArgsMismatch function before the call of th…#8242
dyemanov merged 2 commits into
FirebirdSQL:masterfrom
Zhdanov0:master-move-checkArgsMismatch-call

Conversation

@Zhdanov0

@Zhdanov0 Zhdanov0 commented Sep 5, 2024

Copy link
Copy Markdown
Contributor

…e setParamsFunc function

Why checkArgsMismatch is executed after the setParamsFunc function and not before it? I think it is more logical to make the checkArgsMismatch check at the place where I put it in the PR. This location is more advantageous because there will be no need to do extra work in the form of calling the setParamsFunc function and other things if you know in advance that the number of arguments is incorrect.

Also, thanks to this location, we don't need to add the “if (argsCount > 1)” check to the setParamsMakeDbKey function, which saves us from unnecessary branching. If you are happy with this solution, I can remove these checks in the existing setParams functions.

I doubt about removing the checkArgsMismatch function call in SysFuncCallNode::pass2.
I haven't found what it might affect and don't understand why it was there.

@dyemanov
dyemanov merged commit 4812905 into FirebirdSQL:master Oct 7, 2025
23 checks passed
@hvlad

hvlad commented Jun 12, 2026

Copy link
Copy Markdown
Member

This PR have no lables, please add

hvlad pushed a commit that referenced this pull request Jun 12, 2026
* Move the call of the checkArgsMismatch function before the call of the setParamsFunc function

* Replace unneeded checks with asserts. Move the JRD-level validation from pass2() to parse().

---------

Co-authored-by: Alexander Zhdanov <alexander.zhdanov@red-soft.ru>
Co-authored-by: Dmitry Yemanov <dyemanov@users.noreply.github.com>
hvlad pushed a commit that referenced this pull request Jun 12, 2026
* Move the call of the checkArgsMismatch function before the call of the setParamsFunc function

* Replace unneeded checks with asserts. Move the JRD-level validation from pass2() to parse().

---------

Co-authored-by: Alexander Zhdanov <alexander.zhdanov@red-soft.ru>
Co-authored-by: Dmitry Yemanov <dyemanov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants