List:Commits« Previous MessageNext Message »
From:mmatthews Date:April 9 2007 7:13pm
Subject:Connector/J commit: r6380 - branches/branch_5_0/connector-j/src/com/mysql/jdbc trunk/connector-j/src/com/mysql/jdbc
View as plain text  
Modified:
   branches/branch_5_0/connector-j/src/com/mysql/jdbc/PreparedStatement.java
   trunk/connector-j/src/com/mysql/jdbc/PreparedStatement.java
Log:
- re-work of escaping for fix to 25715 - CallableStatements with OUT/INOUT parameters that
	  are "binary" (blobs, bits, (var)binary, java_object) have extra 7 bytes 
	  (which happens to be the _binary introducer!)

Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/PreparedStatement.java
===================================================================
--- branches/branch_5_0/connector-j/src/com/mysql/jdbc/PreparedStatement.java	2007-04-05
22:09:10 UTC (rev 6379)
+++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/PreparedStatement.java	2007-04-09
17:13:33 UTC (rev 6380)
@@ -3948,17 +3948,17 @@
 
 			int lengthLeftToRead = streamLength - bc;
 
-			if (this.connection.versionMeetsMinimum(4, 1, 0)) {
-				bytesOut.write('_');
-				bytesOut.write('b');
-				bytesOut.write('i');
-				bytesOut.write('n');
-				bytesOut.write('a');
-				bytesOut.write('r');
-				bytesOut.write('y');
-			}
-
 			if (escape) {
+				if (this.connection.versionMeetsMinimum(4, 1, 0)) {
+					bytesOut.write('_');
+					bytesOut.write('b');
+					bytesOut.write('i');
+					bytesOut.write('n');
+					bytesOut.write('a');
+					bytesOut.write('r');
+					bytesOut.write('y');
+				}
+				
 				bytesOut.write('\'');
 			}
 

Modified: trunk/connector-j/src/com/mysql/jdbc/PreparedStatement.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/PreparedStatement.java	2007-04-05 22:09:10 UTC
(rev 6379)
+++ trunk/connector-j/src/com/mysql/jdbc/PreparedStatement.java	2007-04-09 17:13:33 UTC
(rev 6380)
@@ -4106,17 +4106,17 @@
 
 			int lengthLeftToRead = streamLength - bc;
 
-			if (this.connection.versionMeetsMinimum(4, 1, 0)) {
-				bytesOut.write('_');
-				bytesOut.write('b');
-				bytesOut.write('i');
-				bytesOut.write('n');
-				bytesOut.write('a');
-				bytesOut.write('r');
-				bytesOut.write('y');
-			}
-
 			if (escape) {
+				if (this.connection.versionMeetsMinimum(4, 1, 0)) {
+					bytesOut.write('_');
+					bytesOut.write('b');
+					bytesOut.write('i');
+					bytesOut.write('n');
+					bytesOut.write('a');
+					bytesOut.write('r');
+					bytesOut.write('y');
+				}
+				
 				bytesOut.write('\'');
 			}
 
@@ -4155,7 +4155,7 @@
 			}
 		}
 	}
-
+	
 	/**
 	 * Returns this PreparedStatement represented as a string.
 	 * 

Thread
Connector/J commit: r6380 - branches/branch_5_0/connector-j/src/com/mysql/jdbc trunk/connector-j/src/com/mysql/jdbcmmatthews9 Apr