-
-
Notifications
You must be signed in to change notification settings - Fork 10
-
I've run into a tricky issue with encoding backslashes in the projection_name where queries. In certain MySQL conditions, probably governed by https://dev.mysql.com/doc/refman/8.4/en/sql-mode.html#sqlmode_no_backslash_escapes, the projections don't get found because of the backslashes in the namespaced model names.
Storage seems to be fine, however in the queries the backslashes need to be doubled up (App\Models\Projections\MailStatsProjection needs to be transformed into App\\Models\\Projections\\MailStatsProjection). Within Laravel Eloquent there is a similar case with the MorphTo queries. Not sure yet how they have solved it.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments
-
The NO_BACKSLASH_ESCAPES SQL option is highly discouraged as that will cause issues when escaping of content is required for storage.
Beta Was this translation helpful? Give feedback.
All reactions
-
The fix for this issue is to use explicit parameter binding and have the database figure out character escaping. The pull request for this fix is #32
Beta Was this translation helpful? Give feedback.