qunarcorp / qmq

QMQ是去哪儿网内部广泛使用的消息中间件,自2012年诞生以来在去哪儿网所有业务场景中广泛的应用,包括跟交易息息相关的订单场景; 也包括报价搜索等高吞吐量场景。
Apache License 2.0
2.81k stars 703 forks source link

init.sql 缺少字段,本地代码启动报错 #162

Open zhangxh1023 opened 2 years ago

zhangxh1023 commented 2 years ago

问题描述 当前的代码 init.sql 是不是缺少了ext字段,在启动 metaserver 的时候会报错,这里 环境配置 本地开发环境

复现步骤 1.手动添加qmq-metaserver的配置后启动 qmq-metaserver#Bootstrap.java

实际输出结果

16:06:17.626 [main] DEBUG org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
16:06:17.629 [main] DEBUG org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
16:06:17.629 [main] DEBUG org.springframework.jdbc.support.SQLErrorCodesFactory - Database product name cached for DataSource [com.zaxxer.hikari.HikariDataSource@655a5d9c]: name is 'MySQL'
16:06:17.630 [main] DEBUG org.springframework.jdbc.support.SQLErrorCodesFactory - SQL error codes for 'MySQL' found
16:06:17.631 [main] DEBUG org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator - Translating SQLException with SQL state '42S22', error code '1054', message [Unknown column 'ext' in 'field list']; SQL was [SELECT group_name, kind, master_address, broker_state, tag, ext,update_time FROM broker_group] for task [StatementCallback]
Exception in thread "main" org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT group_name, kind, master_address, broker_state, tag, ext,update_time FROM broker_group]; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'ext' in 'field list'
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:415)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:470)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:480)
        at qunar.tc.qmq.meta.store.impl.DatabaseStore.getAllBrokerGroups(DatabaseStore.java:183)
        at qunar.tc.qmq.meta.cache.CachedMetaInfoManager.refreshBrokerGroups(CachedMetaInfoManager.java:196)
        at qunar.tc.qmq.meta.cache.CachedMetaInfoManager.refresh(CachedMetaInfoManager.java:147)
        at qunar.tc.qmq.meta.cache.CachedMetaInfoManager.<init>(CachedMetaInfoManager.java:94)
        at qunar.tc.qmq.meta.startup.ServerWrapper.start(ServerWrapper.java:105)
        at qunar.tc.qmq.meta.startup.Bootstrap.main(Bootstrap.java:36)
Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'ext' in 'field list'
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1201)
        at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:108)
        at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java)
        at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:454)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:404)
        ... 8 more

期望输出结果

bigfish1913 commented 2 years ago

这是来自QQ邮箱的自动回复邮件。    来信已经收到 感谢您的来信  付威

keliwang commented 2 years ago

@yuyijq 这个 SQL 变更语句你们那边还有么?