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

respect DB restrictions on number of arguments in statements and queries #25036

Merged
merged 3 commits into from
Jan 14, 2021

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Jan 8, 2021

Follow up of #25020

Additionally to what was stated before:

  • in the relevant LDAP issue run the query before there are too many parameters
  • the query builder logs when there are too many parameters in total per statement (by array type parameter)

@blizzz
Copy link
Member Author

blizzz commented Jan 8, 2021

/backport to stable20

@blizzz
Copy link
Member Author

blizzz commented Jan 8, 2021

/backport to stable19

@blizzz
Copy link
Member Author

blizzz commented Jan 8, 2021

might lead to a small conflict with #24948 (execute method in our QueryBuilder), but nothing dramatic.

@rullzer rullzer mentioned this pull request Jan 8, 2021
5 tasks
@blizzz blizzz force-pushed the fix/noid/limitied-allowed-items-db-in_2 branch from 36ed317 to e7c2cd8 Compare January 8, 2021 17:57
@blizzz
Copy link
Member Author

blizzz commented Jan 8, 2021

rebased and adjusted to the dbal bump.

@blizzz blizzz requested a review from nickvergessen January 8, 2021 17:59
@blizzz blizzz force-pushed the fix/noid/limitied-allowed-items-db-in_2 branch from e7c2cd8 to ef28844 Compare January 8, 2021 18:05
@rullzer rullzer mentioned this pull request Jan 11, 2021
14 tasks
@MorrisJobke
Copy link
Member

Postgres says "no".

@blizzz
Copy link
Member Author

blizzz commented Jan 11, 2021

Postgres says "no".

aye. seems to be a form of off-by-1

But confirms the test is working 🚀

@blizzz blizzz force-pushed the fix/noid/limitied-allowed-items-db-in_2 branch from ef28844 to 90005a6 Compare January 11, 2021 10:31
@blizzz blizzz added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jan 11, 2021
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz force-pushed the fix/noid/limitied-allowed-items-db-in_2 branch from 90005a6 to f9484d1 Compare January 11, 2021 12:43
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 11, 2021
@blizzz
Copy link
Member Author

blizzz commented Jan 11, 2021

Postgres says "no".

Not anymore 🧑‍🔧

$slice++;
$fdnsSlice = array_slice($fdns, $sliceSize * ($slice - 1), $sliceSize);

if (!isset($qb)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Psalm:

TypeDoesNotContainType: Cannot resolve types for $qb with type OCP\DB\QueryBuilder\IQueryBuilder and !isset assertion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It occurs to me that Psalm does not understand the unset(), or am I wrong?

Copy link
Member Author

@blizzz blizzz Jan 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz requested a review from MorrisJobke January 13, 2021 14:22
@rullzer rullzer mentioned this pull request Jan 14, 2021
15 tasks
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has tests, so what could go wrong 👍

FYI https://www.php.net/manual/en/function.array-chunk.php seems a tad more elegant than manual slicing, but the result is the same

@blizzz
Copy link
Member Author

blizzz commented Jan 14, 2021

Has tests, so what could go wrong +1

FYI https://www.php.net/manual/en/function.array-chunk.php seems a tad more elegant than manual slicing, but the result is the same

would have a bigger memory footprint as it would return all slices at once.

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

Successfully merging this pull request may close these issues.

5 participants