-
Notifications
You must be signed in to change notification settings - Fork 11.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
[5.3] Where year type issue #16737
Comments
I was unable to reproduce this issue. |
None that I can find at least. Both cases prints the same SQL query. select * from "orders" where strftime('%Y', "created_at") = ? and "orders"."deleted_at" is null |
All works fine for me ... I have tried to use string and integer but the result is the same.
|
Can't generate this either, @vinkla did you manage to get around it by any means? |
@themsaid no, it only works if I typecast the integers to strings. Maybe it is something on my machine and setup. Closing this for now. Thanks for getting back. |
Description:
I've database table of orders. I fetch the orders with
whereYear
. If the year argument is a integer it wont find any orders but if I typecast the year to a string it works.This might be something on my end but I found it odd so I thought it was best to report it.
Also, this worked fine on PHP 7.0 without any issues.
Edit: I double checked the documentation and the examples are using strings. Maybe we should typecast all integers to strings for
whereYear
,whereDay
andwhereMonth
? Or maybe force developers to pass strings?Steps To Reproduce:
This wont work since the year is an integer.
This will work since the year is a string.
The text was updated successfully, but these errors were encountered: