You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/03/11 03:03:24 UTC

[GitHub] [incubator-shardingsphere] mrnx2004 opened a new issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property

mrnx2004 opened a new issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property
URL: https://github.com/apache/incubator-shardingsphere/issues/4702
 
 
   ## there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property
   
   I download the shardingSphere-proxy docker image by this command:
   **docker pull apache/sharding-proxy**
   
   Then, I put the "mysql-connector-java-5.1.47-bin.jar" into "/opt/sharding-proxy/lib".
   According to the documentation, my container run successfully.
   I use MySqlWorkbench to Connect ShardingSphere-Proxy.
   I can innsert and search data from the table that have configured in shardingRule. 
   But when I try to operate other table in "sharding_db",there is a error like this:
   **Error Code:1146.Table 'sharding_db.tableName' doesn't exist.**
   
   But I have configured **defaultDataSourceName: ds0** in **config-sharding** file.
   I can see all the table in MysqlWorkBanch under sharding_db, But I can only read and write to the table Which have sharding rule.
   
   Here is my config-sharding.yaml content:
   ```
   dataSources:
   	ds0:
   		url: jdbc:mysql://……?serverTimezone=UTC&useSSL=false&characterEnoding=utf8
   		username:
   		password:
   		connectionTimeoutMilliseconds: 30000
   		idleTimeoutMilliseconds: 60000
   		maxLifetimeMilliseconds: 1800000
   		maxPoolSize: 65
   	ds1:
   		url: jdbc:mysql://……?serverTimezone=UTC&useSSL=false&characterEnoding=utf8
   		username:
   		password:
   		connectionTimeoutMilliseconds: 30000
   		idleTimeoutMilliseconds: 60000
   		maxLifetimeMilliseconds: 1800000
   		maxPoolSize: 65
   		
   shardingRule:
   	tables:
   		suite:
   			actualDataNodes: ds${0..1}.suite${0..1}
   			tableStrategy:
   				inline:
   					shardingColumn: project_id
   					algorithmExpression: suite${project_id % 2}
   			keyGenerator:
   				type: SNOWFLAKE
   				column: directory_id
   		testcase:
   			actualDataNodes: ds{0..1}.testcase${0..1}
   			tableStrategy:
   				inline:
   					shardingColumn: suite_id
   					algorithmExpression: testcase${suite_id % 2}
   			keyGenerator:
   				type: SNOWFLAKE
   				column: testcase_sequence
   	bindingTables:
   		- suite,testcase
   	defaultDataSourceName: ds0
   	defaultDatabaseStrategy:
   		inline:
   			shardingColumn: id
   			algorithmExpression: ds${id % 2}
   	defaultTableStrategy:
   		none:
   ```
   I don't konw why the default dataSource seems not really work.
   
   
   
   
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] mrnx2004 commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property

Posted by GitBox <gi...@apache.org>.
mrnx2004 commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property
URL: https://github.com/apache/incubator-shardingsphere/issues/4702#issuecomment-597491266
 
 
   @menghaoranss Version 6.3.6 build 511CE(64 bits) Community

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] menghaoranss commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property

Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property
URL: https://github.com/apache/incubator-shardingsphere/issues/4702#issuecomment-597555986
 
 
   > I find out that if i use "select * from sharding_db.tableName",it will report an error.
   > But if I use "select * from tableName", it works.
   > Is this a bug ?
   
   @mrnx2004  i tried `select * from anyDatabase.tableName`, it also excuted successfully, just the tableName has been configured in sharding rule, i think this syntax has not well supported yet.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] mrnx2004 commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property

Posted by GitBox <gi...@apache.org>.
mrnx2004 commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property
URL: https://github.com/apache/incubator-shardingsphere/issues/4702#issuecomment-597499846
 
 
   I find out that if i use "select * from sharding_db.tableName",it will report an error.
   But if I use "select * from tableName", it works.
   Is this a bug ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] mrnx2004 commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property

Posted by GitBox <gi...@apache.org>.
mrnx2004 commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property
URL: https://github.com/apache/incubator-shardingsphere/issues/4702#issuecomment-597964623
 
 
   @menghaoranss I got it , Thank you for your response to my inquiry. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] menghaoranss commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property

Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property
URL: https://github.com/apache/incubator-shardingsphere/issues/4702#issuecomment-597488523
 
 
   @mrnx2004 which version of workbench do you use?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] mrnx2004 closed issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property

Posted by GitBox <gi...@apache.org>.
mrnx2004 closed issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property
URL: https://github.com/apache/incubator-shardingsphere/issues/4702
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] menghaoranss commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property

Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #4702: there is a "table doesn't exist" problem, even if i set the "defaultDataSourceName" property
URL: https://github.com/apache/incubator-shardingsphere/issues/4702#issuecomment-597475293
 
 
   @mrnx2004  i will try to reproduce the problem based on your configuration above.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services