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

Cortex 1.4.2 ['deleted_at =?', null] problems #40

Closed
Deprime opened this issue Feb 28, 2017 · 3 comments
Closed

Cortex 1.4.2 ['deleted_at =?', null] problems #40

Deprime opened this issue Feb 28, 2017 · 3 comments
Labels

Comments

@Deprime
Copy link

Deprime commented Feb 28, 2017

Hello Christian!
It seems that comparison with NULL is not working or I'm doing something wrong (oftenly - the second option T_T).

I have category table with deleted_at filed which is NULL by default.

Usually I used this method to find not deleted categories:
$categories = $category->find(['deleted_at IS NULL']);

But in cortex 1.4.2 this method causes an error. I read the change log and find some new feature like:

  • new: support for NULL filter bind values (like array('foo != ?',null))

So I tried to do like this:
$categories = $category->find(['deleted_at =?', null]);

But the query result was empty.
What am I doing wrong? I do not correctly use the new filter?

ikkez added a commit that referenced this issue Feb 28, 2017
ikkez added a commit that referenced this issue Feb 28, 2017
@ikkez
Copy link
Owner

ikkez commented Feb 28, 2017

You're right. I broke this with another commit at a later time. Just fixed and optimized this now in v1.4.3 hotfix. Thanks for reporting.

@ikkez ikkez added the bug label Feb 28, 2017
@ikkez ikkez closed this as completed Feb 28, 2017
@Deprime
Copy link
Author

Deprime commented Mar 19, 2017

Hello Christian!
There's still some troubles:
$f3->set('categories', $category->find([' pid=? AND deleted_at=? ',NULL,NULL]));

and I get the following error message:
PDOStatement: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULLANDdeleted_at IS NULL' at line 1

ikkez added a commit that referenced this issue Mar 20, 2017
ikkez added a commit that referenced this issue Mar 20, 2017
(cherry picked from commit e5c7514)
@ikkez
Copy link
Owner

ikkez commented Mar 20, 2017

fixed in the latest commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants