CN116089260A - SQL sentence detection method and device - Google Patents

SQL sentence detection method and device Download PDF

Info

Publication number
CN116089260A
CN116089260A CN202211396817.6A CN202211396817A CN116089260A CN 116089260 A CN116089260 A CN 116089260A CN 202211396817 A CN202211396817 A CN 202211396817A CN 116089260 A CN116089260 A CN 116089260A
Authority
CN
China
Prior art keywords
sql
sql statement
detected
filled
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211396817.6A
Other languages
Chinese (zh)
Inventor
郑胜
谢建国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Funo Mobile Communication Technology Co ltd
Original Assignee
Fujian Funo Mobile Communication Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Funo Mobile Communication Technology Co ltd filed Critical Fujian Funo Mobile Communication Technology Co ltd
Priority to CN202211396817.6A priority Critical patent/CN116089260A/en
Publication of CN116089260A publication Critical patent/CN116089260A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/348Circuit details, i.e. tracer hardware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a method and a device for detecting SQL sentences, wherein the method obtains the SQL sentences to be detected in the source codes to be detected by analyzing the source codes to be detected in a development stage, generates random data and random variables according to the SQL sentences to be detected and fills the random data and random variables into an SQL database and parameters to be filled in the SQL sentences to be detected respectively, thereby operating the filled SQL sentences based on the filled SQL database and generating an operation result. Therefore, the invention improves the timeliness of SQL statement problem discovery and reduces the cost of SQL statement repair by advancing the detection of SQL statements to a system development stage, and realizes the pre-running of all SQL statements in an SQL database by generating random data and random variables, thereby realizing the detection of all SQL statements, improving the comprehensiveness of SQL statement detection and further guaranteeing the stability of an information system.

Description

SQL sentence detection method and device
Technical Field
The invention relates to the field of database processing, in particular to a method and a device for detecting SQL sentences.
Background
With the advent of the information age, more and more information systems have brought endless convenience to people. At the same time, however, how to ensure that the information system has high stability and high response speed becomes important and difficult.
Most of the information systems in the current age have standard SQL databases as the main underlying data storage systems: mySQL, oracle, SQLServer, etc. With the gradual increase of the access amount of the information system, the gradual complexity of business logic and the continuous accumulation of historical data, the SQL database usually becomes a bottleneck of the whole information system, thereby compromising the response speed of the whole information system. Meanwhile, the conventional SQL database also has the problem of frequent system errors, so that the stability of an information system is reduced.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: the invention provides a method and a device for detecting SQL sentences, which improve the stability of an information system.
In order to solve the technical problems, the invention adopts the following technical scheme:
in a first aspect, the present invention provides a method for detecting an SQL statement, including:
in the development stage, acquiring a source code to be detected, and analyzing and obtaining an SQL statement to be detected in the source code to be detected;
generating random data according to the SQL statement to be detected, filling the random data into an SQL database, and generating random variable filling parameters to be filled in the SQL statement according to the SQL statement to be detected;
and running the filled SQL statement based on the filled SQL database to generate a running result.
The invention has the beneficial effects that: analyzing a source code in a development stage to obtain SQL sentences, detecting the SQL sentences in advance to the system development stage, improving the timeliness of SQL sentence problem discovery and reducing the cost of SQL sentence repair, generating random data to fill an SQL database according to the analyzed SQL sentences and generating parameters to be filled of the random variable filling SQL sentences, thereby realizing the operation of the SQL sentences on the SQL database, generating an operation result, and realizing the pre-operation of all the SQL sentences in the SQL database in a mode of generating the random data and the random variables, thereby realizing the detection of all the SQL sentences, improving the comprehensiveness of the SQL sentence detection and further guaranteeing the stability of an information system.
Optionally, the obtaining the source code to be detected, analyzing and obtaining the SQL statement to be detected in the source code to be detected includes:
acquiring a source code to be detected, and judging whether an Xml file exists in Mybaits setting of the source code to be detected;
if yes, the Xml file is obtained, the Xml file is analyzed according to Mybaits analysis rules, and when the analysis is successful, the SQL statement to be detected in the source code to be detected is obtained.
According to the description, the SQL statement to be detected is stored in the Xml file, the SQL statement and the program code are decoupled through the storage mode of the Xml file, unified management is convenient, and meanwhile, mybaits analysis rules can be known according to Mybaits setting of the code to be analyzed, so that the SQL statement to be detected is more convenient to acquire.
Optionally, the parsing the Xml file according to the Mybaits parsing rule includes:
and when analysis fails, recording the Xml file as abnormal data and storing the abnormal data into an abnormal log.
According to the description, when the analysis of the Xml file fails, the Xml file is recorded as abnormal data and is saved to an abnormal log, and the record of the analysis failure is reserved, so that a developer can conveniently and directly check and adjust the Xml file later, and the working efficiency is improved.
Optionally, the generating random data to be filled into the SQL database according to the SQL statement to be detected includes:
acquiring an SQL database table structure according to the SQL statement to be detected;
acquiring fields and field types in the table structure according to the SQL table structure;
and generating random data according to the fields and the field types, and filling the random data into an SQL database.
According to the description, the table structure of the SQL database and the fields and the field types in the table structure of the SQL database can be known through the SQL statement to be detected, random data are generated and correspondingly filled into the SQL database, and therefore the complete SQL database is simulated and constructed, and a foundation is laid for the follow-up operation of the SQL statement.
Optionally, the generating random variable padding into parameters to be padded in the SQL statement according to the SQL statement to be detected includes:
acquiring parameters and parameter types required by the SQL sentence to be detected according to the SQL sentence to be detected;
generating a random variable according to the parameter and the parameter type;
and filling the random variable into parameters to be filled in the SQL sentence.
According to the description, parameters and parameter types to be filled in the SQL sentence to be detected can be obtained through the SQL sentence to be detected, random variables which accord with the parameter types are generated to be correspondingly filled into the parameters to be filled in the SQL sentence, and therefore the executable SQL sentence is generated.
Optionally, the running the filled SQL statement based on the filled SQL database, and generating the running result includes:
operating the filled SQL statement based on the filled SQL database, generating an operation failure result when the operation fails, recording the SQL statement to be detected as abnormal data, and storing the abnormal data into an abnormal log;
and when the operation is successful, generating an operation success result, recording the SQL statement to be detected as normal data, and storing the normal data into a normal log.
According to the description, the filled SQL statement is operated based on the filled SQL database, when the operation fails, the SQL statement is recorded as abnormal data and is stored into an abnormal log, so that a subsequent system developer can directly consult the abnormal log to obtain the abnormal SQL statement and adjust the abnormal SQL statement, the process is simplified, the efficiency is improved, and meanwhile, the SQL statement which is successfully operated is also stored in the normal log, so that the subsequent system developer can directly consult the reference.
Optionally, when the operation is successful, generating an operation success result, and recording the SQL statement as normal data and storing the normal data in a normal log further includes:
when the operation is successful, generating an operation success result, repeatedly operating the filled SQL statement, and recording the operation time of each filled SQL statement;
calculating the average running time of the filled SQL statement according to the running time of each filled SQL statement;
and identifying low-quality SQL sentences according to the average running time.
According to the description, when the SQL statement is successfully operated, the SQL statement is repeatedly operated, the time of each operation is recorded, and the low-quality SQL statement is identified by calculating the average operation time, so that the low-quality SQL statement is adjusted, the operation efficiency of the SQL statement is improved, and the response speed of the system is further improved.
In a second aspect, the present invention provides a device for detecting an SQL statement, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the method for detecting an SQL statement provided in the first aspect when executing the computer program.
The technical effects corresponding to the detection device for the SQL statement provided in the second aspect refer to the related description of the detection method for the SQL statement provided in the first aspect.
Drawings
FIG. 1 is a flow chart of a method for detecting SQL statements according to an embodiment of the invention;
FIG. 2 is a schematic diagram of an overall framework of a method for detecting SQL statements according to an embodiment of the present invention;
FIG. 3 is a flow diagram of an embodiment of the present invention directed to running a filled SQL statement based on a filled SQL database;
fig. 4 is a schematic structural diagram of an SQL statement detection apparatus according to an embodiment of the present invention.
[ reference numerals description ]
1: a detection device of SQL sentences;
2: a processor;
3: a memory.
Detailed Description
In order that the above-described aspects may be better understood, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Example 1
Referring to fig. 1 to 3, the present invention provides a method for detecting SQL statements, comprising the steps of:
s1, in a development stage, acquiring a source code to be detected, and analyzing and obtaining an SQL statement to be detected in the source code to be detected;
in this embodiment, the source code to be detected may be manually uploaded, or may be pulled from git (git is an open-source distributed version control system), and the source code to be detected may be parsed to obtain the SQL statement to be detected.
At this time, step S1 of obtaining the source code to be detected, analyzing and obtaining the SQL statement to be detected in the source code to be detected includes:
s11, acquiring a source code to be detected, and judging whether an Xml file exists in Mybaits setting of the source code to be detected;
and S12, if the XML file exists, acquiring the XML file, analyzing the XML file according to Mybaits analysis rules, and obtaining the SQL statement to be detected in the source code to be detected when the analysis is successful.
In this embodiment, as shown in fig. 2, whether an SQL statement exists is obtained by judging whether an Xml file exists in the code to be detected, that is, the SQL statement is stored in the Xml file, so that the SQL statement and the program code are decoupled through the storage mode of the Xml file, unified management is facilitated, and meanwhile, mybaits analysis rules can be obtained according to Mybaits setting of the code to be analyzed, so that the SQL statement to be detected is simpler and more convenient to obtain.
At this time, in step S12, parsing the Xml file according to the Mybaits parsing rule includes:
s121, when analysis fails, recording the Xml file as abnormal data and storing the abnormal data into an abnormal log.
In this embodiment, as shown in fig. 2, when the analysis of the Xml file fails, the Xml file is recorded as the abnormal data and saved to the abnormal log, so that a system developer can learn the specific abnormal file to process by directly checking the abnormal log later, thereby simplifying the flow and improving the efficiency.
S2, generating random data according to the SQL statement to be detected, filling the random data into an SQL database to obtain a filled SQL database, generating random variables according to the SQL statement to be detected, filling the random variables into parameters to be filled in the SQL statement to be detected, and obtaining a filled SQL statement;
in this embodiment, as shown in fig. 2, random data and random variables are generated according to the SQL statement to be detected and are respectively filled into the SQL database and parameters to be filled in the SQL statement, so that a complete SQL database and an executable SQL statement are simulated and constructed, and the detection of the SQL statement is realized.
In this embodiment, generating random data to be filled into the SQL database according to the SQL statement to be detected in step S2 includes:
s21, acquiring an SQL database table structure according to the SQL statement to be detected;
s22, acquiring fields and field types in the table structure according to the SQL table structure;
in this embodiment, the table structure of the SQL database and the fields and field types in the table structure can be known according to the SQL statement to be detected.
S23, generating random data according to the fields and the field types, and filling the random data into an SQL database.
In this embodiment, the SQL database is completely filled by generating random data corresponding to the field types of the fields in the table structure of the SQL database, and the SQL database with millions of data amounts is simulated to be generated.
In this embodiment, generating random variable to be filled into parameters to be filled in the SQL statement to be detected according to the SQL statement to be detected in step S2, and obtaining the filled SQL statement includes:
s24, acquiring parameters and parameter types required by the SQL statement to be detected according to the SQL statement to be detected;
s25, generating random variables according to the parameters and the parameter types;
in this embodiment, as shown in fig. 3, parameters of the SQL statement and types of parameters can be known according to the SQL statement to be detected.
S26, filling the random variable into parameters to be filled in the SQL sentence.
In this embodiment, the SQL database is filled completely by generating random data corresponding to the parameter types of the parameters in the SQL sentence, and the executable SQL sentence is simulated and generated.
S3, running the filled SQL statement based on the filled SQL database to generate a running result.
In this embodiment, as shown in fig. 3, the filled SQL statement is run on the filled SQL database, and operations such as adding, deleting, modifying and checking are performed, so as to realize detection of the SQL statement.
In one embodiment, the query operation of the filled SQL statement can be executed on the filled SQL database through the select command, the delete operation of the filled SQL statement can be executed on the filled SQL database through the delete command, and the update operation of the filled SQL statement can be executed on the filled SQL database through the update command, so that the detection of the SQL statement can be realized.
At this time, running the filled SQL statement based on the filled SQL database in step S3, and generating a running result includes:
s31, running the filled SQL statement based on the filled SQL database, generating a running failure result when the running fails, recording the SQL statement to be detected as abnormal data, and storing the abnormal data into an abnormal log;
in this embodiment, as shown in fig. 2, the SQL statements with failed operation are recorded as abnormal data and stored in the abnormal log, so that a subsequent system developer can directly review the abnormal log to obtain all the SQL statements with failed operation, thereby repairing the SQL statements, improving the review efficiency, and simultaneously uniformly storing the SQL statements to be repaired, so as to facilitate uniform management and avoid omission.
And S32, when the operation is successful, generating an operation success result, recording the SQL statement to be detected as normal data, and storing the normal data into a normal log.
In this embodiment, as shown in fig. 2, normal data is also recorded in the normal log for the SQL statement that runs successfully, so that a system developer can know all the SQL statements that run normally by directly referring to the normal log, and lay a foundation for referencing the SQL statement that runs successfully subsequently, at this time, when running successfully in step S32, generating a running success result, and recording the SQL statement to be detected as normal data to the normal log further includes:
s321, when the operation is successful, generating an operation success result, repeatedly operating the filled SQL statement, and recording the operation time of each filled SQL statement;
in this embodiment, as shown in fig. 2, when the SQL statement is successfully run, the SQL statement is repeatedly run, the running time of each SQL statement is recorded, and by running the SQL statement multiple times and recording the running time of each SQL statement, it is known whether the response speed of the SQL statement changes or not and the response speed of the SQL statement changes when the access amount increases, so that quality detection is performed on the SQL statement.
S322, calculating the average running time of the filled SQL statement according to the running time of the filled SQL statement each time;
s323, identifying low-quality SQL sentences according to the average running time.
In this embodiment, the quality detection of the SQL statement is performed by taking an average value of the running time of the SQL statement, dividing the SQL statement into different regions corresponding to different quality levels according to the average value, wherein the average value is [0-30] ms of the SQL statement with excellent quality, the average value is [31-500] ms of the SQL statement with good quality, the average value is [501-2000] ms of the SQL statement with medium quality, the average value is [2000-10000] ms of the SQL statement with poor quality, and the average value is greater than 10000 ms, namely 10 seconds, to consider the SQL statement as an error, so that the greater the average value is, the worse the quality of the SQL statement, and the lower quality in this embodiment refers to the SQL statement with poor quality and error. Meanwhile, the average value range related to the quality level of the SQL sentence can be set according to the actual situation, for example, the excellent quality is that the average value is [0-20] ms, [0-50] ms, etc.
Therefore, special conditions are effectively avoided through the mode of averaging the running time, and the quality detection of SQL is more rigorous and objective.
Example two
Referring to fig. 4, a device 1 for detecting an SQL statement includes a memory 3, a processor 2, and a computer program stored in the memory 3 and executable on the processor 2, wherein the steps in the first embodiment are implemented when the processor 2 executes the computer program.
Since the system/device described in the foregoing embodiments of the present invention is a system/device used for implementing the method of the foregoing embodiments of the present invention, those skilled in the art will be able to understand the specific structure and modification of the system/device based on the method of the foregoing embodiments of the present invention, and thus will not be described in detail herein. All systems/devices used in the methods of the above embodiments of the present invention are within the scope of the present invention.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the terms first, second, third, etc. are for convenience of description only and do not denote any order. These terms may be understood as part of the component name.
Furthermore, it should be noted that in the description of the present specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to a specific feature, structure, material, or characteristic described in connection with the embodiment or example being included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art upon learning the basic inventive concepts. Therefore, the appended claims should be construed to include preferred embodiments and all such variations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, the present invention should also include such modifications and variations provided that they come within the scope of the following claims and their equivalents.

Claims (8)

1. The SQL statement detection method is characterized by comprising the following steps:
in the development stage, acquiring a source code to be detected, and analyzing and obtaining an SQL statement to be detected in the source code to be detected;
generating random data according to the SQL statement to be detected and filling the random data into an SQL database to obtain a filled SQL database, generating random variables according to the SQL statement to be detected and filling the random variables into parameters to be filled in the SQL statement to be detected to obtain a filled SQL statement;
and running the filled SQL statement based on the filled SQL database to generate a running result.
2. The method for detecting an SQL statement according to claim 1, wherein the obtaining the source code to be detected, analyzing and obtaining the SQL statement to be detected in the source code to be detected comprises:
acquiring a source code to be detected, and judging whether an Xml file exists in Mybaits setting of the source code to be detected;
if yes, the Xml file is obtained, the Xml file is analyzed according to Mybaits analysis rules, and when the analysis is successful, the SQL statement to be detected in the source code to be detected is obtained.
3. The method for detecting an SQL statement according to claim 2, wherein parsing the Xml file according to Mybaits parsing rules comprises:
and when analysis fails, recording the Xml file as abnormal data and storing the abnormal data into an abnormal log.
4. The method for detecting an SQL statement according to claim 1, wherein generating random data to be filled into an SQL database according to the SQL statement to be detected comprises:
acquiring an SQL database table structure according to the SQL statement to be detected;
acquiring fields and field types in the table structure according to the SQL table structure;
and generating random data according to the fields and the field types, and filling the random data into an SQL database.
5. The method for detecting an SQL statement according to claim 1, wherein generating random variable padding into parameters to be padded in the SQL statement according to the SQL statement to be detected comprises:
acquiring parameters and parameter types required by the SQL sentence to be detected according to the SQL sentence to be detected;
generating a random variable according to the parameter and the parameter type;
and filling the random variable into parameters to be filled in the SQL sentence.
6. The method for detecting an SQL statement according to claim 1, wherein the running the filled SQL statement based on the filled SQL database, generating a running result comprises:
operating the filled SQL statement based on the filled SQL database, generating an operation failure result when the operation fails, recording the SQL statement to be detected as abnormal data, and storing the abnormal data into an abnormal log;
and when the operation is successful, generating an operation success result, recording the SQL statement to be detected as normal data, and storing the normal data into a normal log.
7. The method for detecting an SQL statement according to claim 6, wherein when the operation is successful, generating an operation success result and recording the SQL statement as normal data to be saved to a normal log further comprises:
when the operation is successful, generating an operation success result, repeatedly operating the filled SQL statement, and recording the operation time of each filled SQL statement;
calculating the average running time of the filled SQL statement according to the running time of each filled SQL statement;
and identifying low-quality SQL sentences according to the average running time.
8. A device for detecting an SQL statement, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements a method for detecting an SQL statement according to any one of claims 1 to 7 when executing the computer program.
CN202211396817.6A 2022-11-09 2022-11-09 SQL sentence detection method and device Pending CN116089260A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211396817.6A CN116089260A (en) 2022-11-09 2022-11-09 SQL sentence detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211396817.6A CN116089260A (en) 2022-11-09 2022-11-09 SQL sentence detection method and device

Publications (1)

Publication Number Publication Date
CN116089260A true CN116089260A (en) 2023-05-09

Family

ID=86198125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211396817.6A Pending CN116089260A (en) 2022-11-09 2022-11-09 SQL sentence detection method and device

Country Status (1)

Country Link
CN (1) CN116089260A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117171367A (en) * 2023-09-26 2023-12-05 北京泰策科技有限公司 Specification detection method for specified attribute values of different database tables
CN117591543A (en) * 2024-01-19 2024-02-23 成都工业学院 SQL sentence generation method and device for Chinese natural language

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117171367A (en) * 2023-09-26 2023-12-05 北京泰策科技有限公司 Specification detection method for specified attribute values of different database tables
CN117171367B (en) * 2023-09-26 2024-04-12 北京泰策科技有限公司 Specification detection method for specified attribute values of different database tables
CN117591543A (en) * 2024-01-19 2024-02-23 成都工业学院 SQL sentence generation method and device for Chinese natural language
CN117591543B (en) * 2024-01-19 2024-04-02 成都工业学院 SQL sentence generation method and device for Chinese natural language

Similar Documents

Publication Publication Date Title
CN116089260A (en) SQL sentence detection method and device
US11163744B2 (en) Test data generation and scale up for database testing using unique common factor sequencing
US7373636B2 (en) Automated software testing system and method
US6182245B1 (en) Software test case client/server system and method
US10387236B2 (en) Processing data errors for a data processing system
US20080010240A1 (en) Executing alternative plans for a SQL statement
US20050154740A1 (en) Method and system for a self-healing query access plan
US20180046675A1 (en) Automatic adjustment of an execution plan for a query
CN112783867A (en) Database optimization method for meeting real-time big data service requirements and cloud server
CN115658452A (en) Buried point checking method, buried point checking device, readable storage medium and electronic equipment
CN113535141A (en) Database operation code generation method and device
CN109697161A (en) A kind of test method of storing process, storage medium and database server
CN118210730A (en) Product code detection method, device and medium
Jiang et al. Assuring the model evolution of protocol software specifications by regression testing process improvement
Moonen et al. What are the effects of history length and age on mining software change impact?
US11176022B2 (en) Health diagnostics and analytics for object repositories
CN115904480B (en) Code reconstruction method, device, electronic equipment and storage medium
US20080172659A1 (en) Harmonizing a test file and test configuration in a revision control system
CN109508204B (en) Front-end code quality detection method and device
US20240202105A1 (en) Automated testing of database commands
US7185318B1 (en) Method, system and computer program for comparing a first specification with a second specification
US11281564B2 (en) Method and system for generating key performance indicators (KPIs) for software based on debugging information
US9244955B1 (en) Methods and apparatus for generating a database layout
Waal An optimality proof of Statistics Netherlands' new algorithm for automatic editing of mixed data
CN116975038A (en) Database index-based verification method and device and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination