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

fix: Throw error if rows in limit is missing for expand, same as in limit() #858

Merged
merged 3 commits into from
Oct 24, 2024

Conversation

SamuelBrucksch
Copy link
Contributor

OData requests like $expand=xxx($skip=5) currently fail, because rows is missing which causes a TypeError on HANA. We already have a missing rows check for limit(), so i added the same here.

@SamuelBrucksch SamuelBrucksch changed the title throw error if rows in limit is missing for expand fix: Throw error if rows in limit is missing for expand, same as in limit() Oct 22, 2024
@@ -421,6 +422,11 @@ class HANAService extends SQLService {
}

if (parent && (limit || one)) {
if (limit && limit.rows == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this also an issue for pg and sqlite?

Copy link
Contributor

@BobdenOs BobdenOs Oct 22, 2024

Choose a reason for hiding this comment

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

This is already handled in the super.limit function, but was missing from the HANA specific expand limit logic (code).

As mentioned in the description:

We already have a missing rows check for limit(), so i added the same here.

@SamuelBrucksch SamuelBrucksch merged commit 641c3b9 into main Oct 24, 2024
3 checks passed
@SamuelBrucksch SamuelBrucksch deleted the fix/forbid-missing-rows-in-expands-in-limit branch October 24, 2024 06:58
@cap-bots cap-bots mentioned this pull request Oct 23, 2024
johannes-vogel added a commit that referenced this pull request Oct 29, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>db-service: 1.14.1</summary>

##
[1.14.1](db-service-v1.14.0...db-service-v1.14.1)
(2024-10-28)


### Fixed

* deep delete for views
([#496](#496))
([82154ef](82154ef))
* properly support `default`, `cds.on.insert` and `cds.on.update` for
`UPSERT` queries ([#425](#425))
([338e9f5](338e9f5))
* SELECT cds.hana.BINARY
([#870](#870))
([33c3ebe](33c3ebe))
</details>

<details><summary>sqlite: 1.7.5</summary>

##
[1.7.5](sqlite-v1.7.4...sqlite-v1.7.5)
(2024-10-28)


### Fixed

* properly support `default`, `cds.on.insert` and `cds.on.update` for
`UPSERT` queries ([#425](#425))
([338e9f5](338e9f5))
</details>

<details><summary>postgres: 1.10.2</summary>

##
[1.10.2](postgres-v1.10.1...postgres-v1.10.2)
(2024-10-28)


### Fixed

* properly support `default`, `cds.on.insert` and `cds.on.update` for
`UPSERT` queries ([#425](#425))
([338e9f5](338e9f5))
</details>

<details><summary>hana: 1.4.0</summary>

##
[1.4.0](hana-v1.3.2...hana-v1.4.0)
(2024-10-28)


### Added

* Improve procedure metadata lookup logic
([#862](#862))
([da629d9](da629d9))


### Fixed

* enable `cesu8` by default for `hdb` driver and encode entries streams
([#868](#868))
([d85d7e6](d85d7e6))
* Include `binary` type with `varbinary` type in `hana-client`
([#871](#871))
([f4d7caf](f4d7caf))
* nested functions in comparisons
([#861](#861))
([f3fd254](f3fd254))
* properly support `default`, `cds.on.insert` and `cds.on.update` for
`UPSERT` queries ([#425](#425))
([338e9f5](338e9f5))
* SELECT cds.hana.BINARY
([#870](#870))
([33c3ebe](33c3ebe))
* Throw error if rows in limit is missing for expand, same as in limit()
([#858](#858))
([641c3b9](641c3b9))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Johannes Vogel <31311694+johannes-vogel@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