question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Insert failed when inserted sql columns contains “system” (missing prepared paramters)

See original GitHub issue

Which version of ShardingSphere did you use?

4.0.0-RC3

Which project did you use? Sharding-JDBC or Sharding-Proxy?

sharding-jdbc

Expected behavior

Insert successfully when inserted sql columns contains “system”

Actual behavior

sharding parse SQL error: line 2:7 no viable alternative at input ‘(system’

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

SQL: insert into template (system, code, name ) values ( ?, ?, ? )

Example codes for reproduce this issue (such as a github link).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
SteNicholascommented, Dec 31, 2019

@xiyelife In MySQL reserved keywords, SYSTEM is regarded as reserved keyword. Therefore, you couldn’t use SYSTEM in InsertStatement.

0reactions
SteNicholascommented, Jan 1, 2020

Not only one SQL,there are many applications whose used the mybatis generator tools auto created.

@xiyelife Please upgrade the version of MySQL to 8.x, and check the SYSTEM keyword. Currently, MySQLParser is based on 8.x version of MySQL. About adapter to different version of MySQL, it doesn’t support. Anyway, If you indeed need, you could add SYSTEM keyword to unreservedWord_ and compile a version by yourself to use. If you have no any question, please close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Database Engine events and errors - SQL Server
Note the error and time, and contact your system administrator. ... The number of SELECT values must match the number of INSERT columns....
Read more >
"column not allowed here" error in INSERT statement
error. Because of quote might missing in the string parameters. Add quote in the string params ... Scanner sc = new Scanner(System.in); String...
Read more >
Common Issues with the SQL Server Import and Export Wizard
I received an "Index out of bounds" error while trying to import a DB with System-Versioned temporal tables (SQL 2016). These types of...
Read more >
4. Inserting, Updating, Deleting - SQL Cookbook [Book] - O'Reilly
Inserting, Updating, Deleting The past few chapters have focused on basic ... an external source of data (such as a flat file feed...
Read more >
MySQL 8.0 Reference Manual :: 13.2.7 INSERT Statement
CREATE SPATIAL REFERENCE SYSTEM Statement ... See Section 5.1.11, “Server SQL Modes”. ... Inserting NULL into a column that has been declared NOT...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found