You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/10/20 06:32:11 UTC

[GitHub] [dolphinscheduler] huangfox opened a new issue #6562: [Bug] [dao] Throw an SQLSyntaxErrorException when running CreateDolphinScheduler

huangfox opened a new issue #6562:
URL: https://github.com/apache/dolphinscheduler/issues/6562


   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   When I run the main method of org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler, the program threw an exception, as follows.
   
   `14:15:37.165 [main] ERROR org.apache.dolphinscheduler.common.utils.ScriptRunner - SQLException
   java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE t_ds_task_definition drop INDEX `task_unique`;     END IF; END' at line 1
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
   	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
   	at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782)
   	at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)
   	at com.alibaba.druid.pool.DruidPooledStatement.execute(DruidPooledStatement.java:632)
   	at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:117)
   	at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:72)
   	at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.upgradeDolphinSchedulerDDL(UpgradeDao.java:492)
   	at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.upgradeDolphinScheduler(UpgradeDao.java:270)
   	at org.apache.dolphinscheduler.dao.upgrade.DolphinSchedulerManager.upgradeDolphinScheduler(DolphinSchedulerManager.java:117)
   	at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler.main(CreateDolphinScheduler.java:41)
   14:15:37.166 [main] ERROR org.apache.dolphinscheduler.common.utils.ScriptRunner - Error executing: CREATE PROCEDURE uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName() BEGIN     IF EXISTS (SELECT 1 FROM information_schema.STATISTICS                    WHERE TABLE_NAME='t_ds_task_definition'                      AND TABLE_SCHEMA=(SELECT DATABASE())                      AND INDEX_NAME ='task_unique')         ALTER TABLE t_ds_task_definition drop INDEX `task_unique`;     END IF; END;  
   14:15:37.166 [main] ERROR org.apache.dolphinscheduler.dao.upgrade.UpgradeDao - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE t_ds_task_definition drop INDEX `task_unique`;     END IF; END' at line 1
   java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE t_ds_task_definition drop INDEX `task_unique`;     END IF; END' at line 1
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
   	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
   	at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782)
   	at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)
   	at com.alibaba.druid.pool.DruidPooledStatement.execute(DruidPooledStatement.java:632)
   	at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:117)
   	at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:72)
   	at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.upgradeDolphinSchedulerDDL(UpgradeDao.java:492)
   	at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.upgradeDolphinScheduler(UpgradeDao.java:270)
   	at org.apache.dolphinscheduler.dao.upgrade.DolphinSchedulerManager.upgradeDolphinScheduler(DolphinSchedulerManager.java:117)
   	at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler.main(CreateDolphinScheduler.java:41)
   14:15:37.166 [main] ERROR org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler - create DolphinScheduler failed
   java.lang.RuntimeException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE t_ds_task_definition drop INDEX `task_unique`;     END IF; END' at line 1
   	at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.upgradeDolphinSchedulerDDL(UpgradeDao.java:505)
   	at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.upgradeDolphinScheduler(UpgradeDao.java:270)
   	at org.apache.dolphinscheduler.dao.upgrade.DolphinSchedulerManager.upgradeDolphinScheduler(DolphinSchedulerManager.java:117)
   	at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler.main(CreateDolphinScheduler.java:41)
   Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE t_ds_task_definition drop INDEX `task_unique`;     END IF; END' at line 1
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
   	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
   	at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782)
   	at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)
   	at com.alibaba.druid.pool.DruidPooledStatement.execute(DruidPooledStatement.java:632)
   	at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:117)
   	at org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:72)
   	at org.apache.dolphinscheduler.dao.upgrade.UpgradeDao.upgradeDolphinSchedulerDDL(UpgradeDao.java:492)
   	... 3 common frames omitted```
   
   ### What you expected to happen
   
   I expect that the CreateDolphinScheduler can run successfully, to automatically insert the tables and data required by the project.
   
   ### How to reproduce
   
   1. create database (now the database is empty)
   `CREATE DATABASE dolphinscheduler DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;`
   
   2. run the main method of org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler
   
   3. the program threw an exception 
   `You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE t_ds_task_definition drop INDEX `task_unique`;     END IF; END' at line 1`
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [dolphinscheduler] huangfox commented on issue #6562: [Bug] [dao] Throw an SQLSyntaxErrorException when running CreateDolphinScheduler

Posted by GitBox <gi...@apache.org>.
huangfox commented on issue #6562:
URL: https://github.com/apache/dolphinscheduler/issues/6562#issuecomment-949216898


   the same issues #6461 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [dolphinscheduler] huangfox closed issue #6562: [Bug] [dao] Throw an SQLSyntaxErrorException when running CreateDolphinScheduler

Posted by GitBox <gi...@apache.org>.
huangfox closed issue #6562:
URL: https://github.com/apache/dolphinscheduler/issues/6562


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #6562: [Bug] [dao] Throw an SQLSyntaxErrorException when running CreateDolphinScheduler

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #6562:
URL: https://github.com/apache/dolphinscheduler/issues/6562#issuecomment-947369678


   Hi:
   * Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
   * In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
   * If you haven't received a reply for a long time, you can subscribe to the developer's email,Mail subscription steps reference https://dolphinscheduler.apache.org/zh-cn/community/development/subscribe.html ,Then write the issue URL in the email content and send question to dev@dolphinscheduler.apache.org.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org