diff --git a/src/main/java/org/mariadb/jdbc/MariaDbClientPreparedStatement.java b/src/main/java/org/mariadb/jdbc/MariaDbClientPreparedStatement.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/mariadb/jdbc/MariaDbClientPreparedStatement.java
+++ b/src/main/java/org/mariadb/jdbc/MariaDbClientPreparedStatement.java
@@ -612,7 +612,7 @@ public class MariaDbClientPreparedStatement extends AbstractMariaDbPrepareStatem
                         isFirstChar = false;
                     }
                     //multiple queries
-                    if (state == LexState.Normal && semicolon && ((byte) lastChar >= 40)) reWritablePrepare = false;
+                    if (state == LexState.Normal && semicolon && ((byte) car >= 40)) reWritablePrepare = false;
                     break;
             }
[CONJ-<I>] MariaDbClientPreparedStatement : correction for semicolon with additional characters