JunboWang created FLINK-38546:
---------------------------------

             Summary: Improve error message for table discovery failure due to 
MySQL permission
                 Key: FLINK-38546
                 URL: https://issues.apache.org/jira/browse/FLINK-38546
             Project: Flink
          Issue Type: Improvement
          Components: Flink CDC
    Affects Versions: cdc-3.5.0
            Reporter: JunboWang


When the MySQL user lacks permissions for a specific database, Flink CDC's 
table discovery (in 
{{{}org.apache.flink.cdc.connectors.mysql.debezium.DebeziumUtils#discoverCapturedTables{}}})
 incorrectly indicates the table "does not exist". This misleads users into 
thinking the table is missing, while the actual root cause is insufficient 
permissions.
 
The error message should be optimized to clearly reflect permission issues 
instead of falsely reporting a missing table.
 
Reproduce:
{code:java}
// code placeholder
version: '2.1'services:  mysql:      image: mysql:8.0      ports:         - 
"3306:3306"      environment:         - MYSQL_ROOT_PASSWORD=123456         - 
MYSQL_USER=mysqluser         - MYSQL_PASSWORD=mysqlpw         - LANG=C.UTF-8    
  command:        - mysqld        - --character-set-server=utf8mb4        - 
--collation-server=utf8mb4_unicode_ci

{code}
{code:java}
// code placeholder
docker-compose --file docker-compose.yml exec mysql mysql -uroot -p123456  

CREATE DATABASE test1;

use test1;

CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL,
birthdate DATE,
is_active BOOLEAN DEFAULT TRUE
 );

mysql> SHOW FULL TABLES IN test1;
+-----------------+------------+
| Tables_in_test1 | Table_type |
+-----------------+------------+
| users           | BASE TABLE |
+-----------------+------------+

mysql> CREATE USER 'test_user'@'%' IDENTIFIED BY 'A123456';

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| performance_schema |
+--------------------+
2 rows in set (0.00 sec)

{code}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to