GUACAMOLE-525: Remove LIMIT and use TOP in SQL Server module.

This commit is contained in:
Nick Couchman
2018-03-13 17:47:35 -04:00
parent b8a5f0bd22
commit cb580c4ae9
2 changed files with 3 additions and 8 deletions

View File

@@ -34,7 +34,7 @@
<!-- Select all password records for a given user -->
<select id="select" resultMap="PasswordRecordResultMap">
SELECT
SELECT TOP (#{maxHistorySize,jdbcType=INTEGER})
[guacamole_user_password_history].user_id,
[guacamole_user_password_history].password_hash,
[guacamole_user_password_history].password_salt,
@@ -45,7 +45,6 @@
[guacamole_user].username = #{username,jdbcType=VARCHAR}
ORDER BY
[guacamole_user_password_history].password_date DESC
LIMIT #{maxHistorySize}
</select>

View File

@@ -89,7 +89,7 @@
<!-- Search for specific user records -->
<select id="search" resultMap="UserRecordResultMap">
SELECT
SELECT TOP (#{limit,jdbcType=INTEGER})
[guacamole_user_history].remote_host,
[guacamole_user_history].user_id,
[guacamole_user_history].username,
@@ -128,14 +128,12 @@
<if test="sortPredicate.descending">DESC</if>
</foreach>
LIMIT #{limit,jdbcType=INTEGER}
</select>
<!-- Search for specific user records -->
<select id="searchReadable" resultMap="UserRecordResultMap">
SELECT
SELECT TOP (#{limit,jdbcType=INTEGER})
[guacamole_user_history].remote_host,
[guacamole_user_history].user_id,
[guacamole_user_history].username,
@@ -180,8 +178,6 @@
<if test="sortPredicate.descending">DESC</if>
</foreach>
LIMIT #{limit,jdbcType=INTEGER}
</select>
</mapper>