Skip to content

Commit 504e8e0

Browse files
committed
Minor fix for DriverQuirks get
1 parent fe15ea9 commit 504e8e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/jdbc/DriverQuirks.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ private[sql] object DriverQuirks {
4949
* Fetch the DriverQuirks class corresponding to a given database url.
5050
*/
5151
def get(url: String): DriverQuirks = {
52-
if (url.substring(0, 10).equals("jdbc:mysql")) {
52+
if (url.startsWith("jdbc:mysql")) {
5353
new MySQLQuirks()
54-
} else if (url.substring(0, 15).equals("jdbc:postgresql")) {
54+
} else if (url.startsWith("jdbc:postgresql")) {
5555
new PostgresQuirks()
5656
} else {
5757
new NoQuirks()

0 commit comments

Comments
 (0)