CN116166461A - Error diagnosis method, storage medium and device for database operation statement - Google Patents

Error diagnosis method, storage medium and device for database operation statement Download PDF

Info

Publication number
CN116166461A
CN116166461A CN202310087410.3A CN202310087410A CN116166461A CN 116166461 A CN116166461 A CN 116166461A CN 202310087410 A CN202310087410 A CN 202310087410A CN 116166461 A CN116166461 A CN 116166461A
Authority
CN
China
Prior art keywords
error
character
sentence
grammar
information
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
CN202310087410.3A
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.)
Beijing Kingbase Information Technologies Co Ltd
Original Assignee
Beijing Kingbase Information Technologies 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 Beijing Kingbase Information Technologies Co Ltd filed Critical Beijing Kingbase Information Technologies Co Ltd
Priority to CN202310087410.3A priority Critical patent/CN116166461A/en
Publication of CN116166461A publication Critical patent/CN116166461A/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/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Quality & Reliability (AREA)
  • Machine Translation (AREA)

Abstract

The invention provides an error diagnosis method, a storage medium and equipment for database operation sentences. The error diagnosis method comprises the following steps: sending an operation statement to a server; detecting an execution result of the operation statement; if the execution result shows grammar errors, receiving error information of the operation sentences and character position values, wherein the character position values are used for marking the number of characters where the grammar errors are relative to the whole operation sentences; and acquiring detailed position information of the grammar error in the operation sentence according to the character position value, wherein the detailed position information at least comprises the line number of the grammar error relative to the operation sentence. That is, the database server is first made to perform preliminary identification on the error location to obtain a preliminary error location, and the client is further made to perform further processing on the preliminary error location to obtain a detailed error location. Thus, a more accurate error location can be communicated to the user, thereby facilitating faster user localization to errors.

Description

Error diagnosis method, storage medium and device for database operation statement
Technical Field
The present invention relates to the field of database technologies, and in particular, to a method, a storage medium, and an apparatus for diagnosing errors in database operation sentences.
Background
PL/SQL (Procedural Language/Structured Query Language, procedural structural query language) is often used during database usage. PL/SQL is a procedural extension to SQL, i.e., by adding procedural processing statements (e.g., loops, etc.) to SQL statements, more complex functions are implemented. The syntax structure of PL/SQL is in the basic unit of blocks, for example, a complete PL/SQL statement may comprise: the header defines a block and a function body block.
Errors may be reported during the execution of PL/SQL by the database. At this point, the database will return an error message, but the error message can only get the PL/SQL execution to have an error. If the PL/SQL statement has a grammar error, the user needs to find a specific error position by himself. For complex PL/SQL statements, however, program statements may reach thousands of lines, making it difficult for a user to quickly locate a particular error location.
Disclosure of Invention
An object of the present invention is to provide an error diagnosis method, a storage medium, and an apparatus for database operation statements capable of solving any of the above problems.
It is a further object of the present invention to record various execution results of an operation statement.
In particular, the present invention provides an error diagnosis method for database operation sentences, comprising:
sending an operation statement to a server;
detecting an execution result of the operation statement;
if the execution result shows grammar errors, receiving error information of the operation sentences and character position values, wherein the character position values are used for marking the number of characters where the grammar errors are relative to the whole operation sentences;
and acquiring detailed position information of the grammar error in the operation sentence according to the character position value, wherein the detailed position information at least comprises the line number of the grammar error relative to the operation sentence.
Optionally, the step of acquiring detailed location information of the grammar error in the operation sentence according to the character location value includes:
acquiring statement content of an operation statement;
counting characters of the sentence content from the first character of the sentence content and recording a character count value;
identifying line feed symbols in statement content in the counting process and recording the number of lines to be counted;
and obtaining the line number of the character corresponding to the character count value relative to the operation statement until the character count value is equal to the character position value, thereby determining the line number of the grammar error.
Optionally, the step of recording the number of rows to be counted includes, after:
counting the characters of each row additionally and recording the character ordinal number of the characters in the row;
the step of obtaining the number of lines of the characters corresponding to the character count value relative to the operation sentence comprises the following steps:
and acquiring the position of the character corresponding to the character count value in the row according to the character ordinal.
Optionally, the step of detecting the execution result of the operation sentence includes:
judging whether the execution result is wrong, if so, obtaining the error type of the mistake, processing the mistake according to the error type, and if not, obtaining the success state information of the execution result.
Optionally, the step of processing the error according to the error type includes:
judging whether the error type is grammar error, if yes, executing the step of receiving error information and character position value of the operation sentence, and if not, receiving the error information.
Optionally, the step of obtaining successful status information of the execution result includes:
and displaying the successful state information outwards.
Optionally, the step of acquiring the detailed location information of the operation sentence according to the character location value includes:
a modification opinion of grammar errors is given.
Optionally, the step of acquiring detailed location information of the operation sentence based on the character location value includes:
and displaying error information and detailed position information.
In particular, in another aspect of the present invention, there is also provided a machine-readable storage medium having stored thereon a machine-executable program which, when executed by a processor, implements the error diagnosis method of the database operation sentence according to any one of the above.
In particular, in a further aspect of the present invention, there is also provided a computer apparatus including a memory, a processor, and a machine executable program stored on the memory and running on the processor, and the processor implementing the error diagnosis method of the database operation statement according to any one of the above when executing the machine executable program.
According to the error diagnosis method of the database operation statement, under the condition that grammar errors occur in the operation statement, error information of the operation statement and character position values where the errors are located are received, and then detailed position information of the grammar errors is obtained according to the character position values. That is, the database server first performs preliminary recognition on the error position to obtain a preliminary position of the error relative to the whole operation sentence, that is, the character of the error character with grammar error is the character relative to the whole operation sentence. After the client receives the preliminary error position, the preliminary error position may be further processed, so as to obtain a detailed position of the grammar error, that is, obtain which line of the operation sentence the grammar error is located in. Therefore, by acquiring the number of the rows of the errors relative to the operation statement, a more accurate error position can be transmitted to the user, so that the user can conveniently and quickly locate the errors. Moreover, the server only needs to return a preliminary position, namely, the character position value of the error relative to the whole operation statement, so that the server can be prevented from being subjected to larger processing pressure, and the processing performance of the server is prevented from being greatly adversely affected.
Further, the error diagnosis method of the database operation statement of the invention judges whether the execution result of the operation statement is wrong, receives the successful state information of the execution result under the condition of no error, and acquires the error type under the condition of error. If the error type is grammar error, the error information and the character position value are obtained, and if the error type is not grammar error, only the error information is obtained. Therefore, various execution results of the operation sentences can be obtained, so that various execution results of the operation sentences can be recorded, and further, the user can conveniently search and comprehensively analyze the operation sentences with different execution results.
The above, as well as additional objectives, advantages, and features of the present invention will become apparent to those skilled in the art from the following detailed description of a specific embodiment of the present invention when read in conjunction with the accompanying drawings.
Drawings
Some specific embodiments of the invention will be described in detail hereinafter by way of example and not by way of limitation with reference to the accompanying drawings. The same reference numbers will be used throughout the drawings to refer to the same or like parts or portions. It will be appreciated by those skilled in the art that the drawings are not necessarily drawn to scale. In the accompanying drawings:
FIG. 1 is a schematic flow diagram of a method of error diagnosis of database operation statements in accordance with one embodiment of the invention;
FIG. 2 is a schematic flow chart of the step of acquiring detailed position information of grammar errors in an operation sentence according to character position values in an error diagnosis method of a database operation sentence according to one embodiment of the present invention;
FIG. 3 is a schematic flow chart of a step of acquiring detailed position information of a grammar error in an operation sentence according to a character position value in an error diagnosis method of a database operation sentence according to another embodiment of the present invention;
FIG. 4 is a schematic flow chart of a method of error diagnosis of a database operation statement according to another embodiment of the invention;
FIG. 5 is a schematic flow chart diagram of steps for processing errors according to error category in an error diagnosis method of a database operation statement according to one embodiment of the present invention;
FIG. 6 is a schematic flow chart diagram of a method of error diagnosis of a database operation statement in accordance with yet another embodiment of the invention;
FIG. 7 is a schematic diagram of a machine-readable storage medium according to one embodiment of the invention;
FIG. 8 is a schematic diagram of a computer device according to one embodiment of the invention.
Detailed Description
It should be understood by those skilled in the art that the embodiments described below are only some embodiments of the present invention, but not all embodiments of the present invention, and the some embodiments are intended to explain the technical principles of the present invention and are not intended to limit the scope of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive effort, based on the embodiments provided by the present invention, shall still fall within the scope of protection of the present invention.
It should be noted that the logic and/or steps represented in the flowcharts or otherwise described herein, for example, may be considered as a ordered listing of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
As shown in fig. 1, in the present embodiment, the error diagnosis method of the database operation sentence generally includes:
step S101, an operation sentence is sent to a server side. Specifically, the written PL/SQL statement is sent to the server side and executed by the server side.
Step S102, detecting an execution result of the operation sentence. Namely detecting the execution result of the PL/SQL statement at the server.
Specifically, after receiving the PL/SQL statement, the server recompiles the PL/SQL and converts the PL/SQL statement into a language that can be used by the database. If grammar errors occur, the server can find out in the process of recompiling the operation sentences.
Step S103, if the execution result shows grammar errors, receiving error information of the operation sentence and character position values. The character position value is used for identifying the number of characters where the grammar error is relative to the whole operation sentence, namely, the number of characters where the grammar error is the whole operation sentence. Specifically, if a grammar error appears in the PL/SQL sentence, the client receives error information recognized by the server and a character position value of the error relative to the whole PL/SQL sentence. For example, the grammar error is found to be located at 10000 th character of PL/SQL sentence, character position value is 10000.
Step S104, the detailed position information of the grammar errors in the operation sentences is obtained according to the character position values. The detailed location information includes at least the number of lines in which the grammar errors are relative to the operation statement.
Referring to fig. 2, specifically, the step of acquiring detailed location information of a grammar error in an operation sentence according to a character location value includes:
step S201, the sentence content of the operation sentence is acquired. Specifically, the client stores the original PL/SQL statement, and thus, the client can acquire the statement content of the operation statement.
Step S202, counting characters of the sentence content from the first character of the sentence content and recording a character count value. That is, the characters of the sentence content are counted one by one from the first character of the sentence content, and the character count value is recorded, so that the number of the currently counted characters relative to the whole operation sentence can be known.
In step S203, a line feed in the sentence content is identified and the number of lines to be counted is recorded in the counting process. In the counting process, the line number to be counted can be obtained by identifying the line feeder.
For example, before counting starts with the first character, the record is the first line at this time, or because the number of currently identified line breaks is zero, the number of lines to be counted is the first line. When the first line-feed is identified, indicating that the first line has been counted, it is known that the next line to be counted is the second line. When the second line-feed is identified, it is known that the next line to be counted is the third line.
Specifically, step S202 and step S203 do not indicate that there is a sequential relationship between the two. In the present embodiment, the number of lines to be counted is recorded to represent the number of lines to be counted before starting counting each line.
Step S204, until the character count value is equal to the character position value, the line number of the character corresponding to the character count value relative to the operation sentence is obtained, and therefore the line number of the grammar error is determined. Because the character position value identifies the position of the wrong character relative to the whole operation sentence, when the character count value is equal to the character position value, that is, the wrong character is counted. Further, the number of lines to be counted can be known by the line feed symbol, and therefore the number of lines of the error character with respect to the operation sentence can be obtained.
Illustratively, the character position value received by the client is 10000, for example. The client starts counting after acquiring the statement content of the operation statement. When 9970 is counted, the 200 th line connector is identified. The next line to be counted is the 201 st line, and in the process of counting the characters of the 201 st line, the character count value is recorded to 10000. The error character is illustrated in line 201.
In the scheme of the embodiment, when the grammar error occurs in the operation sentence, error information of the operation sentence and a character position value where the error is located are received, and then detailed position information of the grammar error is obtained according to the character position value. That is, the database server first performs preliminary recognition on the error position to obtain a preliminary position of the error relative to the whole operation sentence, that is, the character of the error character with grammar error is the character relative to the whole operation sentence. After the client receives the preliminary error position, the preliminary error position may be further processed, so as to obtain a detailed position of the grammar error, that is, obtain which line of the operation sentence the grammar error is located in.
Therefore, by acquiring the number of the rows of the errors relative to the operation statement, a more accurate error position can be transmitted to the user, so that the user can conveniently and quickly locate the errors. Moreover, the server only needs to return a preliminary position, namely, the character position value of the error relative to the whole operation statement, so that the server can be prevented from being subjected to larger processing pressure, and the processing performance of the server is prevented from being greatly adversely affected.
As shown in fig. 3, in the error diagnosis method of the database operation sentence, the step of acquiring detailed position information of the grammar error in the operation sentence according to the character position value generally includes:
step S301, the sentence content of the operation sentence is acquired.
Step S302, counting the characters of the sentence content from the first character of the sentence content and recording the character count value.
Step S303, identifying a line feed in the statement content and recording the number of lines to be counted.
Step S304, additionally counts the characters of each row and records the character ordinal number of the characters in the row.
Specifically, in the counting process, by identifying the line feed, the number of lines to be counted can be obtained, so that the characters of each line can be individually counted.
For example, when the first character starts to count and is the first line, the character count value is recorded, and the character number of the first line can be recorded. When the first line changing symbol is identified, the first line is already counted, and the next line to be counted is the second line, so that when the characters of the second line are counted, the character count value can be recorded, and the number of the characters of the second line can be recorded.
Step S305, until the character count value is equal to the character position value, the number of lines of the characters corresponding to the character count value relative to the operation sentence is obtained, and thus the number of lines of grammar errors is determined.
Step S306, the position of the character corresponding to the character count value in the line is obtained according to the character ordinal number. Since the character ordinal number identifies the position of the character in the line, that is, the number of characters in the line, when the character count value is equal to the character position value, the number of lines counted can be determined, and at the same time, the number of characters corresponding to the character count value can be determined as the number of characters of the current line number.
In the scheme of the embodiment, the characters of each row are additionally counted and the character ordinal number is recorded, and in the counting process, the character count value can be obtained, so that the position of the characters relative to the whole operation sentence is obtained. Meanwhile, the character ordinal number of the character relative to the line of the character, namely the character number of the line of the character, can be obtained. Therefore, when the character count value is equal to the character position value, it is possible to determine, at the same time as determining which number of lines of the operation sentence the erroneous character having the syntax error belongs to, which number of characters the erroneous character having the syntax error itself belongs to. That is, the number of the characters of the line of the operation sentence, which is the wrong character with grammar errors, can be obtained, so that more accurate error positions can be obtained, and a user can quickly locate errors.
As shown in fig. 4, in the present embodiment, the error diagnosis method of the database operation sentence generally includes:
step S401, an operation sentence is sent to a server.
Step S402, detecting an execution result of the operation sentence.
Step S403, determining whether the execution result is wrong, if yes, executing step S405, and if not, executing step S404. Specifically, the execution result of the operation statement includes both success and error.
Step S404, obtaining successful state information of the execution result. Specifically, if the execution of the operation statement is successful, the state information of the successful execution is obtained, so that the execution condition of the operation statement is recorded, and the later check is facilitated.
Step S405, obtaining error types of errors, and processing the errors according to the error types.
Referring to fig. 5, the step of processing the error according to the error type includes:
step S501 is to determine whether the error type is a syntax error, if yes, step S503 is executed, and if no, step S502 is executed. Specifically, the execution error of the operation sentence may be that a grammar error occurs, or the operation sentence itself is not wrong, but the operation sentence is executed in error due to the error of the data content of the database.
In step S502, an error message is received. If the grammar is not wrong, that is, the operation sentence has no error, that is, the character position value does not exist, only the error information is received.
In step S503, error information of the execution result and the character position value are received.
Step S504, the detailed position information of the grammar errors in the operation sentences is obtained according to the character position values.
In the scheme of the embodiment, by judging whether the execution result of the operation sentence is wrong, the successful state information of the execution result is received under the condition that the execution result is not wrong, and the error type is acquired under the condition that the execution result is wrong. If the error type is grammar error, the error information and the character position value are obtained, and if the error type is not grammar error, only the error information is obtained. Therefore, various execution results of the operation sentences can be obtained, so that various execution results of the operation sentences can be recorded, and further, the user can conveniently search and comprehensively analyze the operation sentences with different execution results.
Specifically, in one embodiment, the step of acquiring the detailed position information of the operation sentence from the character position value includes, after: a modification opinion of grammar errors is given. By directly giving out the wrong modification opinion, the user is convenient to modify the operation sentence subsequently.
In addition, the step of acquiring detailed position information of the operation sentence based on the character position value includes, after the step of acquiring the detailed position information of the operation sentence: and displaying error information and detailed position information.
The step of obtaining successful status information of the execution result includes: and displaying the successful state information outwards.
That is, regardless of the execution result of the operation sentence, information of the execution result is presented to the user. And, in case that the error is a grammar error, the error information, the detailed location information and the modification opinion are synchronously presented to the user. Thereby saving the fetch time.
As shown in fig. 6, in the present embodiment, the error diagnosis method of the database operation sentence generally includes:
in step S601, the client sends an operation sentence to the server. Namely, the written PL/SQL statement is sent to the server side and executed by the server side.
In step S602, the server parses the operation statement. That is, the operation sentences are recompiled to obtain languages which can be used by the database, so that the operation sentences are executed.
Step S603, if yes, go to step S604, and if no, go to step S605. Specifically, whether the operation statement is in error in the execution process.
Step S604 returns status information of successful execution. If the operation sentence is normally executed, status information of successful execution is returned to the client, and step S609 is executed. I.e. the client receives status information of successful execution.
Step S605 determines whether the error type is a grammar error, if yes, step S607 is executed, and if no, step S606 is executed. Specifically, the execution error of the operation sentence may be that a grammar error occurs, or the operation sentence itself is not wrong, but the operation sentence is executed in error due to the error of the data content of the database.
Step S606 returns an error message, and step S609 is executed. If the grammar is not wrong, i.e. the operation sentence itself is not wrong, the character position value is not present. Therefore, the server only needs to return the error information to identify which error occurs, that is, the client only needs to receive the error information.
In step S607, an error message and a character position value are returned. If the grammar errors appear in the operation sentences, the server side returns the recognized error information and the character position values of the grammar errors in the operation sentences to the client side, namely the client side receives the error information and the character position values which are recognized by the server side.
Step S608, giving error detailed position and modification opinion according to the character position value and the original operation sentence. Specifically, the client stores an original operation sentence, thereby acquiring the sentence content of the operation sentence. The characters of the sentence content are then counted one by one. And until the character count value is equal to the character position value, determining the position of the error character which is counted to have grammar errors, and acquiring the line number of the error character in the operation sentence and the character ordinal number in the line. Meanwhile, a modification opinion of the wrong character is given.
In step S609, the client returns information to the application. Specifically, the successful state information of the operation statement, or error information and detailed error position and modification opinion are returned to the application program.
In step S610, the application program displays the information to the outside. That is, the user can view the specific execution situation of the operation sentence.
In the solution of the present embodiment, the successful status information of the execution result is received in the case that the operation statement is not erroneous. In the case of an error, if the error type is a grammar error, the error information and the character position value are acquired, and if the error type is not a grammar error, only the error information is acquired. Therefore, various execution results of the operation sentence can be acquired, and thus various execution results of the operation sentence can be recorded.
Under the condition that grammar errors occur in the operation sentences, the database server side is firstly enabled to conduct preliminary identification on the error positions, and the preliminary positions of the errors relative to the whole operation sentences are obtained, namely, the number of characters of the error characters with grammar errors relative to the whole operation sentences is obtained. After the client receives the preliminary error position, the preliminary error position can be further processed, so that the detailed error position is obtained.
Therefore, the method is convenient for the user to search and comprehensively analyze operation sentences with different execution results. And the detailed position of the grammar error can be obtained, thereby facilitating the rapid positioning of the user to the error. Moreover, the server only needs to return to one preliminary position, so that larger processing pressure on the server can be avoided, and larger adverse influence on the processing performance of the server is avoided.
The present embodiment also provides a machine-readable storage medium and a computer device. FIG. 7 is a schematic diagram of a machine-readable storage medium 10 according to one embodiment of the invention. Fig. 8 is a schematic diagram of a computer device 20 according to one embodiment of the invention.
The machine-readable storage medium 10 has stored thereon a machine-executable program 11, which when executed by a processor, implements the error diagnosis method of the database operation statement of any of the above embodiments.
The computer device 20 may include a memory 210, a processor 220, and a machine executable program 11 stored on the memory 210 and running on the processor 220, and the processor 220 implements the error diagnosis method of the database operation statement of any of the above embodiments when executing the machine executable program 11.
It should be noted that the logic and/or steps represented in the flow diagrams or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any machine-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
For the purposes of this description of embodiments, a machine-readable storage medium 10 can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the machine-readable storage medium 10 may even be paper or other suitable medium upon which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
The computer device 20 may be, for example, a server, a desktop computer, a notebook computer, a tablet computer, or a smartphone. In some examples, computer device 20 may be a cloud computing node. The computer device 20 may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. Computer device 50 may be implemented in a distributed cloud computing environment where remote processing devices coupled via a communications network perform tasks. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including memory storage devices.
Computer device 20 may include a processor 220 adapted to execute stored instructions, a memory 210 providing temporary storage for the operation of the instructions during operation. Processor 220 may be a single core processor, a multi-core processor, a computing cluster, or any number of other configurations. Memory 210 may include Random Access Memory (RAM), read only memory, flash memory, or any other suitable storage system.
Processor 220 may be connected via a system interconnect (e.g., PCI-Express, etc.) to an I/O interface (input/output interface) adapted to connect computer device 20 to one or more I/O devices (input/output devices). The I/O devices may include, for example, a keyboard and a pointing device, which may include a touch pad or touch screen, among others. The I/O device may be a built-in component of the computer device 20 or may be a device externally connected to the computing device.
The processor 220 may also be linked through a system interconnect to a display interface suitable for connecting the computer device 20 to a display device. The display device may include a display screen as a built-in component of the computer device 20. The display device may also include a computer monitor, television, projector, or the like, that is externally connected to the computer device 20. Further, a network interface controller (network interface controller, NIC) may be adapted to connect the computer device 20 to a network through a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as an internet small computer system interface, etc.) to transfer data. The network may be a cellular network, a radio network, a Wide Area Network (WAN), a Local Area Network (LAN), or the internet, among others. The remote device may be connected to the computing device through a network.
The flowcharts provided by this embodiment are not intended to indicate that the operations of the method are to be performed in any particular order, or that all of the operations of the method are included in all of each case. Furthermore, the method may include additional operations. Additional variations may be made to the above-described methods within the scope of the technical ideas provided by the methods of the present embodiments.
By now it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been shown and described herein in detail, many other variations or modifications of the invention consistent with the principles of the invention may be directly ascertained or inferred from the present disclosure without departing from the spirit and scope of the invention. Accordingly, the scope of the present invention should be understood and deemed to cover all such other variations or modifications.

Claims (10)

1. A method of error diagnosis of database operation statements, comprising:
sending an operation statement to a server;
detecting an execution result of the operation statement;
if the executing result shows grammar errors, receiving error information of the operation statement and character position values, wherein the character position values are used for marking the number of characters where the grammar errors are located relative to the whole operation statement;
and acquiring detailed position information of the grammar error in the operation sentence according to the character position value, wherein the detailed position information at least comprises the line number of the grammar error relative to the operation sentence.
2. The error diagnosis method of a database operation sentence according to claim 1, wherein the step of acquiring detailed position information of the grammar error in the operation sentence according to the character position value comprises:
acquiring statement content of the operation statement;
counting characters of the sentence content from the first character of the sentence content and recording a character count value;
identifying line feed symbols in the statement content in the counting process and recording the number of lines to be counted;
and obtaining the line number of the character corresponding to the character count value relative to the operation sentence until the character count value is equal to the character position value, thereby determining the line number of the grammar error.
3. The error diagnosis method of a database operation sentence according to claim 2, wherein the step of recording the number of lines to be counted includes, after:
counting the characters of each row additionally and recording the character ordinal number of the characters in the row;
the step of obtaining the number of lines of the characters corresponding to the character count value relative to the operation sentence includes:
and acquiring the position of the character corresponding to the character count value in the row according to the character ordinal number.
4. The error diagnosis method of a database operation sentence according to claim 1, wherein the step of detecting the execution result of the operation sentence includes, after:
judging whether the execution result is wrong, if so, obtaining the error type of the mistake, processing the mistake according to the error type, and if not, obtaining the success state information of the execution result.
5. The error diagnosis method of database operation sentence according to claim 4, wherein the step of processing the error according to the kind of the error includes:
and judging whether the error type is grammar error, if so, executing the step of receiving the error information and the character position value of the operation sentence, and if not, receiving the error information.
6. The error diagnosis method of database operation statement according to claim 4, wherein the step of acquiring success status information of the execution result comprises, after:
and displaying the successful state information externally.
7. The error diagnosis method of a database operation sentence according to claim 1, wherein the step of acquiring the syntax error from the character position value includes, after the step of acquiring detailed position information of the operation sentence:
and giving a modification opinion of the grammar error.
8. The error diagnosis method of a database operation sentence according to claim 1, wherein the step of acquiring the syntax error from the character position value includes, after the step of acquiring detailed position information of the operation sentence:
and displaying the error information and the detailed position information externally.
9. A machine-readable storage medium having stored thereon a machine-executable program which, when executed by a processor, implements the error diagnosis method of a database operation sentence according to any one of claims 1 to 8.
10. A computer device comprising a memory, a processor and a machine executable program stored on the memory and running on the processor, and the processor implementing a method of error diagnosis of database operation statements according to any one of claims 1 to 8 when executing the machine executable program.
CN202310087410.3A 2023-01-29 2023-01-29 Error diagnosis method, storage medium and device for database operation statement Pending CN116166461A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310087410.3A CN116166461A (en) 2023-01-29 2023-01-29 Error diagnosis method, storage medium and device for database operation statement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310087410.3A CN116166461A (en) 2023-01-29 2023-01-29 Error diagnosis method, storage medium and device for database operation statement

Publications (1)

Publication Number Publication Date
CN116166461A true CN116166461A (en) 2023-05-26

Family

ID=86417771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310087410.3A Pending CN116166461A (en) 2023-01-29 2023-01-29 Error diagnosis method, storage medium and device for database operation statement

Country Status (1)

Country Link
CN (1) CN116166461A (en)

Similar Documents

Publication Publication Date Title
CN108388514B (en) Interface automation test method, device, equipment and computer readable storage medium
CN106951364B (en) Test method and device
CN108984388B (en) Method and terminal equipment for generating automatic test case
CN111090641B (en) Data processing method and device, electronic equipment and storage medium
CN110109818A (en) Monitoring method, device, terminal and the readable storage medium storing program for executing of back end interface data
CN113360519B (en) Data processing method, device, equipment and storage medium
US20230412742A1 (en) Apparatus, method, and system for monitoring image-forming apparatus, and storage medium
CN111190551B (en) Redis data migration system, migration method, migration device and terminal
CN113312260B (en) Interface test method, device, equipment and storage medium
CN111046393B (en) Vulnerability information uploading method and device, terminal equipment and storage medium
CN112817883A (en) Method, device and system for adapting interface platform and computer readable storage medium
CN116166461A (en) Error diagnosis method, storage medium and device for database operation statement
CN115357513B (en) Program ambiguity test method, device, equipment and storage medium
CN110688305A (en) Test environment synchronization method, device, medium and electronic equipment
US11537485B2 (en) Test sequencing method, configuration generating method, and configuration generating apparatus for testing devices according to their communication protocols
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN113868137A (en) Method, device and system for processing buried point data and server
CN112631929A (en) Test case generation method and device, storage medium and electronic equipment
CN108694105B (en) Wiring prompting method of rack-mounted server system
CN117112389A (en) Code detection method, device, computer equipment and storage medium
CN114818645B (en) Automatic report generation method, device, equipment and medium based on data body
CN117538672B (en) Test method and device for target capacitive screen and electronic equipment
CN111552637B (en) Database state detection method and device, electronic equipment and storage medium thereof
CN112084082B (en) Keyboard detection method
CN116501585A (en) Log processing method, electronic equipment and log processing system

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