Skip to content

Commit c488f10

Browse files
yahondaclaude
andcommitted
Use Regexp.union to escape dots in JDBC driver jar name matching
Regexp.new(ojdbc_jars.join("|")) treats "." in jar names as a wildcard, so the classpath check could match unintended strings and skip loading the actual driver. Regexp.union properly escapes special characters. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 806a874 commit c488f10

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/plsql/jdbc_connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ojdbc_jars << "ojdbc6.jar" if java_major >= 6
2020
ojdbc_jars << "ojdbc5.jar" if java_major == 5
2121

22-
if ENV_JAVA["java.class.path"] !~ Regexp.new(ojdbc_jars.join("|"))
22+
if ENV_JAVA["java.class.path"] !~ Regexp.union(ojdbc_jars)
2323
# On Unix environment variable should be PATH, on Windows it is sometimes Path
2424
env_path = (ENV["PATH"] || ENV["Path"] || "").split(File::PATH_SEPARATOR)
2525
# Look for JDBC driver at first in lib subdirectory (application specific JDBC file version)

0 commit comments

Comments
 (0)