CN113742200A - Test method, device and computer readable medium for database version upgrade - Google Patents

Test method, device and computer readable medium for database version upgrade Download PDF

Info

Publication number
CN113742200A
CN113742200A CN202010469885.5A CN202010469885A CN113742200A CN 113742200 A CN113742200 A CN 113742200A CN 202010469885 A CN202010469885 A CN 202010469885A CN 113742200 A CN113742200 A CN 113742200A
Authority
CN
China
Prior art keywords
audit
sql statement
database
version
sql
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
CN202010469885.5A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010469885.5A priority Critical patent/CN113742200A/en
Publication of CN113742200A publication Critical patent/CN113742200A/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/3676Test management for coverage analysis
    • 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
    • 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/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The embodiment of the application provides a test scheme for upgrading a database version, which can acquire an audit SQL statement of a database instance of a version before upgrading in a cloud database system as a test case, then play back the audit SQL statement in the database instance of the version after upgrading, acquire a playback execution result of the audit SQL statement, and determine an incompatible SQL statement according to the playback execution result. Because the test cases can be from all database instances of the pre-upgrade version in the whole cloud database system, are data of the whole network, and are not only from data of a certain user, the coverage of SQL statements for testing is higher, and the possibility of missing test results is lower and the test results are more accurate.

Description

Test method, device and computer readable medium for database version upgrade
Technical Field
The present application relates to the field of information technology, and in particular, to a method and an apparatus for testing version upgrade of a database, and a computer readable medium.
Background
With the development of information technology, more and more enterprises use various databases in daily work to maintain the normal operation of the enterprises or provide services to the outside. In an actual scene, if an enterprise purchases corresponding equipment and builds a network to build a database, higher cost and professional operation and maintenance capacity are often needed, so most enterprises can select an existing cloud database system. The cloud database system is a database deployed in a virtual computing environment, can provide service library services for different users, and has the advantages of realizing on-demand payment, on-demand expansion, high availability, storage integration and the like, and can be various public clouds, private clouds, mixed clouds and the like.
For the cloud database system, the operator can also upgrade the version of the cloud database system due to reasons such as function upgrade, system reconfiguration, bug repair and the like, so that the database instance in the cloud database system is upgraded from the version before upgrade to the version after upgrade. The version upgrade of the database has a great risk to the user, for example, the user may be affected by the bad compatibility of the upgraded version with the original logic. Therefore, generally, a test and evaluation is performed on the influence caused by the upgrade before the version upgrade is performed, and a currently common test method is to check related logic by a user for a database instance of the user, so that the test can only evaluate whether SQL (Structured Query Language) statements actually used by the user are compatible, but cannot cover all possible SQL statements in the cloud database system, and therefore the coverage is low, and test results often leave out some incompatible SQL statements.
Disclosure of Invention
An object of the present application is to provide a method, an apparatus and a computer readable medium for testing version upgrade of a database, so as to solve the problems of low coverage and missing test results.
The embodiment of the application provides a method for testing version upgrading of a database, which comprises the following steps:
obtaining an audit SQL statement of an old version database instance in a cloud database system, wherein the audit SQL statement is an SQL statement recorded when the database instance carries out database audit timing;
the audit SQL statement is played back in the database instance of the new version, and a playback execution result of the audit SQL statement is obtained;
and determining incompatible SQL sentences according to the playback execution result.
Some embodiments of the present application further provide a test device for upgrading a database version, including:
the use case acquisition module is used for acquiring an audit SQL statement of an old version database instance in the cloud database system, wherein the audit SQL statement is an SQL statement recorded when the database instance carries out database audit;
the test execution module is used for playing back the audit SQL statement in the database example of the new version and acquiring a playback execution result of the audit SQL statement;
and the result generation module is used for determining incompatible SQL sentences according to the playback execution result.
Some embodiments of the present application also provide a computing device, wherein the device comprises a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein the computer program instructions, when executed by the processor, trigger the device to perform the aforementioned test method of database version upgrade.
Still other embodiments of the present application provide a computer readable medium having computer program instructions stored thereon that are executable by a processor to implement the method for testing a database version upgrade.
According to the test scheme for upgrading the database version, audit SQL sentences of the database instance of the version before upgrading in the cloud database system can be obtained and used as test cases, then the audit SQL sentences are played back in the database instance of the version after upgrading, the playback execution results of the audit SQL sentences are obtained, and incompatible SQL sentences can be determined according to the playback execution results. Because the test cases can be from all database instances of the pre-upgrade version in the whole cloud database system, are data of the whole network, and are not only from data of a certain user, the coverage of SQL statements for testing is higher, and the possibility of missing test results is lower and the test results are more accurate.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is a flowchart illustrating a method for testing database version upgrades according to an embodiment of the present disclosure;
fig. 2 is a processing flow diagram for evaluating a version upgrade in a cloud database system by using a test scheme provided in an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a testing apparatus for upgrading a database version provided in this application;
FIG. 4 is a schematic structural diagram of a computing device for database version upgrade testing according to an embodiment of the present application;
the same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
The embodiment of the application provides a test method for upgrading a database version, the method obtains audit SQL sentences of database instances of versions before upgrading in a cloud database system as test cases for testing, and the test cases can be from all database instances of versions before upgrading in the whole cloud database system, are whole network data of the whole cloud database system, and are not only data of a certain user, so that the coverage of the SQL sentences for testing is higher, the possibility of omission of test results is lower, and the test results are more accurate.
Fig. 1 shows a processing flow of a testing method for upgrading a database version provided in an implementation of the present application, which at least includes the following processing steps:
and S101, obtaining an audit SQL statement of the database instance of the version before upgrading in the cloud database system.
In an actual scene, the cloud database system can provide an auditing function for all database instances, database auditing (DBAudio) can record various activities of the database instances in real time, and the database auditing system is used for helping a user generate a compliance report and accident tracing and tracing after the fact through recording, analyzing and reporting the behavior of the user accessing the database, and meanwhile strengthening network behavior records of an internal database and an external database. Therefore, based on the auditing function of the cloud database system, the SQL statements recorded when the database instance conducts database auditing, namely the auditing SQL statements, can be obtained. The method and the device have the advantages that the SQL sentences with large coverage can be obtained by collecting the audit SQL sentences of all the database instances of the versions before upgrading in the whole cloud database system, and the audit SQL sentences are used as test cases in the scheme of the embodiment of the application, so that the compatibility test of the upgraded versions is realized.
For example, in the cloud database system related in this embodiment, 100 database instances of the v1.0 version of the database software actually run, and when the version of the database software needs to be upgraded from v1.0 to v2.0, the test scheme for upgrading the database version provided in this embodiment of the present application may be used to evaluate the upgrade. The v1.0 version is the version before upgrading, the v2.0 version is the version after upgrading, and when the audit SQL statements are collected, the SQL statements recorded during the auditing can be obtained from the 100 database instances of the v1.0 version so as to generate a test case.
When using the audit SQL statements, the data security problem may be faced during the use process because the SQL statements come from real data in the cloud database system. In order to guarantee the safety of data and reduce the risk of data leakage, desensitization processing can be performed on the obtained audit SQL sentences after the audit SQL sentences of the database instances of the versions before upgrading in the cloud database system are obtained. In an actual scenario, the desensitization mode of the audit SQL statement may be to replace a part related to sensitive content in the audit SQL statement, for example, if one SQL statement of a certain database instance is a query statement that queries a certain record through a user phone number or a name, part of content of information such as a phone number and a name related to the SQL statement may be replaced with a preset symbol, so as to desensitize the audit SQL statement and ensure data security.
When the scale of the cloud database system is large, the number of database instances of the version before upgrading is large, so that the number of actually acquired audit SQL statements is huge, and if all the audit SQL statements are directly used for testing, the processing load during testing is too large, and the testing efficiency is too low. After obtaining audit SQL statements of all database instances of versions before upgrading in the cloud database system and performing desensitization processing on the audit SQL statements, sensitive information in the audit SQL statements is replaced by preset symbols, for example, the sensitive information in the audit SQL statements can be replaced by a symbol "+", so that the desensitized audit SQL statements are composed of operation instructions meeting syntax rules such as select, update, delete and the like and contents (such as metadata and the like) which do not relate to the sensitive information by preset symbols. Therefore, after desensitization processing is carried out on the audit SQL sentences, the contents of the SQL sentences which finish the similar operation are probably the same, so that after the audit SQL sentences of all the database instances of the version before upgrading in the cloud database system are obtained and desensitization processing is carried out on the audit SQL sentences, repeated audit SQL sentences can be deleted.
In some embodiments of the application, when a repeated audit SQL statement is deleted, parameterization processing may be performed on the desensitized audit SQL statement, and whether the audit SQL statement is repeated is determined based on a result of the parameterization processing. The parameterized processing can be that hash calculation is carried out to obtain hash values of the audit SQL statements, and the respective hash values are used as fingerprint information of each audit SQL statement, so that the test can be carried out only by using the audit SQL statements with different fingerprint information. Therefore, when deleting repeated audit SQL statements, the embodiment of the application can firstly perform Hash calculation on the desensitized audit SQL statements to generate fingerprint information corresponding to the audit SQL statements, and then retain a corresponding audit SQL statement for each different fingerprint information. For example, taking 6 audit SQL statements SQL1 to SQL6 as examples, the corresponding fingerprint information is as follows:
sql1:c0ac74d38a91fb7e984b8de1ac4f0d53f26f3303;
sql2:c0ac74d38a91fb7e984b8de1ac4f0d53f26f3303;
sql3:dc7ae1a38a93f27e984b87ae1c498453f26f f26f;
sql4:dc7ae1a38a93f27e984b87ae1c498453f26f f26f;
sql5:c0ac74d38a91fb7e984b8de1ac4f0d53f26f3303;
sql6:c0ac74d38a91fb7e984b8de1ac4f0d53f26f3303;
the fingerprint information of SQL3 and SQL4 is the same, the fingerprint information of SQL1, SQL2, SQL5 and SQL6 is the same, and the above 6 pieces of audit SQL statements have two different fingerprint information. When deleting the duplicate audit SQL statements, for each different fingerprint information, one corresponding audit SQL statement can be reserved, namely one audit SQL statement is selected from SQL3 and SQL4, and SQL1, SQL2, SQL5 and SQL 6. For example, in the present embodiment, the SQL1 and SQL3 may be retained as audit SQL statements for subsequent tests, and the SQL2, SQL4, SQL5 and SQL6 may be deleted, thereby avoiding the problem that the processing load may be too large at the time of subsequent tests.
And S102, replaying the audit SQL statement in the database instance of the upgraded version, and acquiring a replay execution result of the audit SQL statement. The database instance of the upgraded version can be constructed in a test environment, the constructed database instance can contain a data table the same as that of the original database instance (namely, the database instance of the version before upgrading), so that data support is provided for replaying the audit SQL statement, and the audit SQL statement is replayed through the constructed database instance of the upgraded version, so that the test of the audit SQL statement is realized.
In some embodiments of the present application, an upgraded version of a database instance may be built and tested in the environment of a cloud database system. When the method is adopted, the database instances available for testing can be obtained in the cloud database system, and the database instances available for testing can be from the database instances of the version before upgrading or the database instances newly created for the current requirement. For example, if 2 database instances in the aforementioned 100 database instances of v1.0 version are not used at the current time, and may be used for performing the test, the 2 database instances of v1.0 version may be determined as database instances that may be used for the test. Alternatively, 2 database instances may be newly created for subsequent testing.
And then updating the determined version of the database instance for testing into an updated version, playing back the audit SQL statement in the database instance of the updated version, and acquiring a playback execution result of the audit SQL statement. Taking the foregoing scenario as an example, if the determined database instances available for testing are 2 database instances of v1.0 version, the versions of the several database instances may be upgraded from v1.0 to v2.0, and then the audit SQL statement is played back at the database instance of v1.0 version.
At this time, the audit SQL statements used for testing come from all database examples of versions before upgrading in the whole cloud database system, are all network data, and are not only data from a certain user, so that the coverage of the SQL statements used for testing is higher, and the possibility of missing of test results is lower and the test results are more accurate.
And step S103, determining incompatible SQL sentences according to the playback execution result. In an actual scenario, the playback of the execution result may include a success in execution or a failure in execution, and if the execution is successful, it indicates that the corresponding audit SQL statement is compatible with the updated version, otherwise, if the execution is failed, it indicates that the corresponding audit SQL statement is incompatible with the updated version. If the version of the database software in the cloud database system is upgraded to a new version, the incompatible SQL statements cannot be invalidated in the whole cloud database system, and thus errors occur when each database instance processes the SQL statements.
Therefore, in some embodiments of the application, when it is determined that the playback execution result is an execution failure, the corresponding audit SQL statement may be determined as an incompatible SQL statement, so as to find the incompatible SQL statement. Through the quantity and the specific content of the incompatible SQL statements, a user can be helped to evaluate version upgrading, for example, whether the cloud database system can stably run after being updated to a new version is judged, the user is helped to check problems in the new version, and database developers are guided to repair the problems. In an actual scenario, the test scheme of the database version upgrade in the embodiment of the present application may be provided to the user as a service, so that corresponding services may be provided to the ali users (enterprises, developers, and the like) on the cloud.
Fig. 2 shows a processing flow for evaluating a version upgrade in a cloud database system by using a test scheme provided by an embodiment of the present application, which includes the following processing steps:
step S201, collecting audit SQL statements of the database instances of the previous and old versions in the cloud database system, carrying out desensitization processing on the statements, and carrying out parameterization processing to screen out SQL statements with different fingerprint information as test statements.
Step S202, obtaining database instances for testing in the cloud database system, and upgrading the versions of the database instances for testing to new versions.
In step S203, corresponding data tables are created in the database instances of the new versions.
And step S204, playing back the test statement in the database instance of the new version.
And step S205, evaluating the upgrading condition according to the playback execution result. Because the test statements come from all database instances of the versions before the upgrade in the whole cloud database system, the coverage is high, and the playback execution result can show the compatibility of the test statements in the new versions, the user can make a more comprehensive evaluation on the compatibility problem after the versions are upgraded by using the test scheme implemented by the application.
Based on the same inventive concept, the embodiment of the application also provides a test device for upgrading the database version, the corresponding method of the device is the test method for upgrading the database version in the embodiment, and the problem solving principle is similar to that of the method.
When the test equipment for upgrading the database version is used for realizing the test, audit SQL sentences of database instances of versions before upgrading in the cloud database system can be obtained and used as test cases for testing, and the test cases can be from all database instances of versions before upgrading in the whole cloud database system, are whole network data of the whole cloud database system, and are not only data from a certain user, so that the coverage of the SQL sentences for testing is higher, the possibility of omission of test results is lower, and the test results are more accurate.
Fig. 3 shows a structure of a testing device for upgrading a database version, which may include a use case obtaining module 310, a test executing module 320, and a result generating module 330. The use case obtaining module 310 is configured to obtain an audit SQL statement of a database instance of a version before upgrade in the cloud database system. The test execution module 320 is configured to play back the audit SQL statement in the new version of the database instance, and obtain a playback execution result of the audit SQL statement. The result generation module 330 is configured to determine an incompatible SQL statement according to the playback execution result.
In an actual scene, the cloud database system can provide an auditing function for all database instances, database auditing (DBAudio) can record various activities of the database instances in real time, and the database auditing system is used for helping a user generate a compliance report and accident tracing and tracing after the fact through recording, analyzing and reporting the behavior of the user accessing the database, and meanwhile strengthening network behavior records of an internal database and an external database. Therefore, based on the auditing function of the cloud database system, the SQL statements recorded when the database instance conducts database auditing, namely the auditing SQL statements, can be obtained. The method and the device have the advantages that the SQL sentences with large coverage can be obtained by collecting the audit SQL sentences of all the database instances of the versions before upgrading in the whole cloud database system, and the audit SQL sentences are used as test cases in the scheme of the embodiment of the application, so that the compatibility test of the upgraded versions is realized.
For example, in the cloud database system related in this embodiment, 100 database instances of the v1.0 version of the database software actually run, and when the version of the database software needs to be upgraded from v1.0 to v2.0, the test scheme for upgrading the database version provided in this embodiment of the present application may be used to evaluate the upgrade. The v1.0 version is the version before upgrading, the v2.0 version is the version after upgrading, and when the audit SQL statements are collected, the SQL statements recorded during the auditing can be obtained from the 100 database instances of the v1.0 version so as to generate a test case.
When using the audit SQL statements, the data security problem may be faced during the use process because the SQL statements come from real data in the cloud database system. In order to guarantee the safety of data and reduce the risk of data leakage, desensitization processing can be performed on the obtained audit SQL statements by the use case obtaining module before use. In an actual scenario, the desensitization mode of the audit SQL statement may be to replace a part related to sensitive content in the audit SQL statement, for example, if one SQL statement of a certain database instance is a query statement that queries a certain record through a user phone number or a name, part of content of information such as a phone number and a name related to the SQL statement may be replaced with a preset symbol, so as to desensitize the audit SQL statement and ensure data security.
When the scale of the cloud database system is large, the number of database instances of the version before upgrading is large, so that the number of actually acquired audit SQL statements is huge, and if all the audit SQL statements are directly used for testing, the processing load during testing is too large, and the testing efficiency is too low. After obtaining audit SQL statements of all database instances of versions before upgrading in the cloud database system and performing desensitization processing on the audit SQL statements, sensitive information in the audit SQL statements is replaced by preset symbols, for example, the sensitive information in the audit SQL statements can be replaced by a symbol "+", so that the desensitized audit SQL statements are composed of operation instructions meeting syntax rules such as select, update, delete and the like and contents (such as metadata and the like) which do not relate to the sensitive information by preset symbols. Therefore, after desensitization processing is performed on the audit SQL statements, the contents of the SQL statements completing the same type of operation are likely to be the same, so that after the audit SQL statements of all the database instances of the version before upgrading in the cloud database system are obtained and desensitization processing is performed on the audit SQL statements, the use case obtaining module can also delete repeated audit SQL statements.
In some embodiments of the application, when deleting a repeated audit SQL statement, the use case acquisition module may perform parameterization on the desensitized audit SQL statement, and determine whether the audit SQL statement is repeated based on a result of the parameterization. The parameterized processing can be that hash calculation is carried out to obtain hash values of the audit SQL statements, and the respective hash values are used as fingerprint information of each audit SQL statement, so that the test can be carried out only by using the audit SQL statements with different fingerprint information. Therefore, when deleting repeated audit SQL statements, the use case acquisition module can perform hash calculation on the desensitized audit SQL statements to generate fingerprint information corresponding to the audit SQL statements, and then, for each different fingerprint information, a corresponding audit SQL statement is reserved. For example, taking 6 audit SQL statements SQL1 to SQL6 as examples, the corresponding fingerprint information is as follows:
sql1:c0ac74d38a91fb7e984b8de1ac4f0d53f26f3303;
sql2:c0ac74d38a91fb7e984b8de1ac4f0d53f26f3303;
sql3:dc7ae1a38a93f27e984b87ae1c498453f26f f26f;
sql4:dc7ae1a38a93f27e984b87ae1c498453f26f f26f;
sql5:c0ac74d38a91fb7e984b8de1ac4f0d53f26f3303;
sql6:c0ac74d38a91fb7e984b8de1ac4f0d53f26f3303;
the fingerprint information of SQL3 and SQL4 is the same, the fingerprint information of SQL1, SQL2, SQL5 and SQL6 is the same, and the above 6 pieces of audit SQL statements have two different fingerprint information. When deleting the duplicate audit SQL statements, for each different fingerprint information, one corresponding audit SQL statement can be reserved, namely one audit SQL statement is selected from SQL3 and SQL4, and SQL1, SQL2, SQL5 and SQL 6. For example, in the present embodiment, the SQL1 and SQL3 may be retained as audit SQL statements for subsequent tests, and the SQL2, SQL4, SQL5 and SQL6 may be deleted, thereby avoiding the problem that the processing load may be too large at the time of subsequent tests.
The database instance of the upgraded version used by the test execution module during playback of the audit SQL statement can be constructed in a test environment, the constructed database instance can contain a data table the same as the original database instance (namely, the database instance of the version before upgrading), so that data support is provided for playback of the audit SQL statement, and the audit SQL statement is played back through the constructed database instance of the upgraded version, so that the test of the audit SQL statement is realized.
In some embodiments of the present application, an upgraded version of a database instance may be built and tested in the environment of a cloud database system. When the method is adopted, the database instances available for testing can be obtained in the cloud database system, and the database instances available for testing can be from the database instances of the version before upgrading or the database instances newly created for the current requirement. For example, if 2 database instances in the aforementioned 100 database instances of v1.0 version are not used at the current time, and may be used for performing the test, the 2 database instances of v1.0 version may be determined as database instances that may be used for the test. Alternatively, 2 database instances may be newly created for subsequent testing.
And then updating the determined version of the database instance for testing into an updated version, playing back the audit SQL statement in the database instance of the updated version, and acquiring a playback execution result of the audit SQL statement. Taking the foregoing scenario as an example, if the determined database instances available for testing are 2 database instances of v1.0 version, the versions of the several database instances may be upgraded from v1.0 to v2.0, and then the audit SQL statement is played back at the database instance of v1.0 version.
At this time, the audit SQL statements used for testing come from all database examples of versions before upgrading in the whole cloud database system, are all network data, and are not only data from a certain user, so that the coverage of the SQL statements used for testing is higher, and the possibility of missing of test results is lower and the test results are more accurate.
The playback execution result after the test execution module executes the test may include a success in execution or a failure in execution, and if the execution is successful, it indicates that the corresponding audit SQL statement is compatible with the updated version, otherwise, if the execution is failed, it indicates that the corresponding audit SQL statement is incompatible with the updated version. If the version of the database software in the cloud database system is upgraded to a new version, the incompatible SQL statements cannot be invalidated in the whole cloud database system, and thus errors occur when each database instance processes the SQL statements.
Therefore, in some embodiments of the application, the result generation module may determine, when it is determined that the playback execution result is an execution failure, the corresponding audit SQL statement as the incompatible SQL statement, thereby finding the incompatible SQL statement. Through the quantity and the specific content of the incompatible SQL statements, the user can be helped to evaluate whether the cloud database system can stably run after the new version is updated, and the user can check the problems in the new version. In an actual scene, the test method for updating the database version in the embodiment of the application can be provided for the user as a service, so that the corresponding service can be provided for the ali user (enterprise, developer and the like) on the cloud.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. Some embodiments according to the present application include a computing device as shown in fig. 4, which includes one or more memories 410 storing computer-readable instructions and a processor 420 for executing the computer-readable instructions, wherein the computer-readable instructions, when executed by the processor, cause the device to perform the methods and/or aspects based on the embodiments of the present application as described above.
Furthermore, some embodiments of the present application also provide a computer readable medium, on which computer program instructions are stored, the computer readable instructions being executable by a processor to implement the methods and/or technical solutions of the foregoing embodiments of the present application.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In an embodiment, the software program of the present application may be executed by a processor to implement the above steps or functions. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the features specified in the block or blocks of the block diagrams and/or flowchart illustrations of the present disclosure.
Those of skill in the art will appreciate that various operations, methods, steps in the processes, acts, or solutions discussed in the present application may be alternated, modified, combined, or deleted. Further, various operations, methods, steps in the flows, which have been discussed in the present application, may be interchanged, modified, rearranged, decomposed, combined, or eliminated. Further, steps, measures, schemes in the various operations, methods, procedures disclosed in the prior art and the present invention can also be alternated, changed, rearranged, decomposed, combined, or deleted.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

Claims (14)

1. A test method for upgrading a database version is characterized by comprising the following steps:
acquiring an audit Structured Query Language (SQL) statement of a database instance of a version before upgrading in a cloud database system, wherein the audit SQL statement is an SQL statement recorded when the database instance carries out database auditing;
the audit SQL statement is played back in the database instance of the updated version, and a playback execution result of the audit SQL statement is obtained;
and determining incompatible SQL sentences according to the playback execution result.
2. The method of claim 1, wherein after obtaining the audit SQL statements for the pre-upgrade version of the database instance in the cloud database system, the method further comprises:
and desensitizing the audit SQL statement.
3. The method of claim 2, wherein after desensitizing the audited SQL statements, the method further comprises:
and deleting the repeated audit SQL statements.
4. The method of claim 3, wherein deleting duplicate audit SQL statements comprises:
performing Hash calculation on the audit SQL statement to generate fingerprint information corresponding to the audit SQL statement;
and for each different fingerprint information, reserving a corresponding audit SQL statement.
5. The method of claim 1, wherein playing back the audit SQL statement in the upgraded version of the database instance and obtaining the playback execution result of the audit SQL statement comprises:
obtaining a database instance available for testing in the cloud database system;
changing the version of the database instance into an upgraded version;
and playing back the audit SQL statement in the database instance of the upgraded version, and acquiring a playback execution result of the audit SQL statement.
6. The method of claim 1, wherein determining incompatible SQL statements from the playback execution results comprises:
and if the playback execution result is that the execution fails, determining the corresponding audit SQL statement as an incompatible SQL statement.
7. A test apparatus for database version upgrade, the apparatus comprising:
the use case acquisition module is used for acquiring an audit SQL statement of a database instance of a version before upgrading in the cloud database system, wherein the audit SQL statement is an SQL statement recorded when the database instance carries out database auditing;
the test execution module is used for playing back the audit SQL statement in the database instance of the upgraded version and acquiring a playback execution result of the audit SQL statement;
and the result generation module is used for determining incompatible SQL sentences according to the playback execution result.
8. The device according to claim 7, wherein the use case obtaining module is configured to obtain an audit SQL statement of a database instance of a pre-upgrade version in a cloud database system, and perform desensitization processing on the audit SQL statement.
9. The device according to claim 8, wherein the use case obtaining module is configured to obtain audit SQL statements of all database instances of the pre-upgrade version in the cloud database system, and perform desensitization processing on the audit SQL statements; and deleting the repeated audit SQL statements.
10. The device according to claim 9, wherein the use case obtaining module is configured to perform hash calculation on the audit SQL statement to generate fingerprint information corresponding to the audit SQL statement; and for each different fingerprint information, reserving a corresponding audit SQL statement.
11. The apparatus of claim 7, wherein the test execution module is configured to obtain database instances available for testing in the cloud database system; changing the version of the database instance into an upgraded version; and playing back the audit SQL statement in the database instance of the upgraded version, and acquiring a playback execution result of the audit SQL statement.
12. The device according to claim 7, wherein the result generation module is configured to determine, when the playback execution result is an execution failure, the corresponding audit SQL statement as an incompatible SQL statement.
13. A computing device, wherein the device comprises a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein the computer program instructions, when executed by the processor, trigger the device to perform the method of any of claims 1 to 6.
14. A computer readable medium having stored thereon computer program instructions executable by a processor to implement the method of any one of claims 1 to 6.
CN202010469885.5A 2020-05-28 2020-05-28 Test method, device and computer readable medium for database version upgrade Pending CN113742200A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010469885.5A CN113742200A (en) 2020-05-28 2020-05-28 Test method, device and computer readable medium for database version upgrade

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010469885.5A CN113742200A (en) 2020-05-28 2020-05-28 Test method, device and computer readable medium for database version upgrade

Publications (1)

Publication Number Publication Date
CN113742200A true CN113742200A (en) 2021-12-03

Family

ID=78724282

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010469885.5A Pending CN113742200A (en) 2020-05-28 2020-05-28 Test method, device and computer readable medium for database version upgrade

Country Status (1)

Country Link
CN (1) CN113742200A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860619A (en) * 2022-07-07 2022-08-05 北京安华金和科技有限公司 Database audit program regression testing method and device
CN115114132A (en) * 2022-07-26 2022-09-27 北京安华金和科技有限公司 Performance test method and system for auditing program
WO2024098746A1 (en) * 2022-11-10 2024-05-16 华为云计算技术有限公司 Test method, apparatus, and related device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6581052B1 (en) * 1998-05-14 2003-06-17 Microsoft Corporation Test generator for database management systems
US20140101097A1 (en) * 2012-10-09 2014-04-10 Sap Ag Template based database analyzer
CN105512017A (en) * 2014-09-22 2016-04-20 阿里巴巴集团控股有限公司 Database compatibility detection method and device
CN109271326A (en) * 2018-11-28 2019-01-25 优刻得科技股份有限公司 Test method and its device, the equipment and storage medium of cloud database
CN109726136A (en) * 2019-01-28 2019-05-07 上海达梦数据库有限公司 Test method, device, equipment and the storage medium of database
CN110019327A (en) * 2017-11-28 2019-07-16 北京众享比特科技有限公司 The auditing method of database table in Database Systems based on block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6581052B1 (en) * 1998-05-14 2003-06-17 Microsoft Corporation Test generator for database management systems
US20140101097A1 (en) * 2012-10-09 2014-04-10 Sap Ag Template based database analyzer
CN105512017A (en) * 2014-09-22 2016-04-20 阿里巴巴集团控股有限公司 Database compatibility detection method and device
CN110019327A (en) * 2017-11-28 2019-07-16 北京众享比特科技有限公司 The auditing method of database table in Database Systems based on block chain
CN109271326A (en) * 2018-11-28 2019-01-25 优刻得科技股份有限公司 Test method and its device, the equipment and storage medium of cloud database
CN109726136A (en) * 2019-01-28 2019-05-07 上海达梦数据库有限公司 Test method, device, equipment and the storage medium of database

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘晓辉;李小华;胡占生;陈强朝;傅军;: "HIS服务器及数据库升级前后性能的对比研究", 医疗卫生装备, no. 12 *
李晶媛;韩慧莲;: "一个基于误用检测的数据库安全审计系统", 计算机与数字工程, no. 10 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860619A (en) * 2022-07-07 2022-08-05 北京安华金和科技有限公司 Database audit program regression testing method and device
CN114860619B (en) * 2022-07-07 2022-09-13 北京安华金和科技有限公司 Database audit program regression testing method and device
CN115114132A (en) * 2022-07-26 2022-09-27 北京安华金和科技有限公司 Performance test method and system for auditing program
WO2024098746A1 (en) * 2022-11-10 2024-05-16 华为云计算技术有限公司 Test method, apparatus, and related device

Similar Documents

Publication Publication Date Title
CN110554965B (en) Automated fuzz testing method, related equipment and computer readable storage medium
US10275601B2 (en) Flaw attribution and correlation
CN113742200A (en) Test method, device and computer readable medium for database version upgrade
CN107077413B (en) Data driven test framework
US5960196A (en) Software release metric reporting system and method
CN109271326B (en) Cloud database testing method and device, equipment and storage medium thereof
CN114245892A (en) Data race analysis based on altering function internal loading during time travel debugging
CN115080398A (en) Automatic interface test system and method
CN110990274A (en) Data processing method, device and system for generating test case
CN111241111B (en) Data query method and device, data comparison method and device, medium and equipment
CN116881145B (en) Interface testing method, device, equipment and storage medium based on flow playback
CN110147313B (en) Log output method and device
CN114860619B (en) Database audit program regression testing method and device
CN112241370B (en) API interface class checking method, system and device
CN111414194B (en) Interface information generation method, system, electronic equipment and storage medium
Laurent et al. Re-visiting the coupling between mutants and real faults with Defects4J 2.0
CN113986766A (en) Automatic testing method and device
CN109558153B (en) Method, device and system for determining version consistency
CN112631905A (en) Execution process data management method and device, computer equipment and storage medium
Wu et al. An empirical assessment of the predictive quality of internal product metrics to predict software maintainability in practice
Baek et al. RSX: Reproduction scenario extraction technique for business application workloads in DBMS
CN116594918B (en) Test case change influence analysis method, device, equipment and storage medium
US20240160559A1 (en) Automated decoupling of unit tests
CN117609041A (en) Method and device for testing host program, computer equipment and storage medium
CN116108035A (en) Data recovery method and device, processor and electronic 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