-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
store unencrypted size in the unencrypted_size column #31966
Conversation
6dd55d3
to
ab499e8
Compare
075c050
to
9467d9e
Compare
To test:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks 👍
Just some minor comments that can be ignored
as discussed in chat:
|
8f2d1f6
to
18ce8ec
Compare
526afc2
to
44a1b35
Compare
$x = $this->helper->quoteColumnName($x); | ||
$y = $this->helper->quoteColumnName($y); | ||
return $this->expressionBuilder->comparison($x, $operator, $y); | ||
return new QueryFunction($this->expressionBuilder->comparison($x, $operator, $y)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a public API change?
would need to be mentionned in #32117
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@icewind1991 can you clarify ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In guess so strictly speaking, but the result here only really gets used by other query builder parts so no app should care about the actual type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied this PR to my (somewhat customized) Docker image that I am developing. It worked just fine a few days ago, but when I ran it just now, it threw the following error upon trying to access the root page:
{
"reqId": "EIZn0TU6px16gqETseAb",
"level": 3,
"time": "2022-05-30T00:09:52+00:00",
"remoteAddr": "192.168.0.202",
"user": "--",
"app": "PHP",
"method": "GET",
"url": "/",
"message": "Declaration of OC\\DB\\QueryBuilder\\ExpressionBuilder\\ExpressionBuilder::comparison($x, string $operator, $y, $type = null): OCP\\DB\\QueryBuilder\\IQueryFunction must be compatible with OCP\\DB\\QueryBuilder\\IExpressionBuilder::comparison($x, string $operator, $y, $type = null): string at /var/www/html/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#119",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36",
"version": "24.0.1.1"
}
I'm fairly adept at debugging Nextcloud and know my way around the code, but this particular PR is quite involved, so I'm not sure where to start to provide more information. Feel free to ask, though - I'm happy to help!
@icewind1991 some conflicts |
cb45fe3
to
636fe59
Compare
this allows passing the expressions to further expressions without them being escaped as column names Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
b5c5969
to
8238582
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@CarlSchwan could you please review this? |
@szaimen could you please review? |
oh, so the backport got merged before master: #32708 |
This breaks circle Return value of OCA\Circles\Tools\Db\ExtendedQueryBuilder::exprLimit() must be of the type string, object returned |
@icewind1991 can you communicate the API change somehow and put it in #32117 |
This also breaks the Mail app So yeah, this is a breaking change. |
* @since 8.2.0 - Parameter $type was added in 9.0.0 | ||
* | ||
* @psalm-taint-sink sql $x | ||
* @psalm-taint-sink sql $y | ||
* @psalm-taint-sink sql $type | ||
*/ | ||
public function eq($x, $y, $type = null): string; | ||
public function eq($x, $y, $type = null): IQueryFunction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from a naming perspective this should have been something like an IExpression
Given the unexpected breakage I guess reverting this and using the more "minimal" version from #32708 instead. |
The column is right there
Store the unencrypted size in the
unencrypted_size
column instead of thesize
column, fixes some issues where other code (object storage) stores the encrypted size in the cache.