presto: We find a bug when mysql table name have "_"

The problem is when mysql have “_” in the table name the “escapeNamePattern” function change the name. So the sql can`t run on mysql. In the file presto-mysql/src/main/java/com/facebook/presto/plugin/mysql/MySqlClient.java line 93 to line 97. For example: table “aaa_bbb” change to “aaa_bbb” .
The bug find above release 0.119.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 22 (12 by maintainers)

Commits related to this issue

Most upvoted comments

presto-server-0.139 still have this problem .

Create database in mysql:

CREATE DATABASE TUTORIAL_1;
USE TUTORIAL_1;
 CREATE TABLE USERS (userid VARCHAR(15), gender CHAR(1), Age SMALLINT,country VARCHAR(50), SIGN_UP VARCHAR(50));

presto> SHOW TABLES FROM mysql.TUTORIAL_1;
 Table 
-------
(0 rows)

Query 20160301_082814_00005_fjdbm, FINISHED, 2 nodes
Splits: 2 total, 2 done (100.00%)
0:00 [0 rows, 0B] [0 rows/s, 0B/s]