| Summary: | [DB] Oracle SQL doesn't allow "AS" keyword for table alias | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Eike Stepper <stepper> | ||||
| Component: | cdo.db | Assignee: | Eike Stepper <stepper> | ||||
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | dzonekl | ||||
| Version: | 4.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Eike Stepper
commit dba1cf4ec4f47020d1354297b57ba2617729790c Opps, crash recovery was broken in H2. commit b5dea0f67edbe7132dfa65081747f9d08b71ec5a Offline replication throws SQLException. Forgot to surround table aliases with double quotes in two places... commit 07222369448a147404dee6321c4f01dc484b4762 Reopening to remove the double quotes around alias names because they don't seem to be necessary for Oracle (according to users) but harm when using Mysql... commit 224519d27971545c15ad050aa8a1aee382e3c00b I think you forgot one, With quotes, I get the exception below, undoing commit, will help, but the AS keyword could be a conflict between DB vendors. dba1cf4ec4f47020d1354297b57ba2617729790c DBException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.cdo_source, "l_t".cdo_value, "l_t".cdo_idx FROM library_Equipment_metricRefs_li' at line 1 at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractListTableMapping.queryXRefs(AbstractListTableMapping.java:449) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.queryXRefs(AbstractHorizontalClassMapping.java:812) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalMappingStrategy.queryXRefs(AbstractHorizontalMappingStrategy.java:155) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalMappingStrategy.queryXRefs(HorizontalMappingStrategy.java:189) at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.queryXRefs(DBStoreAccessor.java:309) at org.eclipse.emf.cdo.internal.server.XRefsQueryHandler.executeQuery(XRefsQueryHandler.java:66) at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:294) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.cdo_source, "l_t".cdo_value, "l_t".cdo_idx FROM library_Equipment_metricRefs_li' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1557) at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractListTableMapping.queryXRefs(AbstractListTableMapping.java:421) ... 12 more at org.eclipse.net4j.signal.RemoteExceptionIndication.indicating(RemoteExceptionIndication.java:60) at org.eclipse.net4j.signal.Indication.doExtendedInput(Indication.java:57) at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328) at org.eclipse.net4j.signal.Indication.execute(Indication.java:51) at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253) at org.eclipse.net4j.signal.Signal.run(Signal.java:149) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) this is the full query: SELECT "l_t".cdo_source, "l_t".cdo_value, "l_t".cdo_idx FROM library_Equipment_metricRefs_list "l_t", library_Equipment "a_t" WHERE "a_t".cdo_revised=0 AND "a_t".cdo_id="l_t".cdo_source AND cdo_value IN (209) I've got no clue how you can get that. The code looks like this:
StringBuilder builder = new StringBuilder();
builder.append("SELECT l_t."); //$NON-NLS-1$
There are no double quotes anymore. The whole cdo.server.db contains no double quote literals anymore (except some HTML rendering in DBBrowserPage).
Created attachment 223652 [details]
queryXRefs for 4.2 patch
OK, this is because, I haven't update the plugin in my workspace, which I checked-out two days ago, apologies for that. You, one lesson here, is the product had shipped with the plugin before this patch, so the customer reported the problem, and I resolved it around a checked-out plugin which is the same as the customer. It just happens this fixed was committed in between, and before fixing it, I should really have done a git pull first. Available in R20130613-1157 (4.2) |