Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27419

Fix nx_md5 function in SQL Server with large principals list

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 9.10
    • Fix Version/s: None
    • Component/s: Core VCS
    • Tags:
    • Backlog priority:
      800
    • Sprint:
      nxFG 11.1.10

      Description

      If nx_md5() is called on a VARCHAR whose size is more than 8000, it will fail with the SQL message

      String or binary data would be truncated.

      It is due to the hashbytes function.

      A possible solution is to replace hashbytes by a function from the SQLCLR library: SQL#.Util_Hash
      The md5HashString variable in sqlserver.sql.txt would be rewritten with

      SUBSTRING(CONVERT(VARCHAR(34), SQL#.Util_Hash('MD5', CONVERT(VARBINARY(MAX), @string), 1), 3, 32)
      

      Problem: how to detect that the SQLCLR library is installed in SQL Server?
      Workaround: manually add this function if SQLCLR is not installed?

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h