-
Notifications
You must be signed in to change notification settings - Fork 22
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
SingleStore does not allow a order by in a delete query #84
Comments
Hey @Cosnavel With your changes, the connector may produce an incorrect result. I prefer to throw an error in this case by default and add a special flag What do you think about this? |
Hey @AdalbertMemSQL, We also encountered several errors because of subqueries like this so in a bit concerned.
|
Hmm.... Can you open a separate issue regarding subqueries with examples of queries that caused this error? |
Hi, We are going through the same situation. And it's not just DELETE, it also happens with UPDATE when using notifications() from Illuminate\Notifications\Notifiable. |
Looks like this order by behaviour is specific to MySQL
|
I see. The problem is calling the |
Or maybe it will work for updates:
|
With this change, it won't throw an error. But it may delete wrong rows (as it will ignore order by). |
As we are working with Filament we can't customize the query when using Filament Notifications Database. Something like these in the Singlestore driver when exists
|
Queries like this will only work properly if the table has an id column with unique values. |
I'm planning to add an option to ignore |
Hi, To report that
The exception: |
@arthurmarchesi Thanks for reporting this case. |
Yes, I just checked out. Thank you. |
We are in the process of migrating to Singlestore and have encountered a compatibility issue with Laravel's Database Notifications.
The issue arises from the HasDatabaseNotifications trait, which defines a relationship that automatically applies a
latest
sorting order by default. This sorting behavior is intended for notification retrieval but also inadvertently affects deletion operations. While this automatically generated query functions correctly in MySQL and PostgreSQL, it appears that Singlestore does not support this syntax.HasDatabaseNotification Trait and Relation
Example of a produced query when trying to delete a notification via relation and the corresponding error from Singlestore
@carlsverre the behaviour should be documented in Singlestores doc. In the example is a order by in a subquery but no mention of the not allowed behaviour.
Reference: https://docs.singlestore.com/cloud/reference/sql-reference/data-manipulation-language-dml/delete/#example
@olliescase
The text was updated successfully, but these errors were encountered: