Torque
  1. Torque
  2. TORQUE-25

LimitHelper.java doesn't handle Sybase DBMS

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3
    • Component/s: Runtime
    • Labels:
      None
    • Environment:
      All

      Description

      > I've noticed that the DB.java class contains the constant to define
      > limits (Criteria.setLimit() etc) for the Sybase database
      > (LIMIT_STYLE_SYBASE). However the LimitHelper.java class doesn't make
      > use of it (excerpt from the buidLimit method):
      >
      >
      >
      > ...
      >
      > if (offset > 0 || limit > 0)
      > {
      > // If we hit a database type, that is able to do native
      > // limiting, we must set the criteria values to -1 and 0
      > // afterwards. Reason is, that else theexecuteQuery
      > // method tries to do the limiting using Village
      > //
      >
      > switch (db.getLimitStyle())
      > {
      > case DB.LIMIT_STYLE_MYSQL :
      > LimitHelper.generateMySQLLimits(query, offset, limit);
      > break;
      >
      > case DB.LIMIT_STYLE_POSTGRES :
      > LimitHelper.generatePostgreSQLLimits(query, offset, limit);
      > break;
      >
      > case DB.LIMIT_STYLE_ORACLE :
      > LimitHelper.generateOracleLimits(query, offset, limit);
      > break;
      >
      > case DB.LIMIT_STYLE_DB2 :
      > LimitHelper.generateDB2Limits(query, offset, limit);
      > break;
      >
      > default:
      > if (db.supportsNativeLimit())
      >

      { > query.setLimit(String.valueOf(limit)); > }

      > break;
      > }
      >
      > ...
      >
      >
      >
      > You notice that there is no case for Sybase (DB.LIMIT_STYLE_SYBASE).

        Activity

        Thomas Vandahl made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Thomas Fox made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Thomas Fischer [ tfischer ]
        Resolution Fixed [ 1 ]
        Martin Goulet made changes -
        Field Original Value New Value
        Attachment torque-25.patch.txt [ 12334867 ]
        Hide
        Martin Goulet added a comment -

        This is the patch to fix this issue.

        Show
        Martin Goulet added a comment - This is the patch to fix this issue.
        Martin Goulet created issue -

          People

          • Assignee:
            Thomas Fox
            Reporter:
            Martin Goulet
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development