Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

只做master-slave读写分离配置如何使用sql.show打印调试信息 #899

Closed
happyjey opened this issue Jun 1, 2018 · 2 comments
Closed

Comments

@happyjey
Copy link

happyjey commented Jun 1, 2018

Please answer these questions before submitting your issue. Thanks!
开源不易,我们希望将精力放在完成新功能和解决有价值的问题上,为了让大家的配合更具有效率,请填写以下列出的全部问题

Which version of Sharding-Sphere do you using?(您使用的Sharding-Sphere版本为?)

2.0.3

Expected behavior (您预期的结果是)

<master-slave:data-source id="masterSlaveDataSource" master-data-source-name="ds_master" slave-data-source-names="ds_slave_0" />
只做读写分离配置时希望可以使用sql.show或是其他方法能知道使用的是哪个库

@xiaoniao
Copy link

xiaoniao commented Jun 6, 2018

+1 需要显示日志。

另外只做 master-slave 读写,不配置分库分表时,表名不能识别出大写字母,会提示表不存在。

org.springframework.jdbc.BadSqlGrammarException:

Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'my_sharding_test2.TP_KNOWLEDGE' doesn't exist

The error may exist in META-INF/mappers/KnowledgeDOMapper.xml

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: SELECT /MS-TP-KNOWLEDGE-LISTALL/ KNOWLEDGE_NO,KNOWLEDGE_NAME,KNOWLEDGE_IMG,KNOWLEDGE_STATUS,DATE_CREATED,LAST_UPDATED FROM TP_KNOWLEDGE

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'my_sharding_test2.TP_KNOWLEDGE' doesn't exist

实际表名为 tp_knowledge

Springl Boot 1.5.1.RELEASE
Sharding Jdbc 3.0.0.M1

@terrymanu

demo https://github.com/xiaoniao/sample/tree/master/SHARDING/master-slave

@tristaZero
Copy link
Contributor

Please refer to #1004, Thanks a lot.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants