-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[com_finder] - cast to char before use LIKE operator on datetime/tim… #12348
Conversation
…stamp field A timestamp/datetime field CANNOT be used with LIKE we need to cast to char before in standard SQL
@@ -215,7 +215,7 @@ protected function getListQuery() | |||
// Filter by indexdate only if $search doesn't contains non-ascii characters | |||
if (!preg_match('/[^\x00-\x7F]/', $search)) | |||
{ | |||
$orSearchSql .= ' OR ' . $db->quoteName('l.indexdate') . ' LIKE ' . $search; | |||
$orSearchSql .= ' OR CAST((' . $db->quoteName('l.indexdate') . ') AS CHAR(19)) LIKE ' . $search; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use $query->castAsChar()
please. I've also looked and realized we don't have a proper implementation of that for the MySQL drivers (the default implementation just returns the value).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've noticed that too, matter for another PR
used $query->castAsChar()
used |
@alikon ist this PR for testing or waiting on Answer? |
Is ready to test thanks
…On 12 Jan 2017 10:34 am, "Franz Wohlkönig" ***@***.***> wrote:
@alikon <https://github.com/alikon> ist this PR for testing or waiting on
Answer?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12348 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALFsTUi5eglrGStHuebm2wp8GJ_udomks5rRfOXgaJpZM4KRqzm>
.
|
Searched for "12. 3. 1991" as Part of an Article-Titel in Backend, which is found with and without Patch. |
@franz-wohlkoenig this PR is only for backend |
I have tested this item ✅ successfully on 98cf619 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12348. |
I have tested this item ✅ successfully on 98cf619 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12348. |
fix for standard SQL
Summary of Changes
A timestamp/datetime field CANNOT be used with LIKE operator we need to cast to char before in standard SQL
Testing Instructions
Smart Search: Indexed Content search field with a date work as before