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/07/21 10:19:15 UTC

[GitHub] [shardingsphere] andyhewenhui opened a new issue #6385: Why do you also detect statements that do not set up a sub-table?

andyhewenhui opened a new issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385


   Why do you also detect statements that do not set up a sub-table?
   I have written some sql statements before, and these statements do not need to be divided into tables, so why do these statements start to report errors?


----------------------------------------------------------------
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



[GitHub] [shardingsphere] tristaZero commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-662216465


   Hi @andyhewenhui 
   
   No matter the table has sharding rule or not, `SQL parsing` is required.
   
   Could you provide some log information? We can check whether it is a parsing exception or not.
   
   Trista


----------------------------------------------------------------
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



[GitHub] [shardingsphere] kimmking commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-661876687


   what do you mean?


----------------------------------------------------------------
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



[GitHub] [shardingsphere] menghaoranss closed issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
menghaoranss closed issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385


   


----------------------------------------------------------------
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



[GitHub] [shardingsphere] andyhewenhui commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
andyhewenhui commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-665732297


   > I think it's a `insert into xxx select xxx ` issue.
   > We'll support in next release version.
   
   Which version can be solved? Hope to release it quickly.


----------------------------------------------------------------
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



[GitHub] [shardingsphere] andyhewenhui commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
andyhewenhui commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-661881648


   If we don't participate in a table, whether we can set up parameter solutions?


----------------------------------------------------------------
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



[GitHub] [shardingsphere] tristaZero commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-662838547


   @andyhewenhui Hi
   The good news is that we improve the capability of the `SQL Parser engine` hugely, which means mostly SQL could be parsed well on your `master branch`. Please be patient for our incoming release!
   
   Trista


----------------------------------------------------------------
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



[GitHub] [shardingsphere] tristaZero commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-666087507


   @andyhewenhui The incoming release 5.0.0.alpha.
   You can also package our `master branch` to give it a test


----------------------------------------------------------------
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



[GitHub] [shardingsphere] andyhewenhui commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
andyhewenhui commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-662773181


   Later, if this is the case, it will be troublesome. There are too many SQL statements in our history system that need to be tested. We should carefully consider choosing sharding-jdbc.


----------------------------------------------------------------
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



[GitHub] [shardingsphere] kimmking commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-665544890


   I think it's a `insert into xxx select xxx ` issue.
   We'll support in next release version.


----------------------------------------------------------------
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



[GitHub] [shardingsphere] menghaoranss commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-693761501


   There's no more response ,we will close this issue, thansk for your feedback.


----------------------------------------------------------------
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



[GitHub] [shardingsphere] andyhewenhui commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
andyhewenhui commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-661848823


    INSERT INTO coin_account (userId,createTime,modifyTime,compleFlag)
           SELECT #{userId},SYSDATE(),SYSDATE(),#{compleFlag} FROM dual WHERE NOT EXISTS
           (SELECT 1 FROM coin_account WHERE userId = #{userId})    


----------------------------------------------------------------
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



[GitHub] [shardingsphere] andyhewenhui commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
andyhewenhui commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-661879762


   > what do you mean?
   
   Speak directly Chinese, I am afraid not to know。
   上面的设置只是希望我们对我们分表策略的表生效,可是我们的其他表并不需要分表,但是语句使用时候竟然出错了
   INSERT INTO coin_account (userId,createTime,modifyTime,compleFlag)
   SELECT #{userId},SYSDATE(),SYSDATE(),#{compleFlag} FROM dual WHERE NOT EXISTS
   (SELECT 1 FROM coin_account WHERE userId = #{userId})


----------------------------------------------------------------
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



[GitHub] [shardingsphere] andyhewenhui commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
andyhewenhui commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-661782591


   <!-- 因为分库分表使用 shardingsphere 策略 ,因此Druid更加适合系统 -->
       <bean id="coinDataSource" destroy-method="close" class="com.alibaba.druid.pool.DruidDataSource">
               <property name="driverClassName" value="${jdbc.driverClassName}" />
               <property name="url" value="${jdbc.url.coin}" />
               <property name="username" value="${jdbc.username}" />
               <property name="password" value="${jdbc.password}" />
   
               <property name="initialSize" value="5" />
               <property name="maxActive" value="20" />
               <property name="maxWait" value="5000" />
               <property name="minIdle" value="5" />
               <property name="poolPreparedStatements" value="true" />
               <property name="defaultAutoCommit" value="false" />
       </bean>
   
       <bean:properties id="properties">
           <prop key="worker.id">${worker.id}</prop>
       </bean:properties>
       <sharding:key-generator id="snowCoinKeyGenerator" type="SNOWFLAKE" column="snowId" props-ref="properties" />
   
   
       <sharding:inline-strategy id="coinAccountLogTableStrategy" sharding-column="userId" algorithm-expression="coin_account_log_${userId % 10}" />
       <sharding:inline-strategy id="coinGameTableStrategy" sharding-column="userId" algorithm-expression="coin_game_log_${userId % 10}" />
       <sharding:inline-strategy id="coinShareTableStrategy" sharding-column="userId" algorithm-expression="coin_share_${userId % 10}" />
       <sharding:inline-strategy id="coinTaskLogTableStrategy" sharding-column="userId" algorithm-expression="coin_task_log_${userId % 10}" />
   
       <sharding:data-source id="shardingCoinDataSource">
           <sharding:sharding-rule data-source-names="coinDataSource">
               <sharding:table-rules>
                   <sharding:table-rule logic-table="coin_account_log" actual-data-nodes="coinDataSource.coin_account_log_${0..9}"
                                        table-strategy-ref="coinAccountLogTableStrategy" key-generator-ref="snowCoinKeyGenerator" />
                   <sharding:table-rule logic-table="coin_game_log" actual-data-nodes="coinDataSource.coin_game_log_${0..9}"
                                        table-strategy-ref="coinGameTableStrategy" key-generator-ref="snowCoinKeyGenerator" />
                   <sharding:table-rule logic-table="coin_share" actual-data-nodes="coinDataSource.coin_share_${0..9}"
                                        table-strategy-ref="coinShareTableStrategy" key-generator-ref="snowCoinKeyGenerator" />
                   <sharding:table-rule logic-table="coin_task_log" actual-data-nodes="coinDataSource.coin_task_log_${0..9}"
                                        table-strategy-ref="coinTaskLogTableStrategy" key-generator-ref="snowCoinKeyGenerator" />
               </sharding:table-rules>
           </sharding:sharding-rule>
           <sharding:props>
               <prop key="sql.show">true</prop>
           </sharding:props>
       </sharding:data-source>
   
   
   After this setting, all the SQL statements in the following mapper will be affected.
   <mappers>
           <mapper resource="biz/coin/mybatis/mappers/CoinAccountMapper.xml" />
           <mapper resource="biz/coin/mybatis/mappers/CoinAccountLogMapper.xml" />
           <mapper resource="biz/coin/mybatis/mappers/CoinTaskMapper.xml" />
           <mapper resource="biz/coin/mybatis/mappers/CoinTaskLogMapper.xml" />
           <mapper resource="biz/coin/mybatis/mappers/CoinGameLogMapper.xml" />
           <mapper resource="biz/coin/mybatis/mappers/CoinShareMapper.xml" />
           <mapper resource="biz/coin/mybatis/mappers/CoinConfigInfoMapper.xml" />
           <mapper resource="biz/coin/mybatis/mappers/CoinVIPRewardMapper.xml" />
       </mappers>


----------------------------------------------------------------
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



[GitHub] [shardingsphere] andyhewenhui commented on issue #6385: Why do you also detect statements that do not set up a sub-table?

Posted by GitBox <gi...@apache.org>.
andyhewenhui commented on issue #6385:
URL: https://github.com/apache/shardingsphere/issues/6385#issuecomment-661880553


   table “coin_account ”  do not sharding


----------------------------------------------------------------
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