Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Bug fixes

Discussion topic

Back to topic list

Bug fixes


Author Chris Petersen <ChrisPetersen at thesmartgroup dot com dot au>
Full name Chris Petersen <ChrisPetersen at thesmartgroup dot com dot au>
Date 2008-06-12 00:34:26 PDT
Message Hi all,

I have an issue connecting to the repository (either because of our proxy or Windows) so instead am posting a couple of bug fixes here.

The first bug is with the DBMSSQL::applyLimit function. It's doesn't check for SELECT modifiers and as such will generate invalid SQL when a SELECT modifier is present. I have provided a quick and dirty fix for this, I suggest someone should rewrite it but the code I have provided works.

The second bug I found with the same DBMSSQL::applyLimit function but it may appear elsewhere. The DBMSSQL::applyLimit function converts the SQL query into a sub-query to get around Microsoft SQL Server's lack of an OFFSET function. The resulting SQL will fail (ambiguous column name) if two or more tables are joined, have columns with the same name and one or more of those columns is in the ORDER BY statement. To get around this bug, I updated the Criteria class to automatically alias columns when required. I have modified Criteria so that is caches column names, similar to Criteria ::selectColumns except that the table name is removed and the number of times the column name has been used is stored as the value. Criteria::addSelectColumn checks if the column name has been used before and if so adds an alias to the table name. This is a pretty big change to Criteria so you may wish to either ignore my change, suggest another workaround, or call it a "auto-aliasing" feature and milk it for all it's worth.

Chris Petersen

The information in this email is confidential and may be privileged or subject to copyright. It is intended for the exclusive use of the addressee(s). If you are not an addressee, please do not copy, distribute or otherwise act on the email. If you have received the email in error, please contact the sender immediately and delete the email. The unauthorised use of this email may result in liability for breach of confidentiality, privilege or copyright.

« Previous message in topic | 1 of 1 | Next message in topic »


Show all messages in topic

Bug fixes Chris Petersen <ChrisPetersen at thesmartgroup dot com dot au> Chris Petersen <ChrisPetersen at thesmartgroup dot com dot au> 2008-06-12 00:34:26 PDT
Messages per page: