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

The result of function COMPRESS is different from MySQL #11163

Closed
SunRunAway opened this issue Jul 10, 2019 · 2 comments
Closed

The result of function COMPRESS is different from MySQL #11163

SunRunAway opened this issue Jul 10, 2019 · 2 comments
Labels
component/expression help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility wontfix This issue will not be fixed.

Comments

@SunRunAway
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
SELECT LENGTH(COMPRESS('a'));
  1. What did you expect to see?
mysql> SELECT LENGTH(COMPRESS('a'));
+-----------------------+
| LENGTH(COMPRESS('a')) |
+-----------------------+
|                    13 |
+-----------------------+
1 row in set (0.00 sec)
  1. What did you see instead?
mysql> SELECT LENGTH(COMPRESS('a'));
+-----------------------+
| LENGTH(COMPRESS('a')) |
+-----------------------+
|                    17 |
+-----------------------+
1 row in set (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

fdbc149

@SunRunAway SunRunAway added type/bug The issue is confirmed as a bug. component/expression and removed component/expression labels Jul 10, 2019
@SunRunAway SunRunAway added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jul 12, 2019
@amyangfei
Copy link
Contributor

This issue may due to the zlib.compress implement way in golang, if we use raw golang API we could hardly get format compatible compress result.
golang/go#28594
https://stackoverflow.com/questions/27852940/how-can-i-use-zlib-in-golang-to-cooperate-with-zlib-in-c

@SunRunAway
Copy link
Contributor Author

Thanks @amyangfei
I'll close this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility wontfix This issue will not be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants