From 62a706896ae7cd788337128a4cbc95db763ada9d Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Tue, 13 Mar 2018 17:58:54 -0400 Subject: [PATCH] GUACAMOLE-525: Fix up password history delete to be more compatible. --- .../apache/guacamole/auth/jdbc/user/PasswordRecordMapper.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/resources/org/apache/guacamole/auth/jdbc/user/PasswordRecordMapper.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/resources/org/apache/guacamole/auth/jdbc/user/PasswordRecordMapper.xml index 46b6700a6..5b640c299 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/resources/org/apache/guacamole/auth/jdbc/user/PasswordRecordMapper.xml +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-sqlserver/src/main/resources/org/apache/guacamole/auth/jdbc/user/PasswordRecordMapper.xml @@ -65,12 +65,11 @@ ); DELETE FROM [guacamole_user_password_history] - WHERE password_history_id IN ( - SELECT password_history_id + WHERE password_history_id NOT IN ( + SELECT TOP(#{maxHistorySize}) password_history_id FROM [guacamole_user_password_history] WHERE user_id = #{record.userID,jdbcType=INTEGER} ORDER BY password_date DESC - OFFSET #{maxHistorySize} );