From 23084625ab7d82ecd73197ff9078f4c822af62e3 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 25 Nov 2017 21:54:41 -0800 Subject: [PATCH] GUACAMOLE-363: Do not take behind-the-scenes trigger operations into account when calculating the row counts for a query. --- .../schema/001-create-schema.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/schema/001-create-schema.sql b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/schema/001-create-schema.sql index be955ac47..da63f609c 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/schema/001-create-schema.sql +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/schema/001-create-schema.sql @@ -559,6 +559,9 @@ CREATE TRIGGER [guacamole_delete_user] INSTEAD OF DELETE AS BEGIN + -- Do not take trigger into account when producing row counts for the DELETE + SET NOCOUNT ON; + -- Delete all associated permissions not covered by ON DELETE CASCADE DELETE FROM [guacamole_user_permission] WHERE @@ -583,6 +586,9 @@ CREATE TRIGGER [guacamole_delete_connection] INSTEAD OF DELETE AS BEGIN + -- Do not take trigger into account when producing row counts for the DELETE + SET NOCOUNT ON; + -- Delete associated sharing profiles DELETE FROM [guacamole_sharing_profile] WHERE [primary_connection_id] IN (SELECT [connection_id] FROM DELETED); @@ -605,6 +611,9 @@ CREATE TRIGGER [guacamole_delete_connection_group] INSTEAD OF DELETE AS BEGIN + -- Do not take trigger into account when producing row counts for the DELETE + SET NOCOUNT ON; + -- Delete all requested connection groups, including descendants WITH [connection_groups] ([connection_group_id]) AS ( SELECT [connection_group_id] FROM DELETED @@ -637,6 +646,9 @@ CREATE TRIGGER [guacamole_delete_sharing_profile] INSTEAD OF DELETE AS BEGIN + -- Do not take trigger into account when producing row counts for the DELETE + SET NOCOUNT ON; + -- Delete all associated permissions not covered by ON DELETE CASCADE UPDATE [guacamole_connection_history] SET [sharing_profile_id] = NULL