Issue Details (XML | Word | Printable)

Key: DERBY-2243
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Saurabh Vyas
Reporter: Daniel John Debrunner
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

DatabaseMetaData.supportsANSI92EntryLevelSQL() returns false for embedded, true for client driver

Created: 15/Jan/07 06:39 PM   Updated: 07/Feb/07 10:57 AM
Return to search
Component/s: JDBC
Affects Version/s: 10.2.1.6, 10.2.2.0, 10.3.1.4
Fix Version/s: 10.3.1.4

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works Derby-2243_v1.diff 2007-01-19 06:17 PM Saurabh Vyas 6 kB
File Licensed for inclusion in ASF works Derby-2243_v1.stat 2007-01-19 06:17 PM Saurabh Vyas 0.6 kB
File Licensed for inclusion in ASF works Derby-2243_v2.diff 2007-01-20 05:18 AM Saurabh Vyas 8 kB
File Licensed for inclusion in ASF works Derby-2243_v2.stat 2007-01-20 05:18 AM Saurabh Vyas 0.7 kB
Issue Links:
Reference
 

Resolution Date: 07/Feb/07 04:00 AM


 Description  « Hide
Since this method is returning the support level of SQL it must be consistent across the drivers.
Probably need some investigation as to which is correct, most likely 'true'.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Saurabh Vyas added a comment - 19/Jan/07 06:12 PM
I looked into the code and found that DatabaseMetaData.supportsANSI92EntryLevelSQL() is implements in different way in Embedded and Network-Client mode.
In embedded mode EmbedDatabaseMetaData implements DatabaseMetaData & it returns false for various functions including supportsANSI92EntryLevelSQL() which is incorrect. Whereas for network mode, NetDatabaseMetaData implements DatabaseMetaData & it returns true for supportsANSI92EntryLevelSQL().

I crossed check it with MySql code & found that it also return true (which is expected ) for supportsANSI92EntryLevelSQL().
Same is the case with DERBY-2244 (https://issues.apache.org/jira/browse/DERBY-2244) & it returns false for supportsExpressionsInOrderBy() which is incorrect as derby does supports Order By Clause.

Saurabh Vyas added a comment - 19/Jan/07 06:24 PM
Modifying the return type for methods like
- supportsANSI92EntryLevelSQL()
- supportsExpressionsInOrderBy()
  in EmbedDatabaseMetaData.java to return TRUE as Derby does support these features
Thus now the behavior is consistent across drivers.

This patch address DERBY-2244 (https://issues.apache.org/jira/browse/DERBY-2244) also.

Accordingly modified the master output files also as earlier these methods were expected to return FALSE but now they will return TRUE value.

Daniel John Debrunner added a comment - 19/Jan/07 06:33 PM
MySQL's return value should have no impact on Derby, it's if Derby supports these features only.

Also, please be careful looking at MySQL code, bringing MySQL GPL code into Derby's codebase would not be acceptable.

Obviously in this case a return true/false is not an issue, but demonstrated access to a piece of work is enough for copyright infringements.

E.g. if someone says I looked at MySQL code to see how X was done and then implemented the same functionality in Derby in a similar manner that could be enough to pollute the Derby code base with GPL.

Saurabh Vyas added a comment - 19/Jan/07 06:57 PM
My apologies on this and thanks Dan for correcting me. Well what I was trying to see that how other Databases handled this scenario, but I was not sure of this licensing issue. Thanks again.

Daniel John Debrunner added a comment - 19/Jan/07 07:45 PM
Patch looks fine though I personally don't like the habit of just commenting out the old code. If that practice is followed then after a while the code becomes unreadable. SVN history provides the ability to see old code.

Also I think you need to modifiy jdbcapi.DatabaseMetaDataTest, since it is checking the output of these methods.

Saurabh Vyas added a comment - 20/Jan/07 05:23 AM
Thanks Dan for your comments and guiding me for best practices (i.e. removing the old code rather than just commenting it)
Incorporated the changes & modified jdbcapi.DatabaseMetaDataTest to reflect the changes (i.e. TRUE as return value for these methods).

Daniel John Debrunner added a comment - 22/Jan/07 06:16 PM
Patch Derby-2243_v2.diff committed revision 498732 - Thanks Saurabh Vyas.

BTW - I see that you do not have an ICLA on file at Apache, if you are intending to work more on Derby I would encourage you to submit an ICLA ahead of time rather than waiting for a significant contribution.

Saurabh Vyas added a comment - 29/Jan/07 12:29 PM
Thanks a lot Dan. I had files for ICLA now.
Apart I had verified for this issue & Derby-2244, and now these methods returned the correct values.

Saurabh Vyas added a comment - 07/Feb/07 10:57 AM
Thanks alot for modifying the assert condition in DatabaseMetaDataTest.java (Just looked at the comments in the test code for DERBY-2243 & DERBY-2244.)