=== modified file 'src/com/mysql/jdbc/MysqlIO.java' --- src/com/mysql/jdbc/MysqlIO.java 2010-03-04 18:47:23 +0000 +++ src/com/mysql/jdbc/MysqlIO.java 2010-07-01 14:02:41 +0000 @@ -1152,18 +1152,22 @@ } } - if (versionMeetsMinimum(4, 0, 8)) { + //We do not support MySQL server < 4.1.0 so this is obsolete + //if (versionMeetsMinimum(4, 0, 8)) { this.maxThreeBytes = (256 * 256 * 256) - 1; this.useNewLargePackets = true; - } else { - this.maxThreeBytes = 255 * 255 * 255; - this.useNewLargePackets = false; - } - - this.colDecimalNeedsBump = versionMeetsMinimum(3, 23, 0); - this.colDecimalNeedsBump = !versionMeetsMinimum(3, 23, 15); // guess? Not noted in changelog - this.useNewUpdateCounts = versionMeetsMinimum(3, 22, 5); - +// } else { +// this.maxThreeBytes = 255 * 255 * 255; +// this.useNewLargePackets = false; +// } + + //We do not support MySQL server < 4.1.0 so this is obsolete +// this.colDecimalNeedsBump = versionMeetsMinimum(3, 23, 0); +// this.colDecimalNeedsBump = !versionMeetsMinimum(3, 23, 15); // guess? Not noted in changelog +// this.useNewUpdateCounts = versionMeetsMinimum(3, 22, 5); + this.colDecimalNeedsBump = true; + this.useNewUpdateCounts = true; + threadId = buf.readLong(); this.seed = buf.readString("ASCII", getExceptionInterceptor()); @@ -1173,7 +1177,7 @@ this.serverCapabilities = buf.readInt(); } - if (versionMeetsMinimum(4, 1, 1)) { + if ((versionMeetsMinimum(4, 1, 1) || ((this.protocolVersion > 9) && (this.serverCapabilities & CLIENT_PROTOCOL_41) != 0))) { int position = buf.getPosition(); /* New protocol with 16 bytes to describe server characteristics */ @@ -1243,8 +1247,8 @@ // // 4.1 has some differences in the protocol // - if (versionMeetsMinimum(4, 1, 0)) { - if (versionMeetsMinimum(4, 1, 1)) { + if ((versionMeetsMinimum(4, 1, 0) || ((this.protocolVersion > 9) && (this.serverCapabilities & CLIENT_RESERVED) != 0))) { + if ((versionMeetsMinimum(4, 1, 1) || ((this.protocolVersion > 9) && (this.serverCapabilities & CLIENT_PROTOCOL_41) != 0))) { this.clientParam |= CLIENT_PROTOCOL_41; this.has41NewNewProt = true; @@ -1280,7 +1284,7 @@ if ((this.serverCapabilities & CLIENT_SECURE_CONNECTION) != 0) { this.clientParam |= CLIENT_SECURE_CONNECTION; - if (versionMeetsMinimum(4, 1, 1)) { + if ((versionMeetsMinimum(4, 1, 1) || ((this.protocolVersion > 9) && (this.serverCapabilities & CLIENT_PROTOCOL_41) != 0))) { secureAuth411(null, packLength, user, password, database, true); } else { @@ -1291,7 +1295,7 @@ packet = new Buffer(packLength); if ((this.clientParam & CLIENT_RESERVED) != 0) { - if (versionMeetsMinimum(4, 1, 1)) { + if ((versionMeetsMinimum(4, 1, 1) || ((this.protocolVersion > 9) && (this.serverCapabilities & CLIENT_PROTOCOL_41) != 0))) { packet.writeLong(this.clientParam); packet.writeLong(this.maxThreeBytes); @@ -1333,7 +1337,8 @@ // Check for errors, not for 4.1.1 or newer, // as the new auth protocol doesn't work that way // (see secureAuth411() for more details...) - if (!versionMeetsMinimum(4, 1, 1)) { + //if (!versionMeetsMinimum(4, 1, 1)) { + if (!(versionMeetsMinimum(4, 1, 1) || !((this.protocolVersion > 9) && (this.serverCapabilities & CLIENT_PROTOCOL_41) != 0))) { checkErrorPacket(); }