mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Fixed rdbms delete test
This commit is contained in:
@ -262,12 +262,15 @@ public class RDBMSDeleteActionTest extends RDBMSActionTest
|
|||||||
|
|
||||||
DeleteOutput deleteResult = new RDBMSDeleteAction().execute(deleteInput);
|
DeleteOutput deleteResult = new RDBMSDeleteAction().execute(deleteInput);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// assert that 7 queries ran - the initial delete (which failed), then 1 to look up the ids from that query, and finally 5 deletes by id //
|
// assert that 8 queries ran - the initial delete (which failed), then 1 to look up the ids //
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
// from that query, another to try to delete all those ids (also fails), and finally 5 deletes by id //
|
||||||
|
// todo - maybe we shouldn't do that 2nd "try to delete 'em all by id"... why would it ever work, //
|
||||||
|
// but the original filter query didn't (other than malformed SQL)? //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
QueryManager.setCollectStatistics(false);
|
QueryManager.setCollectStatistics(false);
|
||||||
Map<String, Integer> queryStats = QueryManager.getStatistics();
|
Map<String, Integer> queryStats = QueryManager.getStatistics();
|
||||||
assertEquals(7, queryStats.get(QueryManager.STAT_QUERIES_RAN), "Number of queries ran");
|
assertEquals(8, queryStats.get(QueryManager.STAT_QUERIES_RAN), "Number of queries ran");
|
||||||
|
|
||||||
assertEquals(2, deleteResult.getRecordsWithErrors().size(), "Should get back the 2 records with errors");
|
assertEquals(2, deleteResult.getRecordsWithErrors().size(), "Should get back the 2 records with errors");
|
||||||
assertTrue(deleteResult.getRecordsWithErrors().stream().noneMatch(r -> r.getErrors().isEmpty()), "All we got back should have errors");
|
assertTrue(deleteResult.getRecordsWithErrors().stream().noneMatch(r -> r.getErrors().isEmpty()), "All we got back should have errors");
|
||||||
|
@ -19,7 +19,9 @@
|
|||||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
--
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS parent_table;
|
||||||
DROP TABLE IF EXISTS child_table;
|
DROP TABLE IF EXISTS child_table;
|
||||||
|
|
||||||
CREATE TABLE child_table
|
CREATE TABLE child_table
|
||||||
(
|
(
|
||||||
id INT AUTO_INCREMENT primary key,
|
id INT AUTO_INCREMENT primary key,
|
||||||
@ -32,7 +34,6 @@ INSERT INTO child_table (id, name) VALUES (3, 'Johnny');
|
|||||||
INSERT INTO child_table (id, name) VALUES (4, 'Gracie');
|
INSERT INTO child_table (id, name) VALUES (4, 'Gracie');
|
||||||
INSERT INTO child_table (id, name) VALUES (5, 'Suzie');
|
INSERT INTO child_table (id, name) VALUES (5, 'Suzie');
|
||||||
|
|
||||||
DROP TABLE IF EXISTS parent_table;
|
|
||||||
CREATE TABLE parent_table
|
CREATE TABLE parent_table
|
||||||
(
|
(
|
||||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
Reference in New Issue
Block a user