Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-880

bug with sql query for postgresql jdbc driver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.3.1
    • 3.0-M1
    • None
    • None
    • Debian Etch. Java 1.6.0_10, 32bit.

    Description

      It's BLOCKER when someone needs to get server for Virtual Users (virtual mail accounts like in tutorial here: http://wiki.apache.org/james/VirtualUserTable )

      Problem:

      in file: JDBCVirtualUserTable.java
      line: 150

      should be:

      query = getInitParameter("sqlquery","select VirtualUserTable.target_address from VirtualUserTable, VirtualUserTable as VUTDomains where (VirtualUserTable.user like ? or VirtualUserTable.user like '\\\\%') and (VirtualUserTable.domain like ? or (VirtualUserTable.domain like '\\\\%' and VUTDomains.domain like ?)) order by concat(VirtualUserTable.user,'@',VirtualUserTable.domain) desc limit 1");

      instead of:

      query = getInitParameter("sqlquery","select VirtualUserTable.target_address from VirtualUserTable, VirtualUserTable as VUTDomains where (VirtualUserTable.user like ? or VirtualUserTable.user like '
      %') and (VirtualUserTable.domain like ? or (VirtualUserTable.domain like '
      %' and VUTDomains.domain like ?)) order by concat(VirtualUserTable.user,'@',VirtualUserTable.domain) desc limit 1");

      So.. there should be doubled
      cause postgresql on select did not select wanted row correctly with default ".. LIKE '%' .." and there should be ".. LIKE '
      %' .. " statement in query.
      After adding this fix it works perfectly.

      Attachments

        Activity

          People

            eric@apache.org Eric Charles
            dmilith Daniel Dettlaff
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 20m
                20m
                Remaining:
                Remaining Estimate - 20m
                20m
                Logged:
                Time Spent - Not Specified
                Not Specified