weblayout opened a new issue, #5820:
URL: https://github.com/apache/shenyu/issues/5820

   ### Is there an existing issue for this?
   
   - [X] I have searched the existing issues
   
   ### Current Behavior
   
   
https://mvnrepository.com/artifact/org.apache.shenyu/shenyu-admin/2.6.1:mappers.rule-sqlmap.xml:
   <select id="getPluginNameBySelectorId" resultType="java.lang.String">
           select p.name
           from plugin p
           inner join selector s on p.id = s.plugin_id
           where s.id = #{selectorId}
           limit 1;
       </select>
   
   ### Expected Behavior
   
   
https://github.com/apache/shenyu/blob/master/shenyu-admin/src/main/resources/mappers/rule-sqlmap.xml:
   <select id="getPluginNameBySelectorId" resultType="java.lang.String">
           select p.name
           from plugin p
           inner join selector s on p.id = s.plugin_id
           where s.id = #{selectorId}
           limit 1
       </select>
   
   
https://github.com/apache/shenyu/blob/master/shenyu-admin/src/main/java/org/apache/shenyu/admin/mybatis/oracle/OracleSQLPrepareInterceptor.java:
           // replace limit 1
           if (replaceSql.contains("select")) {
               if (replaceSql.contains("where")) {
                   replaceSql = replaceSql.replace("limit 1", "and rownum = 1");
               } else {
                   replaceSql = replaceSql.replace("limit 1", "where rownum = 
1");
               }
           }
   
   
   ### Steps To Reproduce
   
   _No response_
   
   ### Environment
   
   ```markdown
   ShenYu version(s):2.6.1
   ```
   
   
   ### Debug logs
   
   ### Error querying database. Cause: java.sql.SQLSyntaxErrorException: 
ORA-00911: 无效字符 
   ### The error may exist in class path resource [mappers/rule-sqlmap.xml] 
   ### The error may involve defaultParameterMap 
   ### The error occurred while setting parameters 
   ### SQL: select p.name from plugin p inner join selector s on p.id = 
s.plugin_id where s.id = ? and rownum = 1; 
   ### Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符 ; bad SQL 
grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 
无效字符
   
   
   ### Anything else?
   
   _No response_


-- 
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: notifications-unsubscr...@shenyu.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to