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
NULL in select is escaped (mysqli_sql_exception) #1169
Comments
Not sure I solved it, but I found a work around.
|
Random question - why would you want to do this query anyway? What does it do? As far as I can tell it doesn't do anything - |
That was just a segment of the sql to show the "problem". The actual query:
|
Oh! That makes more sense, then. I don't often use unions, so I didn't even think of that. I'll get that patch applied. Thanks. |
When trying to get a field that does not exist in a table, I get an Unknown column 'NULL' in 'field list' error.
As you can see below, it seems that BaseBuilder is not taking into account that NULL is not a field (then backticks are not needed).
My function is:
And what BaseBuilder gets is:
Obviously, when you try this select (without the backticks) in MySQL, it works fine.
Maybe there is a way to escape NULL in active record select, but if that's the case, I do not know how.
The text was updated successfully, but these errors were encountered: