Query loses dbtype="query", runs against default datasource

Description

this one is really strange

image-20240721-063529.png

 

q_native = QueryExecute( sql = "SELECT id, name FROM q ORDER BY name", options = { dbtype: 'query' } );

https://github.com/lucee/lucee-testlab/blob/main/custom/benchmark/tests/qoq-hsqldb.cfm#L13

threw the following stacktrace? why is the error coming from the mysql driver?

6.1.1.50-SNAPSHOT / java 21

https://github.com/lucee/lucee-testlab/actions/runs/10023940317/job/27705399282

[java] [script] "}],"ErrorCode":"0","NativeErrorCode":1146,"type":"database","DataSource":"__default__","StackTrace":"lucee.runtime.exp.DatabaseException: Table 'lucee.q' doesn't exist [java] [script] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:112) [java] [script] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:114) [java] [script] at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:875) [java] [script] at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:723) [java] [script] at lucee.runtime.type.util.QueryUtil.execute(QueryUtil.java:345) [java] [script] at lucee.runtime.type.QueryImpl.execute(QueryImpl.java:296) [java] [script] at lucee.runtime.type.QueryImpl.<init>(QueryImpl.java:242) [java] [script] at lucee.runtime.tag.Query.executeDatasoure(Query.java:1128) [java] [script] at lucee.runtime.tag.Query._doEndTag(Query.java:695) [java] [script] at lucee.runtime.tag.Query.doEndTag(Query.java:560) [java] [script] at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:86) [java] [script] at tests.qoq_hsqldb_cfm180$cf.call(/tests/qoq-hsqldb.cfm:13)

but there is a truncated class file error generated during that run as well, same cfml stack?

[java] [script] "ERROR","pool-9-thread-16","07/20/2024","23:57:35","","Truncated class file;Truncated class file;Truncated class file;lucee.runtime.exp.NativeException: Truncated class file [java] [script] at java.base/java.lang.ClassLoader.defineClass1(Native Method) [java] [script] at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) [java] [script] at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:889) [java] [script] at lucee.transformer.dynamic.DynamicClassLoader._loadClass(DynamicClassLoader.java:209) [java] [script] at lucee.transformer.dynamic.DynamicClassLoader.findClass(DynamicClassLoader.java:156) [java] [script] at lucee.transformer.dynamic.DynamicClassLoader.loadClass(DynamicClassLoader.java:131) [java] [script] at lucee.transformer.dynamic.DynamicClassLoader.loadClass(DynamicClassLoader.java:117) [java] [script] at lucee.transformer.dynamic.DynamicClassLoader.loadInstance(DynamicClassLoader.java:107) [java] [script] at lucee.transformer.dynamic.DynamicInvoker.createInstance(DynamicInvoker.java:187) [java] [script] at lucee.runtime.reflection.pairs.MethodInstance.getResult(MethodInstance.java:119) [java] [script] at lucee.runtime.reflection.pairs.MethodInstance.getMethod(MethodInstance.java:99) [java] [script] at lucee.runtime.reflection.Reflector.getSetter(Reflector.java:1110) [java] [script] at lucee.runtime.tag.TagUtil.setAttribute(TagUtil.java:179) [java] [script] at lucee.runtime.tag.TagUtil.setAttributes(TagUtil.java:161) [java] [script] at lucee.runtime.tag.TagUtil.setAttributeCollection(TagUtil.java:142) [java] [script] at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:64) [java] [script] at tests.qoq_hsqldb_cfm180$cf.call(/tests/qoq-hsqldb.cfm:13)

Environment

None

Attachments

2
  • 21 Jul 2024, 08:45 am
  • 21 Jul 2024, 06:35 am

Activity

Show:

Zac Spitzer 25 October 2024 at 10:19

still happening with 6.1.1.106

stepping thru this with a debugger, the dbtype is being somehow lost during

TagUtil.setAttributeCollection(pc, qry, null, options, TagLibTag.ATTRIBUTE_TYPE_FIXED);

https://github.com/lucee/Lucee/blob/6.1/core/src/main/java/lucee/runtime/functions/query/QueryExecute.java#L64

Zac Spitzer 13 August 2024 at 07:08

i’ve run my tests and can’t reproduce, so I’ll close this

Michael Offner 9 August 2024 at 16:06

i was not really able to find any issue, atm my best guess is that the pool does give out the same tag twice what is causing this.

So i did tighten up the pool.

Michael Offner 9 August 2024 at 14:33
Edited

looks like a multi threading issue, for some reason 2 threads get the same tag object, so problem most likely is with the tag pool. i don’t think this is a regression.

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 21 July 2024 at 06:05
Updated 12 November 2024 at 11:09
Resolved 13 August 2024 at 07:08

Flag notifications