TeslaCN commented on issue #18456:
URL: 
https://github.com/apache/shardingsphere/issues/18456#issuecomment-1256846755

   Steps:
   
   ```sql
   INSERT INTO customer (c_custkey, c_name, c_address, c_nationkey, c_phone, 
c_acctbal, c_mktsegment, c_comment) VALUES (720, 'Customer#000000720', 
'8shFEL7J9sq1NJXR8dixBqaTO,kbSx', 22, '32-575-838-4260', 5357.32, 'HOUSEHOLD ', 
'furiously above the furiously ironic c');
   ```
   
   1. Create a sharding rule without table `customer` like the following.
   
   ```yaml
   schemaName: tpch_db
   
   dataSources:
     ds_0:
       url: jdbc:opengauss://127.0.0.1:5433/tpch_0?loggerLevel=OFF
   # ...
     ds_1:
       url: jdbc:opengauss://127.0.0.1:5433/tpch_1?loggerLevel=OFF
   # ...
   
   rules:
     - !SHARDING
       tables:
         lineitem:
           actualDataNodes: ds_${0..1}.lineitem
   #      customer:
   #        actualDataNodes: ds_${0..1}.customer
   
   ```
   
   2. Execute SQL
   ```bash
   gsql -h 127.0.0.1 -p 55433 -U gaussdb tpch_db -WPassword@123 \
   -c "INSERT INTO customer (c_custkey, c_name, c_address, c_nationkey, 
c_phone, c_acctbal, c_mktsegment, c_comment) VALUES (720, 'Customer#000000720', 
'8shFEL7J9sq1NJXR8dixBqaTO,kbSx', 22, '32-575-838-4260', 5357.32, 'HOUSEHOLD ', 
'furiously above the furiously ironic c');"
   ```
   
   3. Got error
   ```
   [INFO ] 2022-09-24 11:39:43.922 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Logic SQL: INSERT INTO customer (c_custkey, c_name, 
c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment) VALUES 
(720, 'Customer#000000720', '8shFEL7J9sq1NJXR8dixBqaTO,kbSx', 22, 
'32-575-838-4260', 5357.32, 'HOUSEHOLD ', 'furiously above the furiously ironic 
c');
   [INFO ] 2022-09-24 11:39:43.922 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - SQLStatement: 
OpenGaussInsertStatement(super=InsertStatement(super=AbstractSQLStatement(parameterCount=0,
 parameterMarkerSegments=[], commentSegments=[]), 
table=SimpleTableSegment(tableName=TableNameSegment(startIndex=12, 
stopIndex=19, identifier=IdentifierValue(value=customer, quoteCharacter=NONE)), 
owner=Optional.empty, alias=Optional.empty), 
insertColumns=Optional[InsertColumnsSegment(startIndex=21, stopIndex=108, 
columns=[ColumnSegment(startIndex=22, stopIndex=30, 
identifier=IdentifierValue(value=c_custkey, quoteCharacter=NONE), 
owner=Optional.empty), ColumnSegment(startIndex=33, stopIndex=38, 
identifier=IdentifierValue(value=c_name, quoteCharacter=NONE), 
owner=Optional.empty), ColumnSegment(startIndex=41, stopIndex=49, 
identifier=IdentifierValue(value=c_address, quoteCharacter=NONE), 
owner=Optional.empty), ColumnSegment(startIndex=52, stopIndex=62, 
identifier=IdentifierValue(value=c_nationkey, 
 quoteCharacter=NONE), owner=Optional.empty), ColumnSegment(startIndex=65, 
stopIndex=71, identifier=IdentifierValue(value=c_phone, quoteCharacter=NONE), 
owner=Optional.empty), ColumnSegment(startIndex=74, stopIndex=82, 
identifier=IdentifierValue(value=c_acctbal, quoteCharacter=NONE), 
owner=Optional.empty), ColumnSegment(startIndex=85, stopIndex=96, 
identifier=IdentifierValue(value=c_mktsegment, quoteCharacter=NONE), 
owner=Optional.empty), ColumnSegment(startIndex=99, stopIndex=107, 
identifier=IdentifierValue(value=c_comment, quoteCharacter=NONE), 
owner=Optional.empty)])], insertSelect=Optional.empty, 
values=[InsertValuesSegment(startIndex=117, stopIndex=265, 
values=[LiteralExpressionSegment(startIndex=118, stopIndex=120, literals=720), 
LiteralExpressionSegment(startIndex=123, stopIndex=142, 
literals=Customer#000000720), LiteralExpressionSegment(startIndex=145, 
stopIndex=176, literals=8shFEL7J9sq1NJXR8dixBqaTO,kbSx), 
LiteralExpressionSegment(startIndex=179, stopIndex=180, literals=22)
 , LiteralExpressionSegment(startIndex=183, stopIndex=199, 
literals=32-575-838-4260), LiteralExpressionSegment(startIndex=202, 
stopIndex=208, literals=5357.32), LiteralExpressionSegment(startIndex=211, 
stopIndex=222, literals=HOUSEHOLD ), LiteralExpressionSegment(startIndex=225, 
stopIndex=264, literals=furiously above the furiously ironic c)])]), 
withSegment=Optional.empty, onDuplicateKeyColumnsSegment=null)
   [INFO ] 2022-09-24 11:39:43.923 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: ds_0 ::: INSERT INTO customer (c_custkey, 
c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment) 
VALUES 
org.apache.shardingsphere.sharding.rewrite.token.pojo.ShardingInsertValuesToken@13d6d169;
   [ERROR] 2022-09-24 11:39:43.961 [Connection-1-ThreadExecutor] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   org.opengauss.util.PSQLException: [127.0.0.1:33816/127.0.0.1:5433] ERROR: 
syntax error at or near "org"
     Position: 118
        at 
org.opengauss.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2901)
        at 
org.opengauss.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2630)
        at 
org.opengauss.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:362)
        at org.opengauss.jdbc.PgStatement.runQueryExecutor(PgStatement.java:562)
        at org.opengauss.jdbc.PgStatement.executeInternal(PgStatement.java:539)
        at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:397)
        at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:339)
        at org.opengauss.jdbc.PgStatement.executeCachedSql(PgStatement.java:325)
        at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:302)
        at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:298)
        at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:1458)
        at 
com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:103)
        at 
com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.impl.ProxyStatementExecutorCallback.execute(ProxyStatementExecutorCallback.java:41)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:74)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:67)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:44)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:95)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:75)
        at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:135)
        at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.parallelExecute(ExecutorEngine.java:131)
        at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:116)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:65)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.ProxyJDBCExecutor.execute(ProxyJDBCExecutor.java:74)
        at 
org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.useDriverToExecute(ProxySQLExecutor.java:195)
        at 
org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:153)
        at 
org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:147)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:130)
        at 
org.apache.shardingsphere.proxy.frontend.opengauss.command.query.simple.OpenGaussComQueryExecutor.execute(OpenGaussComQueryExecutor.java:76)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:111)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
   
   ```


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to