Please help me find bug--a MySQL resolver (Java implementation)

Source: Internet
Author: User

I wrote a mysqlparser two days on the weekends. The purpose of writing this is: a project in the company needs to play the version number of the data (each record of each table to have a version number field, this field needs to be automatically hit by the framework, not by the programmer).

So, I wrote this program has a special scene, not for the general situation of the writing (that is to say: some things do not affect the tool on the SQL plus field, I am in the process of writing deliberately ignored. For example: Only CRUD operations are used in the system, so I cannot support DDL statements when I write SQL.

I have tested all the SQL in the project system and can handle it, and I have written some more complex SQL myself, and I can handle it normally.

However: because I am unfamiliar with some of MySQL's unfamiliar syntax, in the implementation of reference to the MySQL source code in the Sql_yacc.yy file syntax definition, found that there are many do not understand the syntax, although it can be achieved, but because do not understand, so I also directly ignored (if someone uses these grammar will be directly error).

I find it hard to define what "normal SQL Syntax" is, and what is "uncommon SQL syntax", so my current implementation is based on my own understanding, at least for now all the MySQL insert/delete/update/I've used The syntax of the SELECT statement is parsed correctly and the data version number field is added correctly.

If you are interested in this thing (and if there is a need at the same time, it would be better), please come here "Https://github.com/naturemickey/MySQLParser" clone this tool code to try it.

Code Description:

1.clone out of the directory is an Eclipse project, directly imported.

The 2.src/test directory is all of the test cases and can be run directly (there is only one line of code in the test code that really uses the tool to add fields to the SQL, very simple).

3. The code is written in Java8.

Trouble everyone:

1. If you find that SQL is not used here to parse or parse errors, then please ask me to pull your test case on GitHub.

2. If you do not normally use GitHub, then trouble you directly to your test SQL in this post (Https://github.com/naturemickey/MySQLParser This address can also be directly with SVN checkout).

Thank you so much!

Please help me find bug--a MySQL resolver (Java implementation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.