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

Corrupt warnings and compatibility issues with FORMAT and CTE #56193

Open
dveeden opened this issue Sep 20, 2024 · 1 comment
Open

Corrupt warnings and compatibility issues with FORMAT and CTE #56193

dveeden opened this issue Sep 20, 2024 · 1 comment
Labels
affects-8.3 compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) severity/moderate type/bug The issue is confirmed as a bug. type/compatibility

Comments

@dveeden
Copy link
Contributor

dveeden commented Sep 20, 2024

Bug Report

1. Minimal reproduce step (Required)

WITH RECURSIVE cte(n) AS (
  SELECT 1 n
  UNION ALL
  SELECT 100+n FROM cte WHERE n<1000
)
SELECT FORMAT(n+RAND(),3,'en_UK') FROM cte;

2. What did you expect to see? (Required)

With MySQL 9.0.1:

mysql-9.0.1> WITH RECURSIVE cte(n) AS (SELECT 1 n UNION ALL SELECT 100+n FROM cte WHERE n<1000) SELECT FORMAT(n+RAND(),3,'en_UK') FROM cte;
+----------------------------+
| FORMAT(n+RAND(),3,'en_UK') |
+----------------------------+
| 1.207                      |
| 101.688                    |
| 201.819                    |
| 301.030                    |
| 401.691                    |
| 501.368                    |
| 601.767                    |
| 701.731                    |
| 801.355                    |
| 901.582                    |
| 1,001.845                  |
+----------------------------+
11 rows in set, 1 warning (0.00 sec)

Warning (Code 1649): Unknown locale: 'en_UK'
  1. Only one warning for the statement.
  2. Warning text is correct

3. What did you see instead (Required)

mysql-8.0.11-TiDB-v8.4.0-alpha-207-gfb9b8a194f> WITH RECURSIVE cte(n) AS (SELECT 1 n UNION ALL SELECT 100+n FROM cte WHERE n<1000) SELECT FORMAT(n+RAND(),3,'en_UK') FROM cte;
+----------------------------+
| FORMAT(n+RAND(),3,'en_UK') |
+----------------------------+
| 1.613                      |
| 101.927                    |
| 201.795                    |
| 301.193                    |
| 401.579                    |
| 501.318                    |
| 601.854                    |
| 701.313                    |
| 801.006                    |
| 901.092                    |
| 1,001.439                  |
+----------------------------+
11 rows in set, 11 warnings (0.00 sec)

Warning (Code 1649): Unknown locale: '
                                      .P��'
Warning (Code 1649): Unknown locale: 'en_UK'
Warning (Code 1649): Unknown locale: '
Warning (Code 1649): Unknown locale: '
                                      .P��'
Warning (Code 1649): Unknown locale: 'en_UK'
Warning (Code 1649): Unknown locale: '
Warning (Code 1649): Unknown locale: '
                                      .P��'
Warning (Code 1649): Unknown locale: 'en_UK'
Warning (Code 1649): Unknown locale: '
Warning (Code 1649): Unknown locale: '
                                      .P��'
Warning (Code 1649): Unknown locale: 'en_UK'
  1. Multiple warnings instead of one.
  2. Text is sometimes correct and sometimes corrupt

4. What is your TiDB version? (Required)

mysql-8.0.11-TiDB-v8.4.0-alpha-207-gfb9b8a194f> SELECT TIDB_VERSION()\G
*************************** 1. row ***************************
TIDB_VERSION(): Release Version: v8.4.0-alpha-207-gfb9b8a194f
Edition: Community
Git Commit Hash: fb9b8a194f8716beaee035cd0c285c30e29a9d64
Git Branch: master
UTC Build Time: 2024-09-20 09:07:51
GoVersion: go1.22.7
Race Enabled: false
Check Table Before Drop: false
Store: unistore
1 row in set (0.00 sec)

Also happens with v8.3.0

@dveeden dveeden added type/bug The issue is confirmed as a bug. type/compatibility severity/moderate compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) labels Sep 20, 2024
@dveeden
Copy link
Contributor Author

dveeden commented Sep 20, 2024

Found this while working on #56167 / #56168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.3 compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) severity/moderate type/bug The issue is confirmed as a bug. type/compatibility
Projects
None yet
Development

No branches or pull requests

1 participant