Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7888917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:57:39+00:00 2026-06-03T05:57:39+00:00

Seems like MySQL Bug; Request: SELECT * FROM table WHERE ( id LIKE ‘%тест

  • 0

Seems like MySQL Bug;
Request:

        SELECT  *
        FROM table
        WHERE (
        id LIKE          '%тест 199%' 
        OR `user` LIKE     '%тест 199%' 
        OR `user_datetime` LIKE '%тест 199%' 
        OR `user_comments` LIKE '%тест 199%' )
        ORDER BY id desc
        LIMIT 0, 10

[Err] 1271 – Illegal mix of collations for operation ‘like’

And when we use latinic.
Request:

        SELECT  *
        FROM table
        WHERE (
        id LIKE          '%test 199%' 
        OR `user` LIKE     '%test 199%' 
        OR `user_datetime` LIKE '%test 199%' 
        OR `user_comments` LIKE '%test 199%' )
        ORDER BY id desc
        LIMIT 0, 10

Request Success;

How to deal with it?

All of my request are generated automatically, i cant change logic coz function generator has many dependence.

Settings:

SET NAMES utf8
Character set utf8 -- UTF-8 Unicode
Collation utf8_general_ci

UPD for @eggyal

Request: 
SHOW CREATE TABLE `comments`
Response:
CREATE TABLE `comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(255) NOT NULL DEFAULT '',
  `user_datetime` timestamp NULL DEFAULT NULL,
  `user_comments` varchar(128) DEFAULT NULL,
  UNIQUE KEY `id` (`id`) USING BTREE,
  KEY `user_comments` (`user_comments`),
) ENGINE=InnoDB AUTO_INCREMENT=128456 DEFAULT CHARSET=utf8

MySQL Version 5.5.10

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:57:40+00:00Added an answer on June 3, 2026 at 5:57 am

    What version of MySQL are you using? As stated in the manual:

    As of MySQL 5.5.3, implicit conversion of a numeric or temporal value to string produces a value that has a character set and collation determined by the character_set_connection and collation_connection system variables. (These variables commonly are set with SET NAMES. For information about connection character sets, see Section 10.1.4, “Connection Character Sets and Collations”.)

    This change means that such a conversion results in a character (nonbinary) string (a CHAR, VARCHAR, or LONGTEXT value), except when the connection character set is set to binary. In that case, the conversion result is a binary string (a BINARY, VARBINARY, or LONGBLOB value).

    Before MySQL 5.5.3, an implicit conversion always produced a binary string, regardless of the connection character set. Such implicit conversions to string typically occur for functions that are passed numeric or temporal values when string values are more usual, and thus could have effects beyond the type of the converted value.

    Therefore the implicit conversion of your TIMESTAMP column to a string that occurs when using the LIKE operator will always result in a string of the binary character set if you are using a version of MySQL earlier than 5.5.3 irrespective of SET NAMES (curiously this is also the case on sqlfiddle, which claims to be 5.5.20); since such strings cannot be compared with strings in the utf8 character set, you must explicitly convert your user_datetime column to a UTF-8 string:

    SELECT   *
    FROM     `comments`
    WHERE (
             `id`                                LIKE '%тест 199%' 
         OR  `user`                              LIKE '%тест 199%' 
         OR  CONVERT(`user_datetime` USING utf8) LIKE '%тест 199%' 
         OR  `user_comments`                     LIKE '%тест 199%'
    )
    ORDER BY `id` DESC
    LIMIT    0, 10
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to select from a mySQL table using prepared statements. The select
Seems like max table comments length in mysql is only 60 characters. I'm developing
It seems like I would be jumping through hoops to move data from MySQL
Trying to dynamically change dropdown list values from mysql database. Script seems like workin
Is it possible to create mysql database from fabric dynamically. This seems like it
I have a web application that seems to like to make mysql work hard
I want to do what seems like a simple delete in mysql but am
This seems like a simple request. But my query in not working and I'm
I'm trying to do something like this: DELETE FROM table_1 WHERE table_1.id IN (SELECT
Possible Duplicate: PHP EOF shows only one result from loop Hello Seems like I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.