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 2021/02/03 07:45:21 UTC

[GitHub] [shardingsphere] wuzhiwei18 opened a new issue #9292: insert sql include keyword column, insert fail ?

wuzhiwei18 opened a new issue #9292:
URL: https://github.com/apache/shardingsphere/issues/9292


   when my tables has keyword column, before insert, The symbol ' will be added, but sharding auto remove the symbol, Cause insert to fail.
   the code :
   class SQLUtil : 
   method:  getExactlyValue
   
   `public static String getExactlyValue(final String value) {
           return null == value ? null : CharMatcher.anyOf("[]`'\"").removeFrom(value);
       }`
   


----------------------------------------------------------------
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] wuzhiwei18 commented on issue #9292: insert sql include keyword column, insert fail ?

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


   this keyword column is  show.   original sql is 
   `insert into album( app_id,`name`,cover_path,content,
   `show`,hot,`free` ) values ( ?,?,?,?,?,?,? )`
   after rewrite ;
   `insert into album  (app_id, name, cover_path, content, show, hot, free) VALUES (?, ?, ?, ?, ?, ?, ?) `
   this show column lost symbol ` 
   error msg :
   `{
       "code": 500,
       "data": null,
       "message": "\r\n### Error updating database.  Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, hot, free) VALUES ('3001', '图集2', '132545w34', '[{\"order\":1,\"picPath\":' at line 2\r\n### The error may exist in file [D:\\development\\rockyplay-games\\rockyplay-game-admin\\target\\classes\\mapper\\AlbumDao.xml]\r\n### The error may involve com.rockyplay.game.admin.dao.album.AlbumDao.insertSelective-Inline\r\n### The error occurred while setting parameters\r\n### SQL: insert into album          ( app_id,                                           `name`,                                           cover_path,                                           content,                                                        `show`,                                           hot,                                           `free` )           values ( ?,         
                                   ?,                                           ?,                                           ?,                                                        ?,                                           ?,                                           ? )\r\n### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, hot, free) VALUES ('3001', '图集2', '132545w34', '[{\"order\":1,\"picPath\":' at line 2\n; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, hot, free) VALUES ('3001', '图集2', '132545w34', '[{\"order\":1,\"picPath\":' at line 2"
   }`


----------------------------------------------------------------
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] terrymanu closed issue #9292: insert sql include keyword column, insert fail ?

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


   


-- 
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 #9292: insert sql include keyword column, insert fail ?

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


   @wuzhiwei18 
   Which version do you use?
   What's DBMS running in your env?
   


----------------------------------------------------------------
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] terrymanu commented on issue #9292: insert sql include keyword column, insert fail ?

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


   Closed because of no 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] wuzhiwei18 edited a comment on issue #9292: insert sql include keyword column, insert fail ?

Posted by GitBox <gi...@apache.org>.
wuzhiwei18 edited a comment on issue #9292:
URL: https://github.com/apache/shardingsphere/issues/9292#issuecomment-772312429


   this keyword column is  show.   original sql is 
   `insert into album( app_id,`name`,cover_path,content,`show`,hot,`free` ) values ( ?,?,?,?,?,?,? )`
   after rewrite ;
   `insert into album  (app_id, name, cover_path, content, show, hot, free) VALUES (?, ?, ?, ?, ?, ?, ?) `
   this show column lost symbol ` 
   error msg :
   `{
       "code": 500,
       "data": null,
       "message": "\r\n### Error updating database.  Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, hot, free) VALUES ('3001', '图集2', '132545w34', '[{\"order\":1,\"picPath\":' at line 2\r\n### The error may exist in file [D:\\development\\rockyplay-games\\rockyplay-game-admin\\target\\classes\\mapper\\AlbumDao.xml]\r\n### The error may involve com.rockyplay.game.admin.dao.album.AlbumDao.insertSelective-Inline\r\n### The error occurred while setting parameters\r\n### SQL: insert into album          ( app_id,                                           `name`,                                           cover_path,                                           content,                                                        `show`,                                           hot,                                           `free` )           values ( ?,         
                                   ?,                                           ?,                                           ?,                                                        ?,                                           ?,                                           ? )\r\n### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, hot, free) VALUES ('3001', '图集2', '132545w34', '[{\"order\":1,\"picPath\":' at line 2\n; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, hot, free) VALUES ('3001', '图集2', '132545w34', '[{\"order\":1,\"picPath\":' at line 2"
   }`


----------------------------------------------------------------
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] wuzhiwei18 edited a comment on issue #9292: insert sql include keyword column, insert fail ?

Posted by GitBox <gi...@apache.org>.
wuzhiwei18 edited a comment on issue #9292:
URL: https://github.com/apache/shardingsphere/issues/9292#issuecomment-772312429


   this keyword column is  show.   original sql is 
   `insert into album( app_id,'name',cover_path,content,'show',hot,'free' ) values ( ?,?,?,?,?,?,? )`
   after rewrite ;
   `insert into album  (app_id, name, cover_path, content, show, hot, free) VALUES (?, ?, ?, ?, ?, ?, ?) `
   this show column lost symbol ` 
   error msg :
   
   `{
       "code": 500,
       "data": null,
       "message": "\r\n### Error updating database.  Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, hot, free) VALUES ('3001', '图集2', '132545w34', '[{\"order\":1,\"picPath\":' at line 2\r\n### The error may exist in file [D:\\development\\rockyplay-games\\rockyplay-game-admin\\target\\classes\\mapper\\AlbumDao.xml]\r\n### The error may involve com.rockyplay.game.admin.dao.album.AlbumDao.insertSelective-Inline\r\n### The error occurred while setting parameters\r\n### SQL: insert into album          ( app_id,                                           `name`,                                           cover_path,                                           content,                                                        `show`,                                           hot,                                           `free` )           values ( ?,         
                                   ?,                                           ?,                                           ?,                                                        ?,                                           ?,                                           ? )\r\n### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, hot, free) VALUES ('3001', '图集2', '132545w34', '[{\"order\":1,\"picPath\":' at line 2\n; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, hot, free) VALUES ('3001', '图集2', '132545w34', '[{\"order\":1,\"picPath\":' at line 2"
   }`


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