| Bug #118095 | Different results when getting ResultSet Holdability | ||
|---|---|---|---|
| Submitted: | 30 Apr 10:44 | Modified: | 5 May 18:11 |
| Reporter: | 策 吕 | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | Connector / J | Severity: | S2 (Serious) |
| Version: | 9.1.0, 9.3.0 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[2 May 6:51]
MySQL Verification Team
Hello 策 吕, Thank you for the report and feedback. Verified as described. regards, Umesh
[2 May 6:52]
MySQL Verification Team
--
cd /Users/umshastr/Work/Connectors/ConnectorJ/Bug118095; JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.15/libexec/openjdk.jdk/Contents/Home "/Applications/Apache NetBeans.app/Contents/Resources/netbeans/java/maven/bin/mvn" -Dexec.vmArgs= "-Dexec.args=${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}" -Dexec.appArgs= -Dexec.mainClass=Bug118095 -Dexec.executable=/opt/homebrew/Cellar/openjdk@17/17.0.15/libexec/openjdk.jdk/Contents/Home/bin/java --no-transfer-progress process-classes org.codehaus.mojo:exec-maven-plugin:3.1.0:exec
Scanning for projects...
--------------------------< Oracle:Bug118095 >--------------------------
Building Bug118095 1.0-SNAPSHOT
from pom.xml
--------------------------------[ jar ]---------------------------------
--- resources:3.3.1:resources (default-resources) @ Bug118095 ---
skip non existing resourceDirectory /Users/umshastr/Work/Connectors/ConnectorJ/Bug118095/src/main/resources
--- compiler:3.13.0:compile (default-compile) @ Bug118095 ---
Recompiling the module because of changed source code.
Compiling 1 source file with javac [debug release 17] to target/classes
--- exec:3.1.0:exec (default-cli) @ Bug118095 ---
Exception in thread "main" java.sql.SQLFeatureNotSupportedException
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLFeatureNotSupportedException(SQLError.java:225)
at com.mysql.cj.jdbc.result.ResultSetImpl.getHoldability(ResultSetImpl.java:2684)
at Bug118095.main(Bug118095.java:12)
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:1000)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:947)
at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:471)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:569)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 3.797 s
Finished at: 2025-05-02T12:22:12+05:30
[5 May 18:11]
Axyoan Marcelo
Duplicate of Bug#44791

Description: In one of my attempts, I found a serious problem that was producing results as expected on other vendors' database connectors, but triggered an exception on the MYSQL Connector/J. When "System.out.println(rs.getHoldability());" I was expecting result 1, but it actually triggered a MYSQL exception. However, I tested it on other vendor's database connectors(e.g. OceanBase Connector/J) and found no problem, and it successfully returned the result I was expecting: 1. How to repeat: import java.sql.*; public class test { public static void main(String[] args) throws SQLException { String url1 = "jdbc:mysql://localhost:3306/test?user=root&password=1234&allowMultiQueries=true"; String url2 = "jdbc:oceanbase://49.52.27.61:2881/test?user=root@test&password=1234&allowMultiQueries=false"; Connection con = DriverManager.getConnection(url2); Statement stmt = con.createStatement(); // System.out.println(stmt.getResultSetHoldability()); // Actually return 1. ResultSet rs = stmt.executeQuery("SELECT 1;"); System.out.println(rs.getHoldability()); // expect return 1. } }