Unknown system variable 'query_cache_size'

Has anyone seen the error below. I’m using the latest MySQL JDBC driver (8.0.19) on Lucee 5.3.7. I don’t actually know the MySQL version as I’m implementing a CFML benchmark for TechEmpower Framework Benchmarks and their test harnless just installs the latest from apt which I assume is whatever the latest available is.

There is only one ticket in the Lucee bug tracker that mentions this error message and it shows as being resolved 4 versions ago in the JDBC driver.

 lucee.runtime.exp.DatabaseException: Unknown system variable 'query_cache_size'
     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878)
     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)
     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2478)
     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2625)
     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2547)
     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2505)
     at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1370)
     at com.mysql.jdbc.ConnectionImpl.loadServerVariables(ConnectionImpl.java:3862)
     at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3290)
     at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2299)
     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2085)
     at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795)
     at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
     at sun.reflect.GeneratedConstructorAccessor30.newInstance(Unknown Source)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
     at java.lang.reflect.Constructor.newInstance(Unknown Source)
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)
     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327)
     at lucee.runtime.db.DataSourceSupport._getConnection(DataSourceSupport.java:117)
     at lucee.runtime.db.DataSourceSupport.getConnection(DataSourceSupport.java:97)
     at lucee.runtime.db.DatasourceConnectionPool.loadDatasourceConnection(DatasourceConnectionPool.java:155)
     at lucee.runtime.db.DatasourceConnectionPool.getDatasourceConnection(DatasourceConnectionPool.java:116)
     at lucee.runtime.db.DatasourceManagerImpl.getConnection(DatasourceManagerImpl.java:81)
     at lucee.runtime.tag.Query.executeDatasoure(Query.java:1095)
     at lucee.runtime.tag.Query._doEndTag(Query.java:686)
     at lucee.runtime.tag.Query.doEndTag(Query.java:553)
     at db_cfm$cf.call(/db.cfm:9)

Looks like its deprecated in 8. MySQL :: MySQL 5.7 Reference Manual :: 8.10.3 The MySQL Query Cache

Yes, but that doesn’t tell me why Lucee is throwing the error nor how to fix it. I’m using the latest JDBC driver as I stated in my OP.

8.0.23 is the latest driver, lucee uses 8.0.19?

It would appear so. Nonetheless, the JDBC version Lucee ships is supposed to be new enough to not have this issue.

yeah, nothing in the releases notes since 8.0.19 about that…

https://luceeserver.atlassian.net/browse/LDEV-3245

Is this related to:

"Severity","ThreadID","Date","Time","Application","Message"
"Severity","ThreadID","Date","Time","Application","Message"
"ERROR","ajp-nio-127.0.0.1-8009-exec-5","07/07/2021","08:45:25","controller","Out of sort memory, consider increasing server sort buffer size;Out of sort memory, consider increasing server sort buffer size;lucee.runtime.exp.CustomTypeException: Out of sort memory, consider increasing server sort buffer size
	at lucee.runtime.tag.Throw._doStartTag(Throw.java:212)
	at lucee.runtime.tag.Throw.doStartTag(Throw.java:201)
	at fbx_fusebox30_cf50_nix_cfm$cf.call(/fbx_fusebox30_CF50_nix.cfm:247)
	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1031)
	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:923)
	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:904)
	at index_cfm$cf.call(/index.cfm:25)
	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1031)
	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:923)
	at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:65)
	at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:45)
	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2457)
	at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2447)
	at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2418)
	at lucee.runtime.engine.Request.exe(Request.java:44)
	at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1179)
	at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1125)
	at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
	at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)

Stack:
Apache 2.4.41
Apache Tomcat/9.0.41
Open JDK 16.01
Lucee 5.3.8.189
MySQL 8.0.25
MySQL Lucee Driver 8.0.24

I think that error is now possibly being thrown due to [LDEV-3127] When using the MSSQL driver exceptions are ignored - Lucee ?

I think 8.0.19 uses com.mysql.cj.xxx classes. I wonder if something is loading an older jar? Can you get the meta version info from the driver?

Here is just a few suggestions: These are NOT programmer suggestions, See @Zackster for any programming GURUISM

Reinstall Lucee: If you upgraded something may have gone wonky, and as with above you are pulling an old context file for a java connector. My guess based upon Apache version is Ubuntu. That is just a guess, but I would do an apt-updae / apt remove, apt-autoclean, stop all services, then make sure your old lucee install path is empty, then reinstall, copy your config file over or manually recreate it, apt update and then start the services and see if you still have the error. Remember, UNIX boxes run old processes until the process is killed. You could be running an old process on something and not know it.

Switch to mariadb, which is developed by the developers who started mysql, even the latest versions allow for query-cache-size to be enabled.