Automatic detection of queries missing order-by via unit test
First Claim
Patent Images
1. A non-transitory computer-readable storage medium including program code that, when executed by at least one programmable processor, causes the at least one programmable processor to perform operations comprising:
- intercepting, as part of testing of an application, a query sent by the application to a database, the database comprising a database management system that makes default sort order guarantees;
modifying the query by at least defining the query to return a plurality of results, the modified query enabling detection of whether the query causes an order by error at the application, the order by error representing an error at the application caused by at least the query not including an order by instruction and caused based on at least whether the plurality of results provided by the database to the application are out of order;
sending the modified query to the database;
intercepting a query result provided by the database in response to the modified query, the modified query including the plurality of results;
modifying, in response to the modified query not including the order by instruction, the intercepted query result by at least re-ordering the plurality of results;
sending the re-ordered plurality of results to the application to enable the determination of whether the re-ordered plurality of results cause the order by error at the application; and
detecting the query causes the order by error at the application, in response to the re-ordered plurality of results causing the error at the application.
1 Assignment
0 Petitions
Accused Products
Abstract
In one aspect, there is provided a method. The method may intercepting a result provided by a database in response to a query; modifying the intercepted result to enable detection of an order by problem; and detecting, based on the modified intercepted result, whether the query is missing an order by clause. Related systems, methods, and articles of manufacture are also disclosed.
-
Citations
20 Claims
-
1. A non-transitory computer-readable storage medium including program code that, when executed by at least one programmable processor, causes the at least one programmable processor to perform operations comprising:
-
intercepting, as part of testing of an application, a query sent by the application to a database, the database comprising a database management system that makes default sort order guarantees; modifying the query by at least defining the query to return a plurality of results, the modified query enabling detection of whether the query causes an order by error at the application, the order by error representing an error at the application caused by at least the query not including an order by instruction and caused based on at least whether the plurality of results provided by the database to the application are out of order; sending the modified query to the database; intercepting a query result provided by the database in response to the modified query, the modified query including the plurality of results; modifying, in response to the modified query not including the order by instruction, the intercepted query result by at least re-ordering the plurality of results; sending the re-ordered plurality of results to the application to enable the determination of whether the re-ordered plurality of results cause the order by error at the application; and detecting the query causes the order by error at the application, in response to the re-ordered plurality of results causing the error at the application. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method comprising:
-
intercepting, as part of testing of an application, a query sent by the application to a database, the database comprising a database management system that makes default sort order guarantees; modifying the query by at least defining the query to return a plurality of results, the modified query enabling detection of whether the query causes an order by error at the application, the order by error representing an error at the application caused by at least the query not including an order by instruction and caused based on at least whether the plurality of results provided by the database to the application are out of order; sending the modified query to the database; intercepting a query result provided by the database in response to the modified query, the modified query including the plurality of results; modifying, in response to the modified query not including the order by instruction, the intercepted query result by at least re-ordering the plurality of results; sending the re-ordered plurality of results to the application to enable the determination of whether the re-ordered plurality of results cause the order by error at the application; and detecting the query causes the order by error at the application, in response to the re-ordered plurality of results causing the error at the application. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A system comprising:
-
at least one physical processor; and at least one memory including program code which when executed by the at least one processor causes operations comprising; intercepting, as part of testing of an application, a query sent by the application to a database, the database comprising a database management system that makes default sort order guarantees; modifying the query by at least defining the query to return a plurality of results, the modified query enabling detection of whether the query causes an order by error at the application, the order by error representing an error at the application caused by at least the query not including an order by instruction and caused based on at least whether the plurality of results provided by the database to the application are out of order; sending the modified query to the database; intercepting a query result provided by the database in response to the modified query, the modified query including the plurality of results; modifying, in response to the modified query not including the order by instruction, the intercepted query result by at least re-ordering the plurality of results; sending the re-ordered plurality of results to the application to enable the determination of whether the re-ordered plurality of results cause the order by error at the application; and detecting the query causes the order by error at the application, in response to the re-ordered plurality of results causing the error at the application. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification