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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure MySQL is not saying 'this' = 'this ' is true #20050

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

nickvergessen
Copy link
Member

馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖
馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖
馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖
馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖
馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖
馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖
馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖
馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖
馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖
馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖馃嵖

100 popcorn, take one and have a look while I perform a magic trick:

SELECT 'jan' = 'jan ', BINARY 'jan' = 'jan ';
+----------------+-----------------------+
| 'jan' = 'jan ' | BINARY 'jan' = 'jan ' |
+----------------+-----------------------+
|              1 |                     0 |
+----------------+-----------------------+

@nickvergessen nickvergessen added bug 2. developing Work in progress labels Mar 20, 2020
@nickvergessen nickvergessen added this to the Nextcloud 19 milestone Mar 20, 2020
@nickvergessen nickvergessen self-assigned this Mar 20, 2020
@gary-kim
Copy link
Member

Tried testing and to add to the amusement,

MySQL 5.7

mysql> SELECT 'jan' = 'jan ', BINARY 'jan' = 'jan ';
+----------------+-----------------------+
| 'jan' = 'jan ' | BINARY 'jan' = 'jan ' |
+----------------+-----------------------+
|              1 |                     0 |
+----------------+-----------------------+
1 row in set (0.00 sec)

MySQL 8

mysql> SELECT 'jan' = 'jan ', BINARY 'jan' = 'jan ';
+----------------+-----------------------+
| 'jan' = 'jan ' | BINARY 'jan' = 'jan ' |
+----------------+-----------------------+
|              0 |                     0 |
+----------------+-----------------------+
1 row in set (0.00 sec)

@nickvergessen
Copy link
Member Author

Okay, so they fixed it for mysql8 on your machine? Im pretty sure I have 8 too locally and I could reproduce it there

@gary-kim
Copy link
Member

gary-kim commented Mar 21, 2020

I just tested on mysql:8 on Docker Hub, 8.0.19-0ubuntu0.19.10.3 on Ubuntu, and 8.0.17 Source distribution on RHEL 8 and they all seem to return the proper value.

mysql:5.7 on Docker Hub has the issue though.

This was referenced Apr 4, 2020
@nickvergessen
Copy link
Member Author

Okay, seems to be the case for me now too.

MariaDB seems to be affected:

MariaDB [(none)]> SELECT 'jan' = 'jan ', BINARY 'jan' = 'jan ';
+----------------+-----------------------+
| 'jan' = 'jan ' | BINARY 'jan' = 'jan ' |
+----------------+-----------------------+
|              1 |                     0 |
+----------------+-----------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT VERSION();
+----------------------------------+
| VERSION()                        |
+----------------------------------+
| 10.1.44-MariaDB-0ubuntu0.18.04.1 |
+----------------------------------+
1 row in set (0.00 sec)

@nickvergessen nickvergessen marked this pull request as ready for review April 14, 2020 18:31
@nickvergessen nickvergessen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 14, 2020
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code makes sense 馃憤

@MorrisJobke
Copy link
Member

Conflicts :/

@MorrisJobke
Copy link
Member

Conflicts :/

Let me fix them.

Signed-off-by: Joas Schilling <coding@schilljs.com>
@MorrisJobke MorrisJobke force-pushed the bugfix/noid/mysql-equal-trims-shock branch from cdeb084 to 16e9bf2 Compare April 15, 2020 07:14
@MorrisJobke MorrisJobke merged commit c43174a into master Apr 15, 2020
@MorrisJobke MorrisJobke deleted the bugfix/noid/mysql-equal-trims-shock branch April 15, 2020 10:57
@rullzer
Copy link
Member

rullzer commented Apr 15, 2020

Basically this made my production instance do boom... I'll have to see why... but for now we can't really release beta3 with this...

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

Successfully merging this pull request may close these issues.

None yet

4 participants