Supercharge Your Innovation With Domain-Expert AI Agents!

Method, system and server for testing structured query language (SQL) statements

A detection method and server technology, applied in the computer field, can solve the problems of reducing the reliability of the database system and increasing the error rate, and achieve the effects of reducing the workload, reducing the error detection rate, and improving the reliability.

Active Publication Date: 2013-12-18
ADVANCED NEW TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The purpose of the embodiment of the present application is to provide a detection method, system and server of SQL statements to solve the problem that SQL codes in the prior art require DBA to manually download and perform subjective detection, resulting in an increase in error rate and thus reducing the reliability of the database system The problem

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method, system and server for testing structured query language (SQL) statements
  • Method, system and server for testing structured query language (SQL) statements
  • Method, system and server for testing structured query language (SQL) statements

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0030] see figure 1 , is the flow chart of the first embodiment of the detection method of the SQL statement of the present application:

[0031] Step 101: Pre-configure the matching rules of the SQL statement.

[0032] SQL is a database query and programming language used to access data and query, update and manage relational database system statements. The SQL statement in the embodiment of the present application is an SQL statement for operating various project databases (or business databases). Usually, the SQL statement may involve the query field "SELECT" and the condition field "WHERE" when written. The difficulty of detecting different fields in the SQL statement is different. Based on this, the embodiment of the present application can pre-configure simple matching rules and complex matching rules respectively according to needs. Among them, the simple matching rule is matched according to the regular expression, and the matching process is relatively simple. Gener...

no. 1 example

[0131] see Figure 4, which is a block diagram of the first embodiment of the detection server of the SQL statement of the present application:

[0132] The detection server includes: a preset unit 410 , an acquisition unit 420 , an analysis unit 430 and a detection unit 440 .

[0133] Wherein, the preset unit 410 is used to preconfigure the matching rules of the SQL statement;

[0134] An acquisition unit 420, configured to acquire a changed SQL file;

[0135] The parsing unit 430 is configured to parse the changed SQL file, and obtain the changed SQL statement in the changed SQL file according to the parsing result;

[0136] The detection unit 440 is configured to match the changed SQL statement with the matching rule, and judge whether the changed SQL statement is correct according to whether the changed SQL statement matches the matching rule.

no. 2 example

[0137] see Figure 5 , which is a block diagram of the second embodiment of the detection server of the SQL statement of the present application:

[0138] The detection server includes: a preset unit 510 , an acquisition unit 520 , an analysis unit 530 , a storage unit 540 , a trigger unit 550 , a detection unit 560 , a storage unit 570 and a report unit 580 .

[0139] Wherein, the preset unit 510 is used to preconfigure the matching rules of the SQL statement;

[0140] An acquisition unit 520, configured to acquire a changed SQL file;

[0141] The parsing unit 530 is configured to parse the changed SQL file, and obtain the changed SQL statement in the changed SQL file according to the parsing result;

[0142] A saving unit 540, configured to save the changed SQL statement parsed by the parsing unit 530;

[0143] The triggering unit 550 is configured to trigger the detection unit 560 to execute the operation of matching the changed SQL statement with the matching rule when ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The embodiment of the invention discloses a method, a system and a server for testing structured query language (SQL) statements. According to the method, a matching rule of SQL statements is configured in advance. The method comprises the following steps of: acquiring a changed SQL file; analyzing the changed SQL file, and acquiring changed SQL statements in the changed SQL file according to an analysis result; and matching the changed SQL statements with the matching rule, and judging whether the changed SQL statements are correct according to the matching result of the changed SQL statements and the matching rule. According to the embodiment of the invention, when the SQL statements change, the server can analyze the changed SQL statements without DBA to download and test the SQL statements. Furthermore, the SQL statements are tested by the rule configured in advanced so as to reduce the work load of the DBA as well as the false test ratio, and consequently improve the reliability of a database system.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to a method, system and server for detecting SQL statements. Background technique [0002] SQL (Structured Query Language) is a database query and programming language for accessing data and querying, updating and managing relational database systems. SQL allows users to work on high-level data structures. It does not require the user to specify the data storage method, nor does it require the user to understand the specific data storage method, so different database systems with different underlying structures can use the same SQL language as the interface for data input and management. Taking Alipay (www.alipay.com) as an example, when it provides services to customers, each business function has an operable database, and all operations on the database are realized through SQL, so the performance and reliability of SQL statements Sex has high requirements. Especiall...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F17/30
Inventor 钟离
Owner ADVANCED NEW TECH CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More