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

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

Open
zhangxh1023 opened this issue Apr 21, 2022 · 2 comments
Open

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

zhangxh1023 opened this issue Apr 21, 2022 · 2 comments
Assignees

Comments

@zhangxh1023
Copy link

问题描述
当前的代码 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
Copy link

bigfish1913 commented Apr 21, 2022 via email

@keliwang
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants