Skip to content

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

Merged
MorrisJobke merged 1 commit into
masterfrom
bugfix/noid/mysql-equal-trims-shock
Apr 15, 2020
Merged

Make sure MySQL is not saying 'this' = 'this ' is true#20050
MorrisJobke merged 1 commit into
masterfrom
bugfix/noid/mysql-equal-trims-shock

Conversation

@nickvergessen

Copy link
Copy Markdown
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 |
+----------------+-----------------------+

@nickvergessennickvergessen added this to the Nextcloud 19 milestone Mar 20, 2020
@nickvergessennickvergessen self-assigned this Mar 20, 2020
@gary-kim

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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

gary-kim commented Mar 21, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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 inset (0.00 sec)
MariaDB [(none)]>SELECT VERSION();
+----------------------------------+
| VERSION() |
+----------------------------------+
| 10.1.44-MariaDB-0ubuntu0.18.04.1 |
+----------------------------------+1 row inset (0.00 sec)

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

@MorrisJobkeMorrisJobke left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

Conflicts :/

@MorrisJobke

Copy link
Copy Markdown
Member

Conflicts :/

Let me fix them.

Signed-off-by: Joas Schilling <coding@schilljs.com>
@MorrisJobke
MorrisJobkeforce-pushed the bugfix/noid/mysql-equal-trims-shock branch from cdeb084 to 16e9bf2CompareApril 15, 2020 07:14
@MorrisJobke
MorrisJobke merged commit c43174a into masterApr 15, 2020
@MorrisJobke
MorrisJobke deleted the bugfix/noid/mysql-equal-trims-shock branch April 15, 2020 10:57
@rullzer

Copy link
Copy Markdown
Member

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@nickvergessen@gary-kim@MorrisJobke@rullzer